xunge/DecIR huggingface dataset:
void INT_Excep_IEB_IEBINT(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_IEB_IEBINT() {
ret void
}
void a1_function(void) {}


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

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

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

LLVM IR (-O2):
define void @a1_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_ASYNC;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fcntl(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void set_unblock(int n) {
  if (fcntl(0, F_SETFL, O_ASYNC) < 0) {
    perror("Fcntl F_SETFL");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<set_unblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    1178 <set_unblock+0x48>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_unblock>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1030 <fcntl@plt>
test   %rax,%rax
js     1151 <set_unblock+0x21>
pop    %rax
ret
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@O_ASYNC = global i32 0
@.str = [14 x i8] c"Fcntl F_SETFL\00"
@EXIT_FAILURE = global i32 0
define void @set_unblock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @F_SETFL
%4 = load i32, i32* @O_ASYNC
%5 = call i64 @fcntl(i32 0, i32 %3, i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@O_ASYNC = global i32 0
@.str = [14 x i8] c"Fcntl F_SETFL\00"
@EXIT_FAILURE = global i32 0
define void @set_unblock(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @O_ASYNC
%4 = tail call i64 @fcntl(i32 0, i32 %2, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char const *, int /*<<< orphan*/);
bool file_exists(const char *filename) { return access(filename, F_OK) != -1; }


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
char special(char *s) {
  char c;
  char b;
  switch (*s) {
  case '^':
    b = *++s;
    if (b == '?') {
      c = b | 0x40;
    } else {
      c = b & 0x1f;
    }
    break;
  default:
    c = *s;
    break;
  }
  return c;
}


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
sub    $0x5e,%al
jne    115b <special+0x5b>
jmp    111b <special+0x1b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    0x1(%rax),%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
cmp    $0x3f,%eax
jne    114c <special+0x4c>
movsbl -0xa(%rbp),%eax
or     $0x40,%eax
mov    %al,-0x9(%rbp)
jmp    1156 <special+0x56>
movsbl -0xa(%rbp),%eax
and    $0x1f,%eax
mov    %al,-0x9(%rbp)
jmp    1164 <special+0x64>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<special>:
mov    (%rdi),%al
cmp    $0x5e,%al
jne    111b <special+0x1b>
mov    0x1(%rdi),%al
mov    %eax,%ecx
and    $0x1f,%cl
cmp    $0x3f,%al
movzbl %cl,%ecx
mov    $0x7f,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @special(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %26 [
i32 94, label %8
]
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %10
store i8 %11, i8* %4
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 63
br i1 %14, label %15, label %20
15: ; preds = %8
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = or i32 %17, 64
%19 = trunc i32 %18 to i8
store i8 %19, i8* %3
br label %25
20: ; preds = %8
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = and i32 %22, 31
%24 = trunc i32 %23 to i8
store i8 %24, i8* %3
br label %25
25: ; preds = %20, %15
br label %29
26: ; preds = %1
%27 = load i8*, i8** %2
%28 = load i8, i8* %27
store i8 %28, i8* %3
br label %29
29: ; preds = %26, %25
%30 = load i8, i8* %3
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @special(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 94
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 63
%8 = and i8 %6, 31
%9 = select i1 %7, i8 127, i8 %8
br label %10
10: ; preds = %4, %1
%11 = phi i8 [ %2, %1 ], [ %9, %4 ]
ret i8 %11
}
/* Type definitions */
struct single_row_lut {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int interpolate_vth(struct single_row_lut *vth_sf_lut, int batt_temp) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<interpolate_vth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate_vth>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.single_row_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_vth(%struct.single_row_lut* %0, i32 %1) {
%3 = alloca %struct.single_row_lut*
%4 = alloca i32
store %struct.single_row_lut* %0, %struct.single_row_lut** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.single_row_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_vth(%struct.single_row_lut* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int dlink_insert_first(int);
int push(int val) { return dlink_insert_first(val); }


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

x86 assembly (clang, -O2):
<push>:
jmp    1030 <dlink_insert_first@plt>

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

LLVM IR (-O2):
define i32 @push(i32 %0) {
%2 = tail call i32 @dlink_insert_first(i32 %0)
ret i32 %2
}
double recip(int denom) { return 1.0 / (double)denom; }


x86 assembly (clang, -O0):
<recip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<recip>:
cvtsi2sd %edi,%xmm1
movsd  0xef4(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @recip(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @recip(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ karma_load();
int /*<<< orphan*/ karma_quit();
void karma_modified(void) {
  karma_quit();
  karma_load();
}


x86 assembly (clang, -O0):
<karma_modified>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <karma_quit@plt>
mov    $0x0,%al
call   1030 <karma_load@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<karma_modified>:
push   %rax
xor    %eax,%eax
call   1040 <karma_quit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <karma_load@plt>

LLVM IR (-O0):
define void @karma_modified() {
%1 = call i32 (...) @karma_quit()
%2 = call i32 (...) @karma_load()
ret void
}

LLVM IR (-O2):
define void @karma_modified() {
%1 = tail call i32 (...) @karma_quit()
%2 = tail call i32 (...) @karma_load()
ret void
}
void gs_display_dispose(long display) {}


x86 assembly (clang, -O0):
<gs_display_dispose>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gs_display_dispose(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret void
}

LLVM IR (-O2):
define void @gs_display_dispose(i64 %0) {
ret void
}
/* Variables and functions */
int consommer();
int /*<<< orphan*/ printf(char *, long, int);
long consommateur(long thrdID) {
  while (1) {
    int donnee = consommer();
    printf("(%ld) - %d\n", thrdID, donnee);
  }
  return thrdID;
}


x86 assembly (clang, -O0):
<consommateur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <consommer@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
jmp    112c <consommateur+0xc>

x86 assembly (clang, -O2):
<consommateur>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <consommer@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
jmp    1130 <consommateur+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"(%ld) - %d\0A\00"
define i64 @consommateur(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
br label %4
4: ; preds = %1, %4
%5 = call i32 (...) @consommer()
store i32 %5, i32* %3
%6 = load i64, i64* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %6, i32 %7)
br label %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"(%ld) - %d\0A\00"
define i64 @consommateur(i64 %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @consommer()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %3)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void _print_usage_header(const char *command) {
  printf("Usage: %s [OPTION]... [FILE]\n"
         "Read a list and retrieve some data out of it.\n",
         command);
}


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

x86 assembly (clang, -O2):
<_print_usage_header>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"Usage: %s [OPTION]... [FILE]\0ARead a list and retrieve some data out of it.\0A\00"
define void @_print_usage_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [76 x i8] c"Usage: %s [OPTION]... [FILE]\0ARead a list and retrieve some data out of it.\0A\00"
define void @_print_usage_header(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void pcp_print_irq_stats(struct activity *a, int curr) {}


x86 assembly (clang, -O0):
<pcp_print_irq_stats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_irq_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_irq_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int is_multicast_ether_addr(const void *addr) {
  const uint8_t *addr_bytes = addr;
  return (addr_bytes[0] & 0x01);
}


x86 assembly (clang, -O0):
<is_multicast_ether_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_multicast_ether_addr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = and i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_multicast_ether_addr(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
char *malloc(unsigned long long);
int main(void) {
  char *x = malloc(1024ULL * 1024ULL * 1024ULL * 1024ULL);
  x[0] = 'a';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x10000000000,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i64 1099511627776)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
store i8 97, i8* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int GetClockTimeInNanoSec() {
  struct timeval t2;
  gettimeofday(&t2, NULL);
  return t2.tv_sec + t2.tv_usec;
}


x86 assembly (clang, -O0):
<GetClockTimeInNanoSec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetClockTimeInNanoSec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x4(%rsp),%eax
add    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @GetClockTimeInNanoSec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @GetClockTimeInNanoSec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void loop_forever(void) {
  while (1)
    sleep(1);
}


x86 assembly (clang, -O0):
<loop_forever>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <loop_forever+0x9>
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1119 <loop_forever+0x9>

x86 assembly (clang, -O2):
<loop_forever>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <loop_forever+0x10>

LLVM IR (-O0):
define void @loop_forever() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @loop_forever() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int genrand_int32();
double genrand_res53(void) {
  unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6;
  return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<genrand_res53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <genrand_int32@plt>
mov    %eax,%ecx
mov    -0x11(%rbp),%al
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    %rcx,-0x8(%rbp)
call   1030 <genrand_int32@plt>
sar    $0x6,%eax
cltq
mov    %rax,-0x10(%rbp)
movaps 0xeca(%rip),%xmm3
movq   -0x8(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xec9(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_res53>:
push   %rbx
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    $0x6,%eax
cltq
movq   %rbx,%xmm1
movdqa 0xec9(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xecd(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movq   %rax,%xmm1
punpckldq %xmm2,%xmm1
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
mulsd  0xeb0(%rip),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xea8(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @genrand_res53() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 (...) @genrand_int32()
%4 = ashr i32 %3, 5
%5 = sext i32 %4 to i64
store i64 %5, i64* %1
%6 = call i32 (...) @genrand_int32()
%7 = ashr i32 %6, 6
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = uitofp i64 %9 to double
%11 = load i64, i64* %2
%12 = uitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %10, double 0x4190000000000000, double %12)
%14 = fmul double %13, 0x3CA0000000000000
ret double %14
}

LLVM IR (-O2):
define double @genrand_res53() {
%1 = tail call i32 (...) @genrand_int32()
%2 = ashr i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i32 (...) @genrand_int32()
%5 = ashr i32 %4, 6
%6 = sext i32 %5 to i64
%7 = uitofp i64 %3 to double
%8 = uitofp i64 %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0x4190000000000000, double %8)
%10 = fmul double %9, 0x3CA0000000000000
ret double %10
}
unsigned short clearBit_fun_ushort(unsigned short x, unsigned i) {
  return x & ~(1 << i);
}


x86 assembly (clang, -O0):
<clearBit_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBit_fun_ushort>:
mov    %edi,%eax
btr    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @clearBit_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = xor i32 %8, -1
%10 = and i32 %6, %9
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @clearBit_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i16
%5 = xor i16 %4, -1
%6 = and i16 %5, %0
ret i16 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int readxy_ex(char *, double **, double **, int *, int /*<<< orphan*/ *, int);
int readxy(char *filename, double **x, double **y, int *n, FILE *output) {
  return (readxy_ex(filename, x, y, n, output, 1));
}


x86 assembly (clang, -O0):
<readxy>:
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
mov    $0x1,%r9d
call   1030 <readxy_ex@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readxy>:
mov    $0x1,%r9d
jmp    1030 <readxy_ex@plt>

LLVM IR (-O0):
define i32 @readxy(i8* %0, double** %1, double** %2, i32* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca double**
%8 = alloca double**
%9 = alloca i32*
%10 = alloca i32*
store i8* %0, i8** %6
store double** %1, double*** %7
store double** %2, double*** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i8*, i8** %6
%12 = load double**, double*** %7
%13 = load double**, double*** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @readxy_ex(i8* %11, double** %12, double** %13, i32* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
define i32 @readxy(i8* %0, double** %1, double** %2, i32* %3, i32* %4) {
%6 = tail call i32 @readxy_ex(i8* %0, double** %1, double** %2, i32* %3, i32* %4, i32 1)
ret i32 %6
}
void SDB_dbg_cmd() {}


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

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

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

LLVM IR (-O2):
define void @SDB_dbg_cmd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void gaprnt(int i, char *ch) { printf("%s", ch); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @gaprnt(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @gaprnt(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void WatchdogIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)) {
  ASSERT((ui32Base == 0x40000000) || (ui32Base == 0x40001000));
  IntRegister(34, pfnHandler);
  IntEnable(34);
}


x86 assembly (clang, -O0):
<WatchdogIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x40000000,-0x4(%rbp)
mov    %al,-0x11(%rbp)
je     115e <WatchdogIntRegister+0x2e>
cmpl   $0x40001000,-0x4(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ASSERT@plt>
mov    -0x10(%rbp),%rsi
mov    $0x22,%edi
call   1040 <IntRegister@plt>
mov    $0x22,%edi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntRegister>:
push   %rbx
mov    %rsi,%rbx
and    $0xffffefff,%edi
xor    %eax,%eax
cmp    $0x40000000,%edi
sete   %al
mov    %eax,%edi
call   1050 <ASSERT@plt>
mov    $0x22,%edi
mov    %rbx,%rsi
call   1040 <IntRegister@plt>
mov    $0x22,%edi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @WatchdogIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1073741824
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073745920
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load void ()*, void ()** %4
%15 = bitcast void ()* %14 to void (...)*
%16 = call i32 @IntRegister(i32 34, void (...)* %15)
%17 = call i32 @IntEnable(i32 34)
ret void
}

LLVM IR (-O2):
define void @WatchdogIntRegister(i32 %0, void ()* %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073741824
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = bitcast void ()* %1 to void (...)*
%8 = tail call i32 @IntRegister(i32 34, void (...)* %7)
%9 = tail call i32 @IntEnable(i32 34)
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
char *init(const int argc, const char *argv[]) {
  struct timeval tv;
  (void)gettimeofday(&tv, (struct timezone *)NULL);
  srand(tv.tv_usec);
  return "7";
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x18(%rbp),%edi
call   1040 <srand@plt>
lea    0xeb5(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
call   1040 <srand@plt>
lea    0xec6(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@.str = [2 x i8] c"7\00"
define i8* @init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.timeval
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, %struct.timezone* null)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @srand(i32 %8)
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@.str = [2 x i8] c"7\00"
define i8* @init(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, %struct.timezone* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @srand(i32 %7)
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct ast {
  int dummy;
};

/* Variables and functions */
struct ast *expr_tail(struct ast *);
struct ast *factor();
struct ast *expr() {
  struct ast *stAst = factor();
  return expr_tail(stAst);
}


x86 assembly (clang, -O0):
<expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <factor@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <expr_tail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expr>:
push   %rax
xor    %eax,%eax
call   1040 <factor@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <expr_tail@plt>

LLVM IR (-O0):
%struct.ast = type { i32 }
define %struct.ast* @expr() {
%1 = alloca %struct.ast*
%2 = call %struct.ast* (...) @factor()
store %struct.ast* %2, %struct.ast** %1
%3 = load %struct.ast*, %struct.ast** %1
%4 = call %struct.ast* @expr_tail(%struct.ast* %3)
ret %struct.ast* %4
}

LLVM IR (-O2):
%struct.ast = type { i32 }
define %struct.ast* @expr() {
%1 = tail call %struct.ast* (...) @factor()
%2 = tail call %struct.ast* @expr_tail(%struct.ast* %1)
ret %struct.ast* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int /*<<< orphan*/ puts(char *);
void fig09_07() {
  int *ptr;
  int x = 12345;
  ptr = &x;
  printf("The value of ptr is %p\n", ptr);
  printf("The address of x is %p\n", &x);
  puts("Printing a % in a format control string");
}


x86 assembly (clang, -O0):
<fig09_07>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3039,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig09_07>:
push   %rbx
sub    $0x10,%rsp
movl   $0x3039,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"The value of ptr is %p\0A\00"
@.str.1 = [24 x i8] c"The address of x is %p\0A\00"
@.str.2 = [40 x i8] c"Printing a % in a format control string\00"
define void @fig09_07() {
%1 = alloca i32*
%2 = alloca i32
store i32 12345, i32* %2
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"The value of ptr is %p\0A\00"
@.str.1 = [24 x i8] c"The address of x is %p\0A\00"
@.str.2 = [40 x i8] c"Printing a % in a format control string\00"
define void @fig09_07() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 12345, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dp_disklock();
int fclose_orig(int /*<<< orphan*/ *);
int fclose(FILE *stream) {
  dp_disklock();
  return (fclose_orig(stream));
}


x86 assembly (clang, -O0):
<fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dp_disklock@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose_orig@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclose>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dp_disklock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose_orig@plt>

LLVM IR (-O0):
define i32 @fclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @dp_disklock()
%4 = load i32*, i32** %2
%5 = call i32 @fclose_orig(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @fclose(i32* %0) {
%2 = tail call i32 (...) @dp_disklock()
%3 = tail call i32 @fclose_orig(i32* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroyVariableHashEntry(void *arg, char *key, char *value) {
  do {
    (void)(arg);
  } while (0);
  free(key);
  free(value);
}


x86 assembly (clang, -O0):
<destroyVariableHashEntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyVariableHashEntry>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @destroyVariableHashEntry(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %7
7: ; preds = %3
%8 = load i8*, i8** %4
br label %9
9: ; preds = %7
%10 = load i8*, i8** %5
%11 = call i32 @free(i8* %10)
%12 = load i8*, i8** %6
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
define void @destroyVariableHashEntry(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @free(i8* %1)
%5 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ errno;
int strtol(char const *, int /*<<< orphan*/ *, int);
int to_int(const char *s) {
  int val;
  errno = 0;
  val = strtol(s, NULL, 10);
  assert(errno == 0);
  return val;
}


x86 assembly (clang, -O0):
<to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e8a(%rip),%rax
cmpq   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_int>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
movq   $0x0,(%r14)
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmpq   $0x0,(%r14)
sete   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i64 0
define i32 @to_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i64 0, i64* @errno
%4 = load i8*, i8** %2
%5 = call i32 @strtol(i8* %4, i32* null, i32 10)
store i32 %5, i32* %3
%6 = load i64, i64* @errno
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @to_int(i8* nocapture %0) {
store i64 0, i64* @errno
%2 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i32 %2
}
__attribute__((no_instrument_function)) void __cyg_profile_func_exit(void *a,
                                                                     void *b) {
  (void)a, (void)b;
}


x86 assembly (clang, -O0):
<__cyg_profile_func_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @__cyg_profile_func_exit(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ string_parse_fractional_12(char const *, double *);
double doztof(const char *string) {
  double v;
  string_parse_fractional_12(string, &v);
  return v;
}


x86 assembly (clang, -O0):
<doztof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <string_parse_fractional_12@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doztof>:
push   %rax
mov    %rsp,%rsi
call   1030 <string_parse_fractional_12@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @doztof(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @string_parse_fractional_12(i8* %4, double* %3)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @doztof(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @string_parse_fractional_12(i8* %0, double* %2)
%5 = load double, double* %2
ret double %5
}
int arg_function_pointer(int i, int (*func)(int, int)) {
  (void)i;
  return func(1234, 5678);
}


x86 assembly (clang, -O0):
<arg_function_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4d2,%edi
mov    $0x162e,%esi
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_function_pointer>:
mov    %rsi,%rax
mov    $0x4d2,%edi
mov    $0x162e,%esi
jmp    *%rax

LLVM IR (-O0):
define i32 @arg_function_pointer(i32 %0, i32 (i32, i32)* %1) {
%3 = alloca i32
%4 = alloca i32 (i32, i32)*
store i32 %0, i32* %3
store i32 (i32, i32)* %1, i32 (i32, i32)** %4
%5 = load i32, i32* %3
%6 = load i32 (i32, i32)*, i32 (i32, i32)** %4
%7 = call i32 %6(i32 1234, i32 5678)
ret i32 %7
}

LLVM IR (-O2):
define i32 @arg_function_pointer(i32 %0, i32 (i32, i32)* nocapture %1) {
%3 = tail call i32 %1(i32 1234, i32 5678)
ret i32 %3
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int filesize(char *filename) {
  int size;
  struct stat fileinfo;
  if (stat(filename, &fileinfo) != 0) {
    size = (int)0;
  } else {
    size = (int)fileinfo.st_size;
  }
  return size;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <filesize+0x2f>
movl   $0x0,-0xc(%rbp)
jmp    1146 <filesize+0x36>
mov    -0x18(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <filesize+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @filesize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %3
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @filesize(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = select i1 %5, i32 %8, i32 0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ AUDIO_SET_AV_SYNC;
scalar_t__ ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int audioSetAVSync(int fd, int state) {
  int ans;
  if ((ans = ioctl(fd, AUDIO_SET_AV_SYNC, state) < 0)) {
    perror("AUDIO SET AV SYNC: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<audioSetAVSync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
test   $0x1,%al
jne    1161 <audioSetAVSync+0x41>
jmp    1179 <audioSetAVSync+0x59>
lea    0xe98(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <audioSetAVSync+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audioSetAVSync>:
push   %rax
mov    %esi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113d <audioSetAVSync+0x1d>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AUDIO_SET_AV_SYNC = global i32 0
@.str = [20 x i8] c"AUDIO SET AV SYNC: \00"
define i32 @audioSetAVSync(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @AUDIO_SET_AV_SYNC
%9 = load i32, i32* %5
%10 = call i64 @ioctl(i32 %7, i32 %8, i32 %9)
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
br i1 %11, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@AUDIO_SET_AV_SYNC = global i32 0
@.str = [20 x i8] c"AUDIO SET AV SYNC: \00"
define i32 @audioSetAVSync(i32 %0, i32 %1) {
%3 = load i32, i32* @AUDIO_SET_AV_SYNC
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
__attribute__((weak)) int _fstat(int file, struct stat *st) {
  file = file;
  if (st)
    return -1;
  else
    return -2;
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1128 <_fstat+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    112f <_fstat+0x2f>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
xor    %eax,%eax
test   %rsi,%rsi
sete   %al
not    %eax
ret

LLVM IR (-O0):
%struct.stat = type opaque
define weak i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat*
store i32 %0, i32* %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i32, i32* %4
store i32 %6, i32* %4
%7 = load %struct.stat*, %struct.stat** %5
%8 = icmp ne %struct.stat* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %11
10: ; preds = %2
store i32 -2, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type opaque
define weak i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = icmp eq %struct.stat* %1, null
%4 = select i1 %3, i32 -2, i32 -1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ conditional(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ printf(char *);
int elseifFile(FILE *fp, char *err, int errlen) {
  printf("[else if (");
  if (conditional(fp, err, errlen))
    return 1;
  printf(")]\n");
  return 0;
}


x86 assembly (clang, -O0):
<elseifFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <conditional@plt>
cmp    $0x0,%rax
je     1165 <elseifFile+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1178 <elseifFile+0x58>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elseifFile>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <conditional@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1172 <elseifFile+0x42>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"[else if (\00"
@.str.1 = [4 x i8] c")]\0A\00"
define i32 @elseifFile(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i64 @conditional(i32* %9, i8* %10, i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 1, i32* %4
br label %17
15: ; preds = %3
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [11 x i8] c"[else if (\00"
@str = [3 x i8] c")]\00"
define i32 @elseifFile(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = tail call i64 @conditional(i32* %0, i8* %1, i32 %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ read_room_file(int);
void read_room_files() {
  int i;
  for (i = 0; i < 7; i++)
    read_room_file(i);
}


x86 assembly (clang, -O0):
<read_room_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jge    113f <read_room_files+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <read_room_file@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <read_room_files+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_room_files>:
push   %rax
xor    %edi,%edi
call   1030 <read_room_file@plt>
mov    $0x1,%edi
call   1030 <read_room_file@plt>
mov    $0x2,%edi
call   1030 <read_room_file@plt>
mov    $0x3,%edi
call   1030 <read_room_file@plt>
mov    $0x4,%edi
call   1030 <read_room_file@plt>
mov    $0x5,%edi
call   1030 <read_room_file@plt>
mov    $0x6,%edi
pop    %rax
jmp    1030 <read_room_file@plt>

LLVM IR (-O0):
define void @read_room_files() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 7
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @read_room_file(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @read_room_files() {
%1 = tail call i32 @read_room_file(i32 0)
%2 = tail call i32 @read_room_file(i32 1)
%3 = tail call i32 @read_room_file(i32 2)
%4 = tail call i32 @read_room_file(i32 3)
%5 = tail call i32 @read_room_file(i32 4)
%6 = tail call i32 @read_room_file(i32 5)
%7 = tail call i32 @read_room_file(i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setmem(int, int, unsigned int);
int cdir(int x, int y, unsigned int value) {
  setmem(x, y, value);
  return 0;
}


x86 assembly (clang, -O0):
<cdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <setmem@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cdir(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @setmem(i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @cdir(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @setmem(i32 %0, i32 %1, i32 %2)
ret i32 0
}