xunge/DecIR huggingface dataset:
/* Type definitions */
struct hvl_tune {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct hvl_tune *);
void hvl_FreeTune(struct hvl_tune *ht) {
  if (!ht)
    return;
  free(ht);
}


x86 assembly (clang, -O0):
<hvl_FreeTune>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <hvl_FreeTune+0x1c>
jmp    1135 <hvl_FreeTune+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hvl_FreeTune>:
test   %rdi,%rdi
je     111a <hvl_FreeTune+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.hvl_tune = type { i32 }
define void @hvl_FreeTune(%struct.hvl_tune* %0) {
%2 = alloca %struct.hvl_tune*
store %struct.hvl_tune* %0, %struct.hvl_tune** %2
%3 = load %struct.hvl_tune*, %struct.hvl_tune** %2
%4 = icmp ne %struct.hvl_tune* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.hvl_tune*, %struct.hvl_tune** %2
%8 = call i32 @free(%struct.hvl_tune* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.hvl_tune = type { i32 }
define void @hvl_FreeTune(%struct.hvl_tune* %0) {
%2 = icmp eq %struct.hvl_tune* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.hvl_tune* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
struct arena {
  int dummy;
};

/* Variables and functions */
void *arena_alloc_expand(struct arena *, size_t);
void *arena_alloc_noexpand(struct arena *, size_t);
void *arena_alloc(struct arena *arena, size_t size) {
  void *p;
  p = arena_alloc_noexpand(arena, size);
  if (p)
    return p;
  return arena_alloc_expand(arena, size);
}


x86 assembly (clang, -O0):
<arena_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <arena_alloc_noexpand@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <arena_alloc+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <arena_alloc+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <arena_alloc_expand@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arena_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <arena_alloc_noexpand@plt>
test   %rax,%rax
je     113c <arena_alloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <arena_alloc_expand@plt>

LLVM IR (-O0):
%struct.arena = type { i32 }
define i8* @arena_alloc(%struct.arena* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca %struct.arena*
%5 = alloca i64
%6 = alloca i8*
store %struct.arena* %0, %struct.arena** %4
store i64 %1, i64* %5
%7 = load %struct.arena*, %struct.arena** %4
%8 = load i64, i64* %5
%9 = call i8* @arena_alloc_noexpand(%struct.arena* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %6
store i8* %13, i8** %3
br label %18
14: ; preds = %2
%15 = load %struct.arena*, %struct.arena** %4
%16 = load i64, i64* %5
%17 = call i8* @arena_alloc_expand(%struct.arena* %15, i64 %16)
store i8* %17, i8** %3
br label %18
18: ; preds = %14, %12
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
%struct.arena = type { i32 }
define i8* @arena_alloc(%struct.arena* %0, i64 %1) {
%3 = tail call i8* @arena_alloc_noexpand(%struct.arena* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @arena_alloc_expand(%struct.arena* %0, i64 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ %3, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void aw_bdb_init_environment(char *dir) {
  fatal("BerkeleyDB support not compiled");
}


x86 assembly (clang, -O0):
<aw_bdb_init_environment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aw_bdb_init_environment>:
lea    0xee9(%rip),%rdi
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define void @aw_bdb_init_environment(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define void @aw_bdb_init_environment(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void test97_Test_pollen__run__E() { exit(0); }


x86 assembly (clang, -O0):
<test97_Test_pollen__run__E>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<test97_Test_pollen__run__E>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @test97_Test_pollen__run__E() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @test97_Test_pollen__run__E() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ glmACos3f_(float *);
int /*<<< orphan*/ glmDegrees3f_(float *);
void glmACosD3f_(float x[3]) {
  glmACos3f_(x);
  glmDegrees3f_(x);
}


x86 assembly (clang, -O0):
<glmACosD3f_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <glmACos3f_@plt>
mov    -0x8(%rbp),%rdi
call   1030 <glmDegrees3f_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmACosD3f_>:
push   %rbx
mov    %rdi,%rbx
call   1040 <glmACos3f_@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <glmDegrees3f_@plt>

LLVM IR (-O0):
define void @glmACosD3f_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @glmACos3f_(float* %3)
%5 = load float*, float** %2
%6 = call i32 @glmDegrees3f_(float* %5)
ret void
}

LLVM IR (-O2):
define void @glmACosD3f_(float* %0) {
%2 = tail call i32 @glmACos3f_(float* %0)
%3 = tail call i32 @glmDegrees3f_(float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find_track(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char search_for[80];
  printf("Search for: ");
  scanf("%79s", search_for);
  find_track(search_for);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <find_track@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <find_track@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Search for: \00"
@.str.1 = [5 x i8] c"%79s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%7 = call i32 @find_track(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Search for: \00"
@.str.1 = [5 x i8] c"%79s\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @find_track(i8* %2)
ret i32 0
}
void sqls_define_blog(void) {}


x86 assembly (clang, -O0):
<sqls_define_blog>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqls_define_blog>:
ret

LLVM IR (-O0):
define void @sqls_define_blog() {
ret void
}

LLVM IR (-O2):
define void @sqls_define_blog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(char);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  char x;
  x = 123;
  print_int(x);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x7b,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <print_int@plt>
lea    0xec4(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7b,%edi
call   1040 <print_int@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i8
store i8 123, i8* %1
%2 = load i8, i8* %1
%3 = call i32 @print_int(i8 signext %2)
%4 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_int(i8 signext 123)
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ del;

/* Variables and functions */
int write(int, char const *, int);
int xdel(int fd) {
  const char del[] = "\b\b\b\b    \b\b\b\b";
  return write(fd, del, sizeof(del) - 1);
}


x86 assembly (clang, -O0):
<xdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed7(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0xc,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdel>:
sub    $0x18,%rsp
movabs $0x8080808202020,%rax
mov    %rax,0xd(%rsp)
movabs $0x2020202008080808,%rax
20 20 20
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0xc,%edx
call   1030 <write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.xdel.del = [13 x i8] c"\08\08\08\08 \08\08\08\08\00"
define i32 @xdel(i32 %0) {
%2 = alloca i32
%3 = alloca [13 x i8]
store i32 %0, i32* %2
%4 = bitcast [13 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%7 = call i32 @write(i32 %5, i8* %6, i32 12)
ret i32 %7
}

LLVM IR (-O2):
@__const.xdel.del = [13 x i8] c"\08\08\08\08 \08\08\08\08\00"
define i32 @xdel(i32 %0) {
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%4 = call i32 @write(i32 %0, i8* %3, i32 12)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fline__close(void) {
  extern FILE *fp;
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<fline__close>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fline__close>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@fp = external global i32*
define i32 @fline__close() {
%1 = load i32*, i32** @fp
%2 = call i32 @fclose(i32* %1)
ret i32 0
}

LLVM IR (-O2):
@fp = external global i32*
define i32 @fline__close() {
%1 = load i32*, i32** @fp
%2 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ msg_read_motd();
int do_init_msg(void) {
  msg_read_motd();
  return 0;
}


x86 assembly (clang, -O0):
<do_init_msg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <msg_read_motd@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_init_msg>:
push   %rax
xor    %eax,%eax
call   1030 <msg_read_motd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @do_init_msg() {
%1 = call i32 (...) @msg_read_motd()
ret i32 0
}

LLVM IR (-O2):
define i32 @do_init_msg() {
%1 = tail call i32 (...) @msg_read_motd()
ret i32 0
}
backslash(c) {
  switch (c) {
  case 'b':
    return '\b';
  case 'f':
    return '\f';
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  case 'v':
    return '\v';
  }
  return c;
}


x86 assembly (clang, -O0):
<backslash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     1178 <backslash+0x78>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x8,-0x4(%rbp)
jmp    117e <backslash+0x7e>
movl   $0xc,-0x4(%rbp)
jmp    117e <backslash+0x7e>
movl   $0xa,-0x4(%rbp)
jmp    117e <backslash+0x7e>
movl   $0xd,-0x4(%rbp)
jmp    117e <backslash+0x7e>
movl   $0x9,-0x4(%rbp)
jmp    117e <backslash+0x7e>
movl   $0xb,-0x4(%rbp)
jmp    117e <backslash+0x7e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<backslash>:
mov    %edi,%eax
lea    -0x62(%rax),%ecx
ror    %ecx
cmp    $0xa,%ecx
ja     1123 <backslash+0x23>
mov    $0x745,%edx
bt     %ecx,%edx
jae    1123 <backslash+0x23>
movslq %ecx,%rax
lea    0xee0(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @backslash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 98, label %5
i32 102, label %6
i32 110, label %7
i32 114, label %8
i32 116, label %9
i32 118, label %10
]
5: ; preds = %1
store i32 8, i32* %2
br label %13
6: ; preds = %1
store i32 12, i32* %2
br label %13
7: ; preds = %1
store i32 10, i32* %2
br label %13
8: ; preds = %1
store i32 13, i32* %2
br label %13
9: ; preds = %1
store i32 9, i32* %2
br label %13
10: ; preds = %1
store i32 11, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %10, %9, %8, %7, %6, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.backslash = [11 x i32] [i32 8, i32 8, i32 12, i32 8, i32 8, i32 8, i32 10, i32 8, i32 13, i32 9, i32 11]
define i32 @backslash(i32 %0) {
%2 = add i32 %0, -98
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 31)
%4 = icmp ult i32 %3, 11
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = trunc i32 %3 to i16
%7 = lshr i16 1861, %6
%8 = and i16 %7, 1
%9 = icmp eq i16 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.backslash, i64 0, i64 %11
%13 = load i32, i32* %12
br label %14
14: ; preds = %1, %5, %10
%15 = phi i32 [ %13, %10 ], [ %0, %5 ], [ %0, %1 ]
ret i32 %15
}
long long quadratic(long long x, char a, char b, char c) {
  return a * x * x + b * x + c;
}


x86 assembly (clang, -O0):
<quadratic>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
movsbq -0x9(%rbp),%rax
imul   -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
movsbq -0xa(%rbp),%rcx
imul   -0x8(%rbp),%rcx
add    %rcx,%rax
movsbq -0xb(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic>:
movslq %esi,%rax
imul   %rdi,%rax
movslq %edx,%rdx
add    %rax,%rdx
imul   %rdi,%rdx
movslq %ecx,%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @quadratic(i64 %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i64
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i64 %0, i64* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %6
%10 = sext i8 %9 to i64
%11 = load i64, i64* %5
%12 = mul nsw i64 %10, %11
%13 = load i64, i64* %5
%14 = mul nsw i64 %12, %13
%15 = load i8, i8* %7
%16 = sext i8 %15 to i64
%17 = load i64, i64* %5
%18 = mul nsw i64 %16, %17
%19 = add nsw i64 %14, %18
%20 = load i8, i8* %8
%21 = sext i8 %20 to i64
%22 = add nsw i64 %19, %21
ret i64 %22
}

LLVM IR (-O2):
define i64 @quadratic(i64 %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = sext i8 %1 to i64
%6 = mul nsw i64 %5, %0
%7 = sext i8 %2 to i64
%8 = add i64 %6, %7
%9 = mul i64 %8, %0
%10 = sext i8 %3 to i64
%11 = add nsw i64 %9, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned char);
void add_m32_imm8(unsigned int *m32, unsigned char imm8) {
  put8(0x83);
  put8(0x05);
  put32((unsigned int)(m32));
  put8(imm8);
}


x86 assembly (clang, -O0):
<add_m32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x83,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_m32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x83,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
call   1040 <put32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @add_m32_imm8(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -125)
%6 = call i32 @put8(i8 zeroext 5)
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %7 to i32
%9 = call i32 @put32(i32 %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @add_m32_imm8(i32* %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -125)
%4 = tail call i32 @put8(i8 zeroext 5)
%5 = ptrtoint i32* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @put32(i32 %6)
%8 = tail call i32 @put8(i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int resp, a, b;
  resp = a - b;
  assert(resp == a - b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = sub nsw i32 %4, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ copicad(char *, char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
main() {
  char cadena1[81], cadena2[81];
  printf("Introducir una cadena: ");
  gets(cadena1);
  copicad(cadena2, cadena1);
  printf("La cadena copiada es: %s\n", cadena2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <gets@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <copicad@plt>
lea    -0xc0(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xb8,%rsp
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <copicad@plt>
lea    0xeae(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Introducir una cadena: \00"
@.str.1 = [26 x i8] c"La cadena copiada es: %s\0A\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = alloca [81 x i8]
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%8 = call i32 @copicad(i8* %6, i8* %7)
%9 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Introducir una cadena: \00"
@.str.1 = [26 x i8] c"La cadena copiada es: %s\0A\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = alloca [81 x i8]
%3 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gets(i8* %3)
%7 = call i32 @copicad(i8* %4, i8* %3)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ NA_merge_sorted_arrays(size_t *, size_t *, size_t, size_t,
                                          size_t *);
int NA_rm_duplicate(size_t *, size_t);
int /*<<< orphan*/ NA_sort_bubble(size_t *, int);
size_t NA_merge_and_sort_sorted_arrays(size_t *arr1, size_t *arr2, size_t n1,
                                       size_t n2, size_t *arr3) {
  NA_merge_sorted_arrays(arr1, arr2, n1, n2, arr3);
  int n3 = NA_rm_duplicate(arr3, n1 + n2);
  NA_sort_bubble(arr3, n3);
  return n3;
}


x86 assembly (clang, -O0):
<NA_merge_and_sort_sorted_arrays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <NA_merge_sorted_arrays@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    -0x20(%rbp),%rsi
call   1050 <NA_rm_duplicate@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <NA_sort_bubble@plt>
movslq -0x2c(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NA_merge_and_sort_sorted_arrays>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%r15
call   1040 <NA_merge_sorted_arrays@plt>
add    %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <NA_rm_duplicate@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <NA_sort_bubble@plt>
movslq %ebx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @NA_merge_and_sort_sorted_arrays(i64* %0, i64* %1, i64 %2, i64 %3, i64* %4) {
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64*
%11 = alloca i32
store i64* %0, i64** %6
store i64* %1, i64** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64* %4, i64** %10
%12 = load i64*, i64** %6
%13 = load i64*, i64** %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = load i64*, i64** %10
%17 = call i32 @NA_merge_sorted_arrays(i64* %12, i64* %13, i64 %14, i64 %15, i64* %16)
%18 = load i64*, i64** %10
%19 = load i64, i64* %8
%20 = load i64, i64* %9
%21 = add i64 %19, %20
%22 = call i32 @NA_rm_duplicate(i64* %18, i64 %21)
store i32 %22, i32* %11
%23 = load i64*, i64** %10
%24 = load i32, i32* %11
%25 = call i32 @NA_sort_bubble(i64* %23, i32 %24)
%26 = load i32, i32* %11
%27 = sext i32 %26 to i64
ret i64 %27
}

LLVM IR (-O2):
define i64 @NA_merge_and_sort_sorted_arrays(i64* %0, i64* %1, i64 %2, i64 %3, i64* %4) {
%6 = tail call i32 @NA_merge_sorted_arrays(i64* %0, i64* %1, i64 %2, i64 %3, i64* %4)
%7 = add i64 %3, %2
%8 = tail call i32 @NA_rm_duplicate(i64* %4, i64 %7)
%9 = tail call i32 @NA_sort_bubble(i64* %4, i32 %8)
%10 = sext i32 %8 to i64
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char str[100];
  scanf("%[^0-9]", str);
  printf("str = %s", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%[^0-9]\00"
@.str.1 = [9 x i8] c"str = %s\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%[^0-9]\00"
@.str.1 = [9 x i8] c"str = %s\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
void cpu_relax(void) { __builtin_ia32_pause(); }


x86 assembly (clang, -O0):
<cpu_relax>:
push   %rbp
mov    %rsp,%rbp
pause
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_relax>:
pause
ret

LLVM IR (-O0):
define void @cpu_relax() {
ret void
}

LLVM IR (-O2):
define void @cpu_relax() {
tail call void @llvm.x86.sse2.pause()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo) { printf("READER: get signal\n"); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"READER: get signal\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"READER: get signal\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct usershell_test_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __usershell_test_data_clear(struct usershell_test_data *);
void __usershell_test_data_destroy(struct usershell_test_data *td) {
  __usershell_test_data_clear(td);
}


x86 assembly (clang, -O0):
<__usershell_test_data_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__usershell_test_data_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__usershell_test_data_destroy>:
jmp    1030 <__usershell_test_data_clear@plt>

LLVM IR (-O0):
%struct.usershell_test_data = type { i32 }
define void @__usershell_test_data_destroy(%struct.usershell_test_data* %0) {
%2 = alloca %struct.usershell_test_data*
store %struct.usershell_test_data* %0, %struct.usershell_test_data** %2
%3 = load %struct.usershell_test_data*, %struct.usershell_test_data** %2
%4 = call i32 @__usershell_test_data_clear(%struct.usershell_test_data* %3)
ret void
}

LLVM IR (-O2):
%struct.usershell_test_data = type { i32 }
define void @__usershell_test_data_destroy(%struct.usershell_test_data* %0) {
%2 = tail call i32 @__usershell_test_data_clear(%struct.usershell_test_data* %0)
ret void
}
/* Variables and functions */
int get_max_brightness();
int /*<<< orphan*/ write_int(char *, int);
void set_brightness(int brightness) {
  int min_brightness = 0, max_brightness = get_max_brightness();
  if (brightness < min_brightness)
    brightness = min_brightness;
  if (brightness > max_brightness)
    brightness = max_brightness;
  write_int("/sys/class/leds/smc::kbd_backlight/brightness", brightness);
}


x86 assembly (clang, -O0):
<set_brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <get_max_brightness@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114e <set_brightness+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1160 <set_brightness+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <write_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_brightness>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <get_max_brightness@plt>
test   %ebx,%ebx
cmovns %ebx,%ebp
cmp    %eax,%ebp
cmovg  %eax,%ebp
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write_int@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"/sys/class/leds/smc::kbd_backlight/brightness\00"
define void @set_brightness(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = call i32 (...) @get_max_brightness()
store i32 %5, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %11
%18 = load i32, i32* %2
%19 = call i32 @write_int(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"/sys/class/leds/smc::kbd_backlight/brightness\00"
define void @set_brightness(i32 %0) {
%2 = tail call i32 (...) @get_max_brightness()
%3 = icmp sgt i32 %0, 0
%4 = select i1 %3, i32 %0, i32 0
%5 = icmp sgt i32 %4, %2
%6 = select i1 %5, i32 %2, i32 %4
%7 = tail call i32 @write_int(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void GP_add_vertex_i(void *arg, int v, int label) {
  printf("v %d %d\n", v, label);
}


x86 assembly (clang, -O0):
<GP_add_vertex_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GP_add_vertex_i>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"v %d %d\0A\00"
define void @GP_add_vertex_i(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"v %d %d\0A\00"
define void @GP_add_vertex_i(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_testmess(int testcode) {
  if (testcode)
    printf("\n\nVertices ARE adjacent..");
  else
    printf("\n\nVertices are NOT adjacent..");
}


x86 assembly (clang, -O0):
<print_testmess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <print_testmess+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <print_testmess+0x32>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_testmess>:
test   %edi,%edi
lea    0xf01(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0A\0AVertices ARE adjacent..\00"
@.str.1 = [30 x i8] c"\0A\0AVertices are NOT adjacent..\00"
define void @print_testmess(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0A\0AVertices ARE adjacent..\00"
@.str.1 = [30 x i8] c"\0A\0AVertices are NOT adjacent..\00"
define void @print_testmess(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void tcp_close(int skt) {
  if (skt <= 0)
    return;
  close(skt);
}


x86 assembly (clang, -O0):
<tcp_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     112a <tcp_close+0x1a>
jmp    1132 <tcp_close+0x22>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_close>:
test   %edi,%edi
jle    1119 <tcp_close+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @tcp_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @close(i32 %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @tcp_close(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
int C2Fmax(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<C2Fmax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <C2Fmax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <C2Fmax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C2Fmax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @C2Fmax(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @C2Fmax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void shared_f() { puts("Function from a lib"); }


x86 assembly (clang, -O0):
<shared_f>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shared_f>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Function from a lib\00"
define void @shared_f() {
%1 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Function from a lib\00"
define void @shared_f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
int _neq(int x, int y, void *garb) { return x != y; }


x86 assembly (clang, -O0):
<_neq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_neq>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @_neq(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp ne i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_neq(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp ne i32 %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void UpnpDisplayBanner(FILE *fd, const char **lines, size_t size,
                       int starlength) {
  return;
  fd = fd;
  lines = lines;
  size = size;
  starlength = starlength;
}


x86 assembly (clang, -O0):
<UpnpDisplayBanner>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpDisplayBanner>:
ret

LLVM IR (-O0):
define void @UpnpDisplayBanner(i32* %0, i8** %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i64
%8 = alloca i32
store i32* %0, i32** %5
store i8** %1, i8*** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @UpnpDisplayBanner(i32* nocapture %0, i8** nocapture %1, i64 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
unsigned int alarm(unsigned int seconds) {
  __set_errno(ENOSYS);
  return 0;
}


x86 assembly (clang, -O0):
<alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alarm>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @alarm(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 0
}
/* Variables and functions */
char *sb_str_lstrip(int /*<<< orphan*/);
int /*<<< orphan*/ sb_str_rstrip(char *);
char *sb_str_strip(char *str) { return sb_str_lstrip(sb_str_rstrip(str)); }


x86 assembly (clang, -O0):
<sb_str_strip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sb_str_rstrip@plt>
mov    %eax,%edi
call   1030 <sb_str_lstrip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_str_strip>:
push   %rax
call   1040 <sb_str_rstrip@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sb_str_lstrip@plt>

LLVM IR (-O0):
define i8* @sb_str_strip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sb_str_rstrip(i8* %3)
%5 = call i8* @sb_str_lstrip(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @sb_str_strip(i8* %0) {
%2 = tail call i32 @sb_str_rstrip(i8* %0)
%3 = tail call i8* @sb_str_lstrip(i32 %2)
ret i8* %3
}
int main() { return 1 || 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x;
  short int y;
  printf("size of int: %d\n", sizeof x);
  printf("size of short: %d\n", sizeof y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"size of int: %d\0A\00"
@.str.1 = [19 x i8] c"size of short: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"size of int: %d\0A\00"
@.str.1 = [19 x i8] c"size of short: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysCtlPeripheralDeepSleepDisable(uint32_t ui32Peripheral) {
  ;
  (*((volatile uint32_t
          *)(((uint32_t)(0x400fe800 + ((ui32Peripheral & 0xff00) >> 8)) &
              0xF0000000) |
             0x02000000 |
             (((uint32_t)(0x400fe800 + ((ui32Peripheral & 0xff00) >> 8)) &
               0x000FFFFF)
              << 5) |
             ((ui32Peripheral & 0xff) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<SysCtlPeripheralDeepSleepDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
add    $0x400fe800,%eax
and    $0xf0000000,%eax
or     $0x2000000,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
add    $0x400fe800,%ecx
and    $0xfffff,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPeripheralDeepSleepDisable>:
movzbl %dil,%eax
shr    $0x3,%edi
and    $0x1fe0,%edi
shl    $0x2,%eax
or     %edi,%eax
movl   $0x0,0x43fd0000(%rax)
ret

LLVM IR (-O0):
define void @SysCtlPeripheralDeepSleepDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = add nsw i32 1074784256, %5
%7 = and i32 %6, -268435456
%8 = or i32 %7, 33554432
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = add nsw i32 1074784256, %11
%13 = and i32 %12, 1048575
%14 = shl i32 %13, 5
%15 = or i32 %8, %14
%16 = load i32, i32* %2
%17 = and i32 %16, 255
%18 = shl i32 %17, 2
%19 = or i32 %15, %18
%20 = zext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 0, i32* %21
ret void
}

LLVM IR (-O2):
define void @SysCtlPeripheralDeepSleepDisable(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 8160
%4 = shl i32 %0, 2
%5 = and i32 %4, 1020
%6 = or i32 %5, %3
%7 = or i32 %6, 1140654080
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 0, i32* %9
ret void
}
int a(int x) { return 1; }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 1
}

LLVM IR (-O2):
define i32 @a(i32 %0) {
ret i32 1
}
int test_imm_DCuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xDC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DCuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xdc,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DCuint64_midword_reg>:
test   $0xdc0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DCuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 220
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_DCuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14417920
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_tabort(int /*<<< orphan*/);
void must_not_compile1(void) { __builtin_tabort(0); }


x86 assembly (clang, -O0):
<must_not_compile1>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <__builtin_tabort@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<must_not_compile1>:
xor    %edi,%edi
jmp    1030 <__builtin_tabort@plt>

LLVM IR (-O0):
define void @must_not_compile1() {
%1 = call i32 @__builtin_tabort(i32 0)
ret void
}

LLVM IR (-O2):
define void @must_not_compile1() {
%1 = tail call i32 @__builtin_tabort(i32 0)
ret void
}
int do_074() { return 74; }


x86 assembly (clang, -O0):
<do_074>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_074>:
mov    $0x4a,%eax
ret

LLVM IR (-O0):
define i32 @do_074() {
ret i32 74
}

LLVM IR (-O2):
define i32 @do_074() {
ret i32 74
}
void XRebindKeysym() {}


x86 assembly (clang, -O0):
<XRebindKeysym>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XRebindKeysym>:
ret

LLVM IR (-O0):
define void @XRebindKeysym() {
ret void
}

LLVM IR (-O2):
define void @XRebindKeysym() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int /*<<< orphan*/ tm_gmtoff;
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int32_t get_current_timezone_offset(void) {
  time_t t = time(NULL);
  struct tm lt = {0};
  localtime_r(&t, &lt);
  return lt.tm_gmtoff;
}


x86 assembly (clang, -O0):
<get_current_timezone_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_timezone_offset>:
sub    $0x18,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <localtime_r@plt>
mov    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
define i32 @get_current_timezone_offset() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = bitcast %struct.tm* %2 to i8*
%5 = call i32 @localtime_r(i32* %1, %struct.tm* %2)
%6 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
define i32 @get_current_timezone_offset() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i64* %2 to %struct.tm*
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %1
%6 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%7 = call i32 @localtime_r(i32* %1, %struct.tm* %3)
%8 = bitcast i64* %2 to i32*
%9 = load i32, i32* %8
ret i32 %9
}