xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int);
void cbmarch_iec_set(int f, int line) { ioctl(f, _IO(0xcb, 13), line); }


x86 assembly (clang, -O0):
<cbmarch_iec_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xcb,%edi
mov    $0xd,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_iec_set>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xcb,%edi
mov    $0xd,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define void @cbmarch_iec_set(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 = call i32 @_IO(i32 203, i32 13)
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @cbmarch_iec_set(i32 %0, i32 %1) {
%3 = tail call i32 @_IO(i32 203, i32 13)
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret void
}
/* Type definitions */
struct atrf_dsc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void atben(struct atrf_dsc *dsc, int size, int trim, int rep, int dump_raw,
           double base, double ppm) {
  fprintf(stderr, "not compiled with ATBEN support\n");
  exit(1);
}


x86 assembly (clang, -O0):
<atben>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<atben>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.atrf_dsc = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"not compiled with ATBEN support\0A\00"
define void @atben(%struct.atrf_dsc* %0, i32 %1, i32 %2, i32 %3, i32 %4, double %5, double %6) {
%8 = alloca %struct.atrf_dsc*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
store %struct.atrf_dsc* %0, %struct.atrf_dsc** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double %5, double* %13
store double %6, double* %14
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.atrf_dsc = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"not compiled with ATBEN support\0A\00"
define void @atben(%struct.atrf_dsc* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, double %5, double %6) {
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int rand();
int rand_get_number(int low_n, int high_n) {
  return rand() % (high_n - low_n + 1) + low_n;
}


x86 assembly (clang, -O0):
<rand_get_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_get_number>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_get_number(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rand_get_number(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int call2(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ f();
int /*<<< orphan*/ lambda3(int /*<<< orphan*/);
int /*<<< orphan*/ t();
int empty(int list) { return call2(list, t(), lambda3(f())); }


x86 assembly (clang, -O0):
<empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <t@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <f@plt>
mov    %eax,%edi
call   1060 <lambda3@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
call   1030 <call2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <t@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <f@plt>
mov    %eax,%edi
call   1060 <lambda3@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <call2@plt>

LLVM IR (-O0):
define i32 @empty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @t()
%5 = call i32 (...) @f()
%6 = call i32 @lambda3(i32 %5)
%7 = call i32 @call2(i32 %3, i32 %4, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @empty(i32 %0) {
%2 = tail call i32 (...) @t()
%3 = tail call i32 (...) @f()
%4 = tail call i32 @lambda3(i32 %3)
%5 = tail call i32 @call2(i32 %0, i32 %2, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ glob_t;

/* Variables and functions */
void *malloc(int);
void *octave_create_glob_info_struct(void) { return malloc(sizeof(glob_t)); }


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

x86 assembly (clang, -O2):
<octave_create_glob_info_struct>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @octave_create_glob_info_struct() {
%1 = call i8* @malloc(i32 4)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @octave_create_glob_info_struct() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int);
int main(void) {
  int n = 10;
  int result = sum(n);
  printf("result = %d\n", result);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"result = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test2(void) {
  unsigned i, j;
  i = j = 0;
  while (1) {
    j++;
    foo();
    if (j < 100)
      continue;
    i++;
    j = 0;
    if (i == 100)
      break;
  }
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
cmpl   $0x64,-0x8(%rbp)
jae    1145 <test2+0x35>
jmp    1126 <test2+0x16>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x4(%rbp)
jne    1164 <test2+0x54>
jmp    1169 <test2+0x59>
jmp    1126 <test2+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x64,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <foo@plt>
add    $0xffffffff,%ebp
jne    1130 <test2+0x20>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <test2+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @test2() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %0, %9, %16
%4 = load i32, i32* %2
%5 = add i32 %4, 1
store i32 %5, i32* %2
%6 = call i32 (...) @foo()
%7 = load i32, i32* %2
%8 = icmp ult i32 %7, 100
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i32, i32* %1
%12 = add i32 %11, 1
store i32 %12, i32* %1
store i32 0, i32* %2
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 100
br i1 %14, label %15, label %16
15: ; preds = %10
br label %17
16: ; preds = %10
br label %3
17: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @test2() {
br label %1
1: ; preds = %8, %0
%2 = phi i32 [ %9, %8 ], [ 0, %0 ]
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ 0, %1 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 (...) @foo()
%7 = icmp eq i32 %5, 100
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 100
br i1 %10, label %11, label %1
11: ; preds = %8
ret void
}
void f3(void) {
  int i;
#pragma omp for nowait
  for (i = 0; i < 10; i++) {
#pragma omp cancel for
  }
#pragma omp sections nowait
  {
    {
#pragma omp cancel sections
    }
#pragma omp section
    {
#pragma omp cancel sections
    }
  }
#pragma omp for ordered
  for (i = 0; i < 10; i++) {
#pragma omp cancel for
#pragma omp ordered
    {}
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <f3+0x28>
jmp    111a <f3+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f3+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    114c <f3+0x4c>
jmp    113e <f3+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <f3+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char *argv[]) {
  unsigned int close_to_max = 4294967295;
  close_to_max += 1;
  printf("close_to_max = %u\n", close_to_max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"close_to_max = %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
%7 = load i32, i32* %6
%8 = add i32 %7, 1
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"close_to_max = %u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void PDMR3DeviceAttach(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMR3DeviceAttach() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int remove(char *);
int main() {
  int ret;
  char filename[] = "file.txt";
  ret = remove(filename);
  if (ret == 0)
    printf("File deleted successfully\n");
  else
    printf("Error: unable to delete the file\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x11(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    116a <main+0x4a>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
jmp    1176 <main+0x56>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x7478742e656c6966,%rax
74 78 74
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <remove@plt>
test   %eax,%eax
lea    0xedf(%rip),%rax
lea    0xeb7(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.filename = [9 x i8] c"file.txt\00"
@.str = [27 x i8] c"File deleted successfully\0A\00"
@.str.1 = [34 x i8] c"Error: unable to delete the file\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [9 x i8]
store i32 0, i32* %1
%4 = bitcast [9 x i8]* %3 to i8*
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%6 = call i32 @remove(i8* %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@__const.main.filename = [9 x i8] c"file.txt\00"
@str = [33 x i8] c"Error: unable to delete the file\00"
@str.2 = [26 x i8] c"File deleted successfully\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = call i32 @remove(i8* %2)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char, char, int);
int warterm_mapspot(int r, int c, char terr, char mark, int focus) {
  printf("M\01%d\01%d\01%c\01%c\01%d\01\n", r, c, terr, mark, focus);
  return 0;
}


x86 assembly (clang, -O0):
<warterm_mapspot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    %r8d,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x9(%rbp),%cl
mov    -0xa(%rbp),%al
mov    -0x10(%rbp),%r9d
lea    0xebd(%rip),%rdi
movsbl %cl,%ecx
movsbl %al,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warterm_mapspot>:
push   %rax
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"M\01%d\01%d\01%c\01%c\01%d\01\0A\00"
define i32 @warterm_mapspot(i32 %0, i32 %1, i8 signext %2, i8 signext %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8, i8* %8
%14 = load i8, i8* %9
%15 = load i32, i32* %10
%16 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i8 signext %13, i8 signext %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"M\01%d\01%d\01%c\01%c\01%d\01\0A\00"
define i32 @warterm_mapspot(i32 %0, i32 %1, i8 signext %2, i8 signext %3, i32 %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8 signext %2, i8 signext %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ repeat();
void inext() { repeat(); }


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

x86 assembly (clang, -O2):
<inext>:
xor    %eax,%eax
jmp    1030 <repeat@plt>

LLVM IR (-O0):
define void @inext() {
%1 = call i32 (...) @repeat()
ret void
}

LLVM IR (-O2):
define void @inext() {
%1 = tail call i32 (...) @repeat()
ret void
}
/* Variables and functions */
int pow(int, double);
double midi_freq(unsigned char m) {
  return 440 * pow(2, (double)(m - 69) / 12);
}


x86 assembly (clang, -O0):
<midi_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sub    $0x45,%eax
cvtsi2sd %eax,%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0x1b8,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midi_freq>:
push   %rax
add    $0xffffffbb,%edi
cvtsi2sd %edi,%xmm0
divsd  0xee0(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0x1b8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @midi_freq(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sub nsw i32 %4, 69
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.200000e+01
%8 = call i32 @pow(i32 2, double %7)
%9 = mul nsw i32 440, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @midi_freq(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = add nsw i32 %2, -69
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.200000e+01
%6 = tail call i32 @pow(i32 2, double %5)
%7 = mul nsw i32 %6, 440
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ utils_p();
int main() {
  utils_p();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <utils_p@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @utils_p()
ret i32 0
}
double observer_hour_angle(double nu, float longitude, double alpha_deg) {
  return nu + longitude - alpha_deg;
}


x86 assembly (clang, -O0):
<observer_hour_angle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
subsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<observer_hour_angle>:
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @observer_hour_angle(double %0, float %1, double %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca double
store double %0, double* %4
store float %1, float* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load float, float* %5
%9 = fpext float %8 to double
%10 = fadd double %7, %9
%11 = load double, double* %6
%12 = fsub double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @observer_hour_angle(double %0, float %1, double %2) {
%4 = fpext float %1 to double
%5 = fadd double %4, %0
%6 = fsub double %5, %2
ret double %6
}
/* Type definitions */
typedef char *ushort;

/* Variables and functions */
extern ushort inportw(int port) {
  register ushort res;
  __asm__ __volatile__("inw %%dx,%%ax\n\t" : "=a"(res) : "d"(port));
  return (res);
}


x86 assembly (clang, -O0):
<inportw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%ax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define i8* @inportw(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inw %dx,%ax\0A\09", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inportw(i32 %0) {
%2 = tail call i8* asm sideeffect "inw %dx,%ax\0A\09", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ logDebug(char *);
int pluginInit(void) {
  logDebug("The Sample plugin is initializing ...");
  return 1;
}


x86 assembly (clang, -O0):
<pluginInit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <logDebug@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluginInit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <logDebug@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"The Sample plugin is initializing ...\00"
define i32 @pluginInit() {
%1 = call i32 @logDebug(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [38 x i8] c"The Sample plugin is initializing ...\00"
define i32 @pluginInit() {
%1 = tail call i32 @logDebug(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int str_replace(char *, char const *, int, char *, char *);
int str_unix2dos(char *dest, const char *src, int dest_size) {
  return str_replace(dest, src, dest_size, "\n", "\r\n");
}


x86 assembly (clang, -O0):
<str_unix2dos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xecc(%rip),%rcx
lea    0xec4(%rip),%r8
call   1030 <str_replace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_unix2dos>:
lea    0xeea(%rip),%rcx
lea    0xee2(%rip),%r8
jmp    1030 <str_replace@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define i32 @str_unix2dos(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @str_replace(i8* %0, i8* %1, i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void pr_RAT(FILE *fp, bool RAT) {
  if (RAT) {
    fprintf(fp, "RAT=%d:RA has been terminated.\n", RAT);
  } else {
    fprintf(fp, "RAT=%d:RA is currently generated by ACAS.\n", RAT);
  }
}


x86 assembly (clang, -O0):
<pr_RAT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1141 <pr_RAT+0x31>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1154 <pr_RAT+0x44>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_RAT>:
test   %esi,%esi
je     1122 <pr_RAT+0x12>
mov    %esi,%edx
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xef7(%rip),%rsi
xor    %edx,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"RAT=%d:RA has been terminated.\0A\00"
@.str.1 = [43 x i8] c"RAT=%d:RA is currently generated by ACAS.\0A\00"
define void @pr_RAT(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %15
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"RAT=%d:RA has been terminated.\0A\00"
@.str.1 = [43 x i8] c"RAT=%d:RA is currently generated by ACAS.\0A\00"
define void @pr_RAT(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %8
8: ; preds = %6, %4
ret void
}
char *calloc(num, size)
register unsigned num, size;
{
  extern char *malloc();
  register char *p;
  size *= num;
  if (p = malloc(size))
    bzero(p, size);
  return (p);
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1160 <calloc+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%eax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1146 <calloc+0x26>
mov    %ebx,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %9)
store i8* %10, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i32, i32* %4
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %12, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @calloc(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = zext i32 %3 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %4, i8 0, i64 %7, i1 false)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
scalar_t__ COND_CS();
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_scs_8_aw(void) { m68ki_write_8(EA_AW_8(), COND_CS() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_scs_8_aw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AW_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_CS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_scs_8_aw>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AW_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_CS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_scs_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i64 (...) @COND_CS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_scs_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i64 (...) @COND_CS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read_halfword(uint8_t *buf, int offset) {
  uint16_t b0 = buf[offset + 0] & 0xff;
  uint16_t b1 = buf[offset + 1] & 0xff;
  return b0 | (b1 << 8);
}


x86 assembly (clang, -O0):
<read_halfword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_halfword>:
movslq %esi,%rax
movzbl (%rdi,%rax,4),%ecx
mov    0x4(%rdi,%rax,4),%eax
shl    $0x8,%eax
movzwl %ax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @read_halfword(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 0
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = load i32, i32* %11
%13 = and i32 %12, 255
store i32 %13, i32* %5
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
%19 = load i32, i32* %18
%20 = and i32 %19, 255
store i32 %20, i32* %6
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = shl i32 %22, 8
%24 = or i32 %21, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @read_halfword(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = and i32 %11, 65280
%13 = or i32 %12, %6
ret i32 %13
}
void process_pending_signal() {}


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

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

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

LLVM IR (-O2):
define void @process_pending_signal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ stderr;
void error_too_many_bursts(int pid) {
  fprintf(stderr,
          "Error - too many bursts provided for process with id %d.\n"
          "Total number of CPU or I/O bursts must not exceed %d (or %d "
          "combined).\n",
          pid, 1000 / 2, 1000);
  exit(-1);
}


x86 assembly (clang, -O0):
<error_too_many_bursts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
mov    $0x1f4,%ecx
mov    $0x3e8,%r8d
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_too_many_bursts>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
mov    $0x1f4,%ecx
mov    $0x3e8,%r8d
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [129 x i8] c"Error - too many bursts provided for process with id %d.\0ATotal number of CPU or I/O bursts must not exceed %d (or %d combined).\0A\00"
define void @error_too_many_bursts(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 %4, i32 500, i32 1000)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [129 x i8] c"Error - too many bursts provided for process with id %d.\0ATotal number of CPU or I/O bursts must not exceed %d (or %d combined).\0A\00"
define void @error_too_many_bursts(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 %0, i32 500, i32 1000)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
void initScreen() {
  initscr();
  cbreak();
  noecho();
}


x86 assembly (clang, -O0):
<initScreen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1050 <noecho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initScreen>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <noecho@plt>

LLVM IR (-O0):
define void @initScreen() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @noecho()
ret void
}

LLVM IR (-O2):
define void @initScreen() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_event_get_state(void *e) {
  return -EINVAL;
}


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

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_get_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_get_state(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
void f(int *x, int *add) {
  *x += *add;
  *x += *add;
}


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

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%eax
add    (%rsi),%eax
mov    %eax,(%rdi)
add    (%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @f(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %6
store i32 %9, i32* %7
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = add nsw i32 %13, %11
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = add nsw i32 %6, %5
store i32 %7, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
__attribute__((weak)) void log_output(char *buf, int size) {
  if (size <= 0)
    return;
  fwrite(buf, size, 1, stderr);
  fwrite("\n", 1, 1, stderr);
}


x86 assembly (clang, -O0):
<log_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     112e <log_output+0x1e>
jmp    1164 <log_output+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%ecx
lea    0xea8(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_output>:
test   %esi,%esi
jle    1141 <log_output+0x31>
push   %rbx
mov    0x2ec4(%rip),%rbx
mov    (%rbx),%ecx
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    (%rbx),%ecx
lea    0xecf(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <fwrite@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define weak void @log_output(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %15
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = load i32, i32* @stderr
%12 = call i32 @fwrite(i8* %9, i32 %10, i32 1, i32 %11)
%13 = load i32, i32* @stderr
%14 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 %13)
br label %15
15: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define weak void @log_output(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fwrite(i8* %0, i32 %1, i32 1, i32 %5)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 %7)
br label %9
9: ; preds = %2, %4
ret void
}
void cc_arduino_Lifecycle_pollen__free__E() {}


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

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

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

LLVM IR (-O2):
define void @cc_arduino_Lifecycle_pollen__free__E() {
ret void
}
void gentestl_out() {}


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

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

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

LLVM IR (-O2):
define void @gentestl_out() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int createTCPSocket() { return socket(AF_INET, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<createTCPSocket>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<createTCPSocket>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @createTCPSocket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @createTCPSocket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
int identity(int);
int example(void) { return identity(1) + identity(2); }


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

x86 assembly (clang, -O2):
<example>:
push   %rbx
mov    $0x1,%edi
call   1030 <identity@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <identity@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @example() {
%1 = call i32 @identity(i32 1)
%2 = call i32 @identity(i32 2)
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @example() {
%1 = tail call i32 @identity(i32 1)
%2 = tail call i32 @identity(i32 2)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
double exp(float);
float sigmoid(float x) { return 1.0 / (1.0 + exp(-x)); }


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
movsd  0xec4(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
xorpd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call double @exp(float %4)
%6 = fadd double 1.000000e+00, %5
%7 = fdiv double 1.000000e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @sigmoid(float %0) {
%2 = fneg float %0
%3 = tail call double @exp(float %2)
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ trace_printk(char *, int);
__attribute__((section("socket"), used)) int filter() {
  trace_printk("This string is allocated in the string section\n",
               sizeof("This string is allocated in the string section\n"));
  trace_printk("This one too\n", sizeof("This one too\n"));
  return 0;
}


x86 assembly (clang, -O0):
<filter>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x30,%esi
call   1030 <trace_printk@plt>
lea    0xf04(%rip),%rdi
mov    $0xe,%esi
call   1030 <trace_printk@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x30,%esi
call   1030 <trace_printk@plt>
lea    0xf07(%rip),%rdi
mov    $0xe,%esi
call   1030 <trace_printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"This string is allocated in the string section\0A\00"
@.str.1 = [14 x i8] c"This one too\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @filter to i8*)], section "llvm.metadata"
define i32 @filter() section "socket" {
%1 = call i32 @trace_printk(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 48)
%2 = call i32 @trace_printk(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 14)
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"This string is allocated in the string section\0A\00"
@.str.1 = [14 x i8] c"This one too\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @filter to i8*)], section "llvm.metadata"
define i32 @filter() section "socket" {
%1 = tail call i32 @trace_printk(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 48)
%2 = tail call i32 @trace_printk(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func_12(int, char *, unsigned long);
void func_11(int a, char *b, unsigned long c) { func_12(a, b, c); }


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

x86 assembly (clang, -O2):
<func_11>:
jmp    1030 <func_12@plt>

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

LLVM IR (-O2):
define void @func_11(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @func_12(i32 %0, i8* %1, i64 %2)
ret void
}