xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) { puts("Usage: diss_counter_example n alpha [values...]"); }


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Usage: diss_counter_example n alpha [values...]\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Usage: diss_counter_example n alpha [values...]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_timeout(int);
void sigalrm_handler(int useless) { set_timeout(1); }


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

x86 assembly (clang, -O2):
<sigalrm_handler>:
mov    $0x1,%edi
jmp    1030 <set_timeout@plt>

LLVM IR (-O0):
define void @sigalrm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @set_timeout(i32 1)
ret void
}

LLVM IR (-O2):
define void @sigalrm_handler(i32 %0) {
%2 = tail call i32 @set_timeout(i32 1)
ret void
}
/* Variables and functions */
double pow(int, int);
double et_a(double r_net_day, double evap_fr, double tempk) {
  double latent, t_celsius;
  t_celsius = tempk - 273.15;
  latent = 86400 / ((2.501 - 0.002361 * t_celsius) * pow(10, 6));
  return (r_net_day * evap_fr * latent);
}


x86 assembly (clang, -O0):
<et_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xee4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    $0xa,%edi
mov    $0x6,%esi
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe81(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<et_a>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
addsd  0xed8(%rip),%xmm2
mulsd  0xed8(%rip),%xmm2
addsd  0xed8(%rip),%xmm2
movsd  %xmm2,(%rsp)
mov    $0xa,%edi
mov    $0x6,%esi
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @et_a(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %6
%10 = fsub double %9, 2.731500e+02
store double %10, double* %8
%11 = load double, double* %8
%12 = call double @llvm.fmuladd.f64(double -2.361000e-03, double %11, double 2.501000e+00)
%13 = call double @pow(i32 10, i32 6)
%14 = fmul double %12, %13
%15 = fdiv double 8.640000e+04, %14
store double %15, double* %7
%16 = load double, double* %4
%17 = load double, double* %5
%18 = fmul double %16, %17
%19 = load double, double* %7
%20 = fmul double %18, %19
ret double %20
}

LLVM IR (-O2):
define double @et_a(double %0, double %1, double %2) {
%4 = fadd double %2, -2.731500e+02
%5 = tail call double @llvm.fmuladd.f64(double %4, double -2.361000e-03, double 2.501000e+00)
%6 = tail call double @pow(i32 10, i32 6)
%7 = fmul double %5, %6
%8 = fdiv double 8.640000e+04, %7
%9 = fmul double %0, %1
%10 = fmul double %9, %8
ret double %10
}
unsigned foo(void *x) {
  unsigned y = *(volatile unsigned *)(x);
  return (y >> 24) | ((y >> 8) & 0xff00) | ((y & 0xff00) << 8) | (y << 24);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    -0xc(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load volatile i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = lshr i32 %7, 24
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = and i32 %10, 65280
%12 = or i32 %8, %11
%13 = load i32, i32* %3
%14 = and i32 %13, 65280
%15 = shl i32 %14, 8
%16 = or i32 %12, %15
%17 = load i32, i32* %3
%18 = shl i32 %17, 24
%19 = or i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @foo(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
%4 = tail call i32 @llvm.bswap.i32(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ jerry_cleanup();
void js_exit(void) { jerry_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @js_exit() {
%1 = tail call i32 (...) @jerry_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doStuff3(int);
void f_7(void) {
  int z;
  int y = z;
  doStuff3(y);
}


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

x86 assembly (clang, -O2):
<f_7>:
jmp    1030 <doStuff3@plt>

LLVM IR (-O0):
define void @f_7() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @doStuff3(i32 %4)
ret void
}

LLVM IR (-O2):
define void @f_7() {
%1 = tail call i32 @doStuff3(i32 undef)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void numerable_srand(void) {
  static uint8_t rand_init = 0;
  if (rand_init == 0) {
    rand_init = 1;
    srand((unsigned)time(NULL));
  }
}


x86 assembly (clang, -O0):
<numerable_srand>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
jne    114b <numerable_srand+0x2b>
movl   $0x1,0x2ef9(%rip)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<numerable_srand>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
je     112c <numerable_srand+0xc>
pop    %rax
ret
movb   $0x1,0x2f01(%rip)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
@numerable_srand.rand_init = internal global i32 0
define void @numerable_srand() {
%1 = load i32, i32* @numerable_srand.rand_init
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
store i32 1, i32* @numerable_srand.rand_init
%4 = call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
br label %7
7: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@numerable_srand.rand_init = internal unnamed_addr global i1 false
define void @numerable_srand() {
%1 = load i1, i1* @numerable_srand.rand_init
br i1 %1, label %6, label %2
2: ; preds = %0
store i1 true, i1* @numerable_srand.rand_init
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
br label %6
6: ; preds = %2, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ csi_input();
char *skip_prefix(int /*<<< orphan*/, char *);
char *skip_csi(char *input) {
  if ((unsigned char)*input == 0233) {
    return input + 1;
  }
  return skip_prefix(csi_input(), input);
}


x86 assembly (clang, -O0):
<skip_csi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x9b,%eax
jne    114f <skip_csi+0x2f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <skip_csi+0x45>
mov    $0x0,%al
call   1030 <csi_input@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <skip_prefix@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_csi>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x9b,(%rdi)
jne    1132 <skip_csi+0x12>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <csi_input@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <skip_prefix@plt>

LLVM IR (-O0):
define i8* @skip_csi(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 155
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %15
11: ; preds = %1
%12 = call i32 (...) @csi_input()
%13 = load i8*, i8** %3
%14 = call i8* @skip_prefix(i32 %12, i8* %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %11, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @skip_csi(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -101
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
br label %9
6: ; preds = %1
%7 = tail call i32 (...) @csi_input()
%8 = tail call i8* @skip_prefix(i32 %7, i8* %0)
br label %9
9: ; preds = %6, %4
%10 = phi i8* [ %5, %4 ], [ %8, %6 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int fs_rmfile(char *parameter) {
  fprintf(stderr, "rmfile: UNDER DEVELOPMENT\n");
}


x86 assembly (clang, -O0):
<fs_rmfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_rmfile>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"rmfile: UNDER DEVELOPMENT\0A\00"
define i32 @fs_rmfile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"rmfile: UNDER DEVELOPMENT\0A\00"
define i32 @fs_rmfile(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
FILE *X(FILE s) {
  char i, iev, jmqhu, xqht, mqh, ujek, sxydw, kdj, yjb, utou, qhre, eamy, jxxe,
      bt;
}


x86 assembly (clang, -O0):
<X>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i32* @X(i32 %0) {
ret i32* undef
}
int constant_test_bit(unsigned int nr, const volatile unsigned long *addr) {
  return ((1UL << (nr % (sizeof(unsigned long) * 8))) &
          (((unsigned long *)addr)[nr / (sizeof(unsigned long) * 8)])) != 0;
}


x86 assembly (clang, -O0):
<constant_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
shr    $0x6,%rdx
and    (%rcx,%rdx,8),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_test_bit>:
mov    %edi,%eax
shr    $0x3,%eax
and    $0xfffffff8,%eax
mov    (%rsi,%rax,1),%rcx
xor    %eax,%eax
bt     %rdi,%rcx
setb   %al
ret

LLVM IR (-O0):
define i32 @constant_test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = urem i64 %6, 64
%8 = shl i64 1, %7
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = zext i32 %10 to i64
%12 = udiv i64 %11, 64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load i64, i64* %13
%15 = and i64 %8, %14
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @constant_test_bit(i32 %0, i64* nocapture %1) {
%3 = zext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = load i64, i64* %7
%9 = and i64 %8, %5
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void *memmove(void *s1, const void *s2, size_t n) {
  char *tmp = (char *)malloc(n);
  memcpy(tmp, s2, n);
  memcpy(s1, tmp, n);
  free(tmp);
  return s1;
}


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

x86 assembly (clang, -O2):
<memmove>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @memmove(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %7
%17 = load i64, i64* %6
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %7
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
define i8* @memmove(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i64 @malloc(i64 %2)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %1, i64 %2)
%7 = tail call i32 @memcpy(i8* %0, i8* %5, i64 %2)
%8 = tail call i32 @free(i8* %5)
ret i8* %0
}
int swap(int *a, int *b) {
  int t;
  t = *a;
  *a = *b;
  *b = t;
  return 1;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 1
}
int do_851() { return 851; }


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

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

LLVM IR (-O0):
define i32 @do_851() {
ret i32 851
}

LLVM IR (-O2):
define i32 @do_851() {
ret i32 851
}
/* Variables and functions */
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ sort_by_selection(int *, int);
int main(int argc, char *argv[]) {
  int values[9] = {1, 5, 7, 2, 3, 8, 1, 9, 5};
  print_array(values, 9);
  sort_by_selection(values, 9);
  print_array(values, 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
call   1030 <print_array@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
call   1050 <sort_by_selection@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <sort_by_selection@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.values = [9 x i32] [i32 1, i32 5, i32 7, i32 2, i32 3, i32 8, i32 1, i32 9, i32 5]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [9 x i32]* %6 to i8*
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i64 0, i64 0
%9 = call i32 @print_array(i32* %8, i32 9)
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i64 0, i64 0
%11 = call i32 @sort_by_selection(i32* %10, i32 9)
%12 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i64 0, i64 0
%13 = call i32 @print_array(i32* %12, i32 9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.values = [9 x i32] [i32 1, i32 5, i32 7, i32 2, i32 3, i32 8, i32 1, i32 9, i32 5]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i32]
%4 = bitcast [9 x i32]* %3 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%6 = call i32 @print_array(i32* %5, i32 9)
%7 = call i32 @sort_by_selection(i32* %5, i32 9)
%8 = call i32 @print_array(i32* %5, i32 9)
ret i32 0
}
void symbol__init(const char *vmlinux) {}


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

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

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

LLVM IR (-O2):
define void @symbol__init(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void outputDouble(double value) { printf("%f", value); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @outputDouble(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Type definitions */
struct Mapa {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bestfirstsearch(struct Mapa *);
struct Mapa *loadmapa();
int main() {
  struct Mapa *mapa = loadmapa();
  bestfirstsearch(mapa);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.Mapa = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Mapa*
store i32 0, i32* %1
%3 = call %struct.Mapa* (...) @loadmapa()
store %struct.Mapa* %3, %struct.Mapa** %2
%4 = load %struct.Mapa*, %struct.Mapa** %2
%5 = call i32 @bestfirstsearch(%struct.Mapa* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.Mapa = type { i32 }
define i32 @main() {
%1 = tail call %struct.Mapa* (...) @loadmapa()
%2 = tail call i32 @bestfirstsearch(%struct.Mapa* %1)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_quaddobl_drop_coordinate_by_index(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(398, &k, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_quaddobl_drop_coordinate_by_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x18e,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_quaddobl_drop_coordinate_by_index>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x18e,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_quaddobl_drop_coordinate_by_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 398, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_quaddobl_drop_coordinate_by_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 398, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x95() {
  Assert_real((ispunct(149) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              750, ("ispunct should be 0 for 0x95"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x95>:
push   %rbp
mov    %rsp,%rbp
mov    $0x95,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2ee,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x95>:
push   %rax
mov    $0x95,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2ee,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x95\00"
define void @t_ispunct_0x95() {
%1 = call i64 @ispunct(i32 149)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 750, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x95\00"
define void @t_ispunct_0x95() {
%1 = tail call i64 @ispunct(i32 149)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 750, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int do_230() { return 230; }


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

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

LLVM IR (-O0):
define i32 @do_230() {
ret i32 230
}

LLVM IR (-O2):
define i32 @do_230() {
ret i32 230
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void quit() { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @quit() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @quit() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
double rand();
double rd() {
  static double result, width;
  result = rand();
  width = 0.010;
  while (width < result) {
    result = result / 2.0;
  }
  result = result - width * 0.75;
  return result;
}


x86 assembly (clang, -O0):
<rd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
movsd  %xmm0,0x2f0d(%rip)
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,0x2f05(%rip)
movsd  0x2efd(%rip),%xmm1
movsd  0x2eed(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    116e <rd+0x5e>
movsd  0x2edb(%rip),%xmm0
movsd  0xeb3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2ec7(%rip)
jmp    1133 <rd+0x23>
movsd  0x2eba(%rip),%xmm1
movsd  0x2eba(%rip),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe6b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2e83(%rip)
movsd  0x2e7b(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
ucomisd 0xee0(%rip),%xmm0
jbe    114a <rd+0x3a>
movsd  0xede(%rip),%xmm1
movsd  0xece(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
ja     1140 <rd+0x30>
addsd  0xebe(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@rd.result = internal global double 0.000000e+00
@rd.width = internal global double 0.000000e+00
define double @rd() {
%1 = call double (...) @rand()
store double %1, double* @rd.result
store double 1.000000e-02, double* @rd.width
br label %2
2: ; preds = %6, %0
%3 = load double, double* @rd.width
%4 = load double, double* @rd.result
%5 = fcmp olt double %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load double, double* @rd.result
%8 = fdiv double %7, 2.000000e+00
store double %8, double* @rd.result
br label %2
9: ; preds = %2
%10 = load double, double* @rd.result
%11 = load double, double* @rd.width
%12 = fneg double %11
%13 = call double @llvm.fmuladd.f64(double %12, double 7.500000e-01, double %10)
store double %13, double* @rd.result
%14 = load double, double* @rd.result
ret double %14
}

LLVM IR (-O2):
define double @rd() {
%1 = tail call double (...) @rand()
%2 = fcmp ogt double %1, 1.000000e-02
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = phi double [ %5, %3 ], [ %1, %0 ]
%5 = fmul double %4, 5.000000e-01
%6 = fcmp ogt double %5, 1.000000e-02
br i1 %6, label %3, label %7
7: ; preds = %3, %0
%8 = phi double [ %1, %0 ], [ %5, %3 ]
%9 = fadd double %8, 0xBF7EB851EB851EB8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void sigterm() { _exit(0); }


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

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

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

LLVM IR (-O2):
define void @sigterm() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int fvecs_new_fread_max(int /*<<< orphan*/ *, int *, float **, long);
int ivecs_new_fread_max(FILE *f, int *d_out, int **vi_out, long nmax) {
  assert(sizeof(int) == sizeof(float));
  return fvecs_new_fread_max(f, d_out, (float **)vi_out, nmax);
}


x86 assembly (clang, -O0):
<ivecs_new_fread_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <fvecs_new_fread_max@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivecs_new_fread_max>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <fvecs_new_fread_max@plt>

LLVM IR (-O0):
define i32 @ivecs_new_fread_max(i32* %0, i32* %1, i32** %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32**
%8 = alloca i64
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32** %2, i32*** %7
store i64 %3, i64* %8
%9 = call i32 @assert(i32 1)
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32**, i32*** %7
%13 = bitcast i32** %12 to float**
%14 = load i64, i64* %8
%15 = call i32 @fvecs_new_fread_max(i32* %10, i32* %11, float** %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @ivecs_new_fread_max(i32* %0, i32* %1, i32** %2, i64 %3) {
%5 = tail call i32 @assert(i32 1)
%6 = bitcast i32** %2 to float**
%7 = tail call i32 @fvecs_new_fread_max(i32* %0, i32* %1, float** %6, i64 %3)
ret i32 %7
}
/* Type definitions */
struct nlist {
  int dummy;
};

/* Variables and functions */
struct nlist *preprocessor();
int /*<<< orphan*/ print(struct nlist *);
int main(void) {
  struct nlist *ptr;
  ptr = preprocessor();
  print(ptr);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.nlist = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.nlist*
store i32 0, i32* %1
%3 = call %struct.nlist* (...) @preprocessor()
store %struct.nlist* %3, %struct.nlist** %2
%4 = load %struct.nlist*, %struct.nlist** %2
%5 = call i32 @print(%struct.nlist* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.nlist = type { i32 }
define i32 @main() {
%1 = tail call %struct.nlist* (...) @preprocessor()
%2 = tail call i32 @print(%struct.nlist* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Usage: random_fastq [option]...\n"
         "Generate an endless stream of random FASTQ data to standard out.\n\n"
         "Options:\n"
         "    TODO\n\n"
         "Beware: the only purpose of this program is test quip.\n"
         "No particular guarantees are made.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [209 x i8] c"Usage: random_fastq [option]...\0AGenerate an endless stream of random FASTQ data to standard out.\0A\0AOptions:\0A TODO\0A\0ABeware: the only purpose of this program is test quip.\0ANo particular guarantees are made.\0A\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [208 x i8] c"Usage: random_fastq [option]...\0AGenerate an endless stream of random FASTQ data to standard out.\0A\0AOptions:\0A TODO\0A\0ABeware: the only purpose of this program is test quip.\0ANo particular guarantees are made.\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([208 x i8], [208 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void test2(long int li) { printf("Test2: %ld\n", li); }


x86 assembly (clang, -O0):
<test2>:
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):
<test2>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Test2: %ld\0A\00"
define void @test2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Test2: %ld\0A\00"
define void @test2(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inces tall.\n", height);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [21 x i8] c"I am %d inces tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 72, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [21 x i8] c"I am %d inces tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int bit_insert(int, int, int, int);
int /*<<< orphan*/ printf(char *, int);
main() {
  uint32_t a;
  a = bit_insert(0x1000000, 0x101, 4, 6);
  printf("a=0x%x\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1000000,%edi
mov    $0x101,%esi
mov    $0x4,%edx
mov    $0x6,%ecx
call   1040 <bit_insert@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1000000,%edi
mov    $0x101,%esi
mov    $0x4,%edx
mov    $0x6,%ecx
call   1040 <bit_insert@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"a=0x%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @bit_insert(i32 16777216, i32 257, i32 4, i32 6)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"a=0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 @bit_insert(i32 16777216, i32 257, i32 4, i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int isdigit(int c) { return (c >= 0x30 && c <= 0x39); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help(void) {
  puts("Usage: fanotify_watch [options...] \n"
       "\n"
       "Options:\n"
       "  -c, --current-mount\t\tOnly record events on partition/mount of "
       "current directory.\n"
       "  -t, --timestamp\t\tAdd timestamp to events. Give twice for seconds "
       "since the epoch.\n"
       "  -n, --names\t\tDecode PIDs as names.\n"
       "  -p PID, --ignore-pid PID\tIgnore events for this process ID. Can be "
       "specified multiple times.\n"
       "  -h, --help\t\t\tShow help.");
}


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

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

LLVM IR (-O0):
@.str = [371 x i8] c"Usage: fanotify_watch [options...] \0A\0AOptions:\0A -c, --current-mount\09\09Only record events on partition/mount of current directory.\0A -t, --timestamp\09\09Add timestamp to events. Give twice for seconds since the epoch.\0A -n, --names\09\09Decode PIDs as names.\0A -p PID, --ignore-pid PID\09Ignore events for this process ID. Can be specified multiple times.\0A -h, --help\09\09\09Show help.\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([371 x i8], [371 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [371 x i8] c"Usage: fanotify_watch [options...] \0A\0AOptions:\0A -c, --current-mount\09\09Only record events on partition/mount of current directory.\0A -t, --timestamp\09\09Add timestamp to events. Give twice for seconds since the epoch.\0A -n, --names\09\09Decode PIDs as names.\0A -p PID, --ignore-pid PID\09Ignore events for this process ID. Can be specified multiple times.\0A -h, --help\09\09\09Show help.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([371 x i8], [371 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  for (int i = 0; i < argc; ++i) {
    printf("arg %d: %s\n", i, argv[i]);
  }
}


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   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"arg %d: %s\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 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [12 x i8] c"arg %d: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
double *vector(nl, nh)
int nl, nh;
{
  double *v;
  v = (double *)malloc((unsigned)(nh - nl + 1) * sizeof(double));
  if (!v)
    nrerror("allocation failure in vector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <vector+0x41>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x1(%rsi),%edi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1149 <vector+0x29>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x3,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define double* @vector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = call i8* @malloc(i64 %11)
%13 = bitcast i8* %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = sub i64 0, %21
%23 = getelementptr inbounds double, double* %19, i64 %22
ret double* %23
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define double* @vector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = zext i32 %4 to i64
%6 = shl nuw nsw i64 %5, 3
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = bitcast i8* %7 to double*
%13 = sext i32 %0 to i64
%14 = sub nsw i64 0, %13
%15 = getelementptr inbounds double, double* %12, i64 %14
ret double* %15
}
long getsizeof() {
  static char *kwlist[] = {"AAA", "BBB", 0};
  auto long size;
  size = sizeof(kwlist);
  return size;
}


x86 assembly (clang, -O0):
<getsizeof>:
push   %rbp
mov    %rsp,%rbp
movq   $0x18,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@getsizeof.kwlist = internal global [3 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str = [4 x i8] c"AAA\00"
@.str.1 = [4 x i8] c"BBB\00"
define i64 @getsizeof() {
%1 = alloca i64
store i64 24, i64* %1
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @getsizeof() {
ret i64 24
}
void echangerEntiers(int *x, int *y) {
  int t = *x;
  *x = *y;
  *y = t;
}


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

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

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

LLVM IR (-O2):
define void @echangerEntiers(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}