xunge/DecIR huggingface dataset:
void frep(int n, int param[]) {
  while (n > 1) {
    for (param[n] = 1; param[n] <= 4; ++param[n]) {
      frep(n - 1, param);
    }
  }
}


x86 assembly (clang, -O0):
<frep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1174 <frep+0x64>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmpl   $0x4,(%rax,%rcx,4)
jg     116f <frep+0x5f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <frep@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
jmp    1138 <frep+0x28>
jmp    111f <frep+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frep>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     115b <frep+0x4b>
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %edi,%ebp
add    $0xffffffff,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
movl   $0x1,(%rbx,%rbp,4)
nopw   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %rbx,%rsi
call   1030 <frep@plt>
mov    (%rbx,%rbp,4),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rbx,%rbp,4)
cmp    $0x4,%eax
jl     1140 <frep+0x30>
jmp    1130 <frep+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @frep(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
br label %5
5: ; preds = %31, %2
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %32
8: ; preds = %5
%9 = load i32*, i32** %4
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store i32 1, i32* %12
br label %13
13: ; preds = %24, %8
%14 = load i32*, i32** %4
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = icmp sle i32 %18, 4
br i1 %19, label %20, label %31
20: ; preds = %13
%21 = load i32, i32* %3
%22 = sub nsw i32 %21, 1
%23 = load i32*, i32** %4
br label %24
24: ; preds = %20
%25 = load i32*, i32** %4
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = add nsw i32 %29, 1
store i32 %30, i32* %28
br label %13
31: ; preds = %13
br label %5
32: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @frep(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = add nsw i32 %0, -1
br label %8
8: ; preds = %9, %4
store i32 1, i32* %6
br label %9
9: ; preds = %8, %9
tail call void @frep(i32 %7, i32* %1)
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
store i32 %11, i32* %6
%12 = icmp slt i32 %10, 4
br i1 %12, label %9, label %8
13: ; preds = %2
ret void
}
void get_opt(int i, int w) { int best_w; }


x86 assembly (clang, -O0):
<get_opt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @get_opt(i32 %0, i32 %1) {
ret void
}
int test() {
  int a = 2, b = 3, c = 4, d = 5;
  int res;
  res = ((b / a) * (b / a)) + ((d / c) * (d / c));
  if (res != 2)
    return 1;
  c /= a;
  if (c != 2)
    return 2;
  d %= b;
  if (d != 2)
    return 3;
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,%edx
mov    -0x1c(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
je     116f <test+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    11ba <test+0xba>
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
je     1191 <test+0x91>
movl   $0x2,-0x4(%rbp)
jmp    11ba <test+0xba>
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
je     11b3 <test+0xb3>
movl   $0x3,-0x4(%rbp)
jmp    11ba <test+0xba>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 2, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
store i32 5, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = sdiv i32 %7, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = sdiv i32 %10, %11
%13 = mul nsw i32 %9, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = sdiv i32 %14, %15
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = sdiv i32 %17, %18
%20 = mul nsw i32 %16, %19
%21 = add nsw i32 %13, %20
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 2
br i1 %23, label %24, label %25
24: ; preds = %0
store i32 1, i32* %1
br label %40
25: ; preds = %0
%26 = load i32, i32* %2
%27 = load i32, i32* %4
%28 = sdiv i32 %27, %26
store i32 %28, i32* %4
%29 = load i32, i32* %4
%30 = icmp ne i32 %29, 2
br i1 %30, label %31, label %32
31: ; preds = %25
store i32 2, i32* %1
br label %40
32: ; preds = %25
%33 = load i32, i32* %3
%34 = load i32, i32* %5
%35 = srem i32 %34, %33
store i32 %35, i32* %5
%36 = load i32, i32* %5
%37 = icmp ne i32 %36, 2
br i1 %37, label %38, label %39
38: ; preds = %32
store i32 3, i32* %1
br label %40
39: ; preds = %32
store i32 0, i32* %1
br label %40
40: ; preds = %39, %38, %31, %24
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
int add_to_arg(int num) { return num + 1; }


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

x86 assembly (clang, -O2):
<add_to_arg>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @add_to_arg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @add_to_arg(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void stgFree(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<stgFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @stgFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int floor(double);
void intra_binenergy(double energy, double min, double width, int(*histogram)) {
  int bin;
  bin = floor((energy - min) / width);
  histogram[bin]++;
}


x86 assembly (clang, -O0):
<intra_binenergy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1030 <floor@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intra_binenergy>:
push   %rbx
mov    %rdi,%rbx
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
call   1030 <floor@plt>
cltq
addl   $0x1,(%rbx,%rax,4)
pop    %rbx
ret

LLVM IR (-O0):
define void @intra_binenergy(double %0, double %1, double %2, i32* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32*
%9 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i32* %3, i32** %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fsub double %10, %11
%13 = load double, double* %7
%14 = fdiv double %12, %13
%15 = call i32 @floor(double %14)
store i32 %15, i32* %9
%16 = load i32*, i32** %8
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
store i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @intra_binenergy(double %0, double %1, double %2, i32* nocapture %3) {
%5 = fsub double %0, %1
%6 = fdiv double %5, %2
%7 = tail call i32 @floor(double %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %3, i64 %8
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
ret void
}
int mdp4_writeback_stop(struct fb_info *info) { return 0; }


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

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

LLVM IR (-O0):
%struct.fb_info = type opaque
define i32 @mdp4_writeback_stop(%struct.fb_info* %0) {
%2 = alloca %struct.fb_info*
store %struct.fb_info* %0, %struct.fb_info** %2
ret i32 0
}

LLVM IR (-O2):
%struct.fb_info = type opaque
define i32 @mdp4_writeback_stop(%struct.fb_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free_streamer_data();
void closeConnect() { free_streamer_data(); }


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

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

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

LLVM IR (-O2):
define void @closeConnect() {
%1 = tail call i32 (...) @free_streamer_data()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int tcflush(int, int /*<<< orphan*/);
int ser_flush(int fd) { return tcflush(fd, TCIOFLUSH); }


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

x86 assembly (clang, -O2):
<ser_flush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define i32 @ser_flush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIOFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define i32 @ser_flush(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pollen_net_transport_SingleBufferManager_freeBuffer__E();
void pollen_net_transport_BufferManager_freeBuffer__E() {
  pollen_net_transport_SingleBufferManager_freeBuffer__E();
}


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

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

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

LLVM IR (-O2):
define void @pollen_net_transport_BufferManager_freeBuffer__E() {
%1 = tail call i32 (...) @pollen_net_transport_SingleBufferManager_freeBuffer__E()
ret void
}
int foo() {
  int i = 0;
  int sum = 0;
  int a[5] = {1, 2, 3, 4, 5};
  for (i = 0; i < 5; i++) {
    sum += a[i];
  }
  return sum;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee2(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    115e <foo+0x5e>
movslq -0x4(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <foo+0x38>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.foo.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast [5 x i32]* %3 to i8*
store i32 0, i32* %1
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = load i32, i32* %2
%14 = add nsw i32 %13, %12
store i32 %14, i32* %2
br label %15
15: ; preds = %8
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %5
18: ; preds = %5
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 15
}
void PDJPG_Init() {
  static int init = 0;
  int i, j;
  float f, g;
  if (init)
    return;
  init = 1;
}


x86 assembly (clang, -O0):
<PDJPG_Init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
je     1116 <PDJPG_Init+0x16>
jmp    1120 <PDJPG_Init+0x20>
movl   $0x1,0x2f04(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDJPG_Init>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <PDJPG_Init+0x10>
movb   $0x1,0x2f14(%rip)
ret

LLVM IR (-O0):
@PDJPG_Init.init = internal global i32 0
define void @PDJPG_Init() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = load i32, i32* @PDJPG_Init.init
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
br label %9
8: ; preds = %0
store i32 1, i32* @PDJPG_Init.init
br label %9
9: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@PDJPG_Init.init = internal unnamed_addr global i1 false
define void @PDJPG_Init() {
%1 = load i1, i1* @PDJPG_Init.init
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @PDJPG_Init.init
br label %3
3: ; preds = %0, %2
ret void
}
int main() {
  short int a = L'a';
  short int b = L'b';
  return b - a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x61,-0x6(%rbp)
movw   $0x62,-0x8(%rbp)
movswl -0x8(%rbp),%eax
movswl -0x6(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 97, i16* %2
store i16 98, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = load i16, i16* %2
%7 = sext i16 %6 to i32
%8 = sub nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
struct CONSOLE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cons_putchar(struct CONSOLE *, unsigned char, int);
void cons_putstr0(struct CONSOLE *cons, char *s) {
  unsigned char *sz = (unsigned char *)s;
  for (; *sz != 0; sz++) {
    cons_putchar(cons, *sz, 1);
  }
  return;
}


x86 assembly (clang, -O0):
<cons_putstr0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     115e <cons_putstr0+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    $0x1,%edx
movzbl (%rax),%esi
call   1030 <cons_putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <cons_putstr0+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cons_putstr0>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     114b <cons_putstr0+0x3b>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %al,%esi
mov    %r14,%rdi
mov    $0x1,%edx
call   1030 <cons_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <cons_putstr0+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.CONSOLE = type { i32 }
define void @cons_putstr0(%struct.CONSOLE* %0, i8* %1) {
%3 = alloca %struct.CONSOLE*
%4 = alloca i8*
%5 = alloca i8*
store %struct.CONSOLE* %0, %struct.CONSOLE** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
br label %7
7: ; preds = %17, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %7
%13 = load %struct.CONSOLE*, %struct.CONSOLE** %3
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = call i32 @cons_putchar(%struct.CONSOLE* %13, i8 zeroext %15, i32 1)
br label %17
17: ; preds = %12
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %5
br label %7
20: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.CONSOLE = type { i32 }
define void @cons_putstr0(%struct.CONSOLE* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = tail call i32 @cons_putchar(%struct.CONSOLE* %0, i8 zeroext %6, i32 1)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
bool nrf91_errata_16(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf91_errata_16() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf91_errata_16() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ left(int);
int /*<<< orphan*/ right(int);
void top(int i) {
  if (i % 2 == 0) {
    left(i);
  } else {
    right(i);
  }
}


x86 assembly (clang, -O0):
<top>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114c <top+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <left@plt>
jmp    1154 <top+0x34>
mov    -0x4(%rbp),%edi
call   1040 <right@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<top>:
test   $0x1,%dil
jne    112b <top+0xb>
jmp    1030 <left@plt>
jmp    1040 <right@plt>

LLVM IR (-O0):
define void @top(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @left(i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @right(i32 %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
define void @top(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @left(i32 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @right(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int tolower(int);
int lowercase(int c, int keepcase) {
  if (keepcase)
    return c;
  return tolower(c);
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1133 <lowercase+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <lowercase+0x2e>
mov    -0x8(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
test   %esi,%esi
je     1117 <lowercase+0x7>
mov    %edi,%eax
ret
jmp    1030 <tolower@plt>

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

LLVM IR (-O2):
define i32 @lowercase(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @tolower(i32 %0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %0, %2 ]
ret i32 %7
}
int maxN(int a, int b) { return a < b ? b : a; }


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

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

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

LLVM IR (-O2):
define i32 @maxN(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int add(int op1, int op2) { return op1 + op2; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ my_init();
int /*<<< orphan*/ printf(char *);
__attribute__((__constructor__)) void actual_init() {
  printf("initing\n");
  my_init();
}


x86 assembly (clang, -O0):
<actual_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <my_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<actual_init>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <my_init@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"initing\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @actual_init, i8* null }]
define void @actual_init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @my_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @actual_init, i8* null }]
@str = [8 x i8] c"initing\00"
define void @actual_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @my_init()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int main(int argc, char **argv) {
  int *a, *b, *c;
  a = (int *)malloc(sizeof(int));
  b = a;
  a = c;
  b = (int *)malloc(sizeof(int));
  c = (int *)malloc(sizeof(int));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i64 @malloc(i32 4)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %6
store i32* %11, i32** %7
%12 = load i32*, i32** %8
store i32* %12, i32** %6
%13 = call i64 @malloc(i32 4)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %7
%15 = call i64 @malloc(i32 4)
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = tail call i64 @malloc(i32 4)
%5 = tail call i64 @malloc(i32 4)
ret i32 0
}
int map_bootblock_is_valid(char *bootblock) {
  return (bootblock[0] == 0x4C) && (bootblock[1] == 0x4B);
}


x86 assembly (clang, -O0):
<map_bootblock_is_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x4c,%ecx
mov    %al,-0x9(%rbp)
jne    112e <map_bootblock_is_valid+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x4b,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_bootblock_is_valid>:
xor    %eax,%eax
cmpb   $0x4c,(%rdi)
jne    1110 <map_bootblock_is_valid+0x10>
xor    %eax,%eax
cmpb   $0x4b,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @map_bootblock_is_valid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 76
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 75
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @map_bootblock_is_valid(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 76
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 75
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ jerry_port_console(char *, char *, char *);
void print_usage(char *name) {
  jerry_port_console("Usage: %s [OPTION]... [FILE]...\n"
                     "Try '%s --help' for more information.\n",
                     name, name);
}


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

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

LLVM IR (-O0):
@.str = [71 x i8] c"Usage: %s [OPTION]... [FILE]...\0ATry '%s --help' for more information.\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @jerry_port_console(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"Usage: %s [OPTION]... [FILE]...\0ATry '%s --help' for more information.\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @jerry_port_console(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *strchr(char *, char);
int strlen(char *);
int safegets(char *buffer, int n) {
  char *ptr;
  fgets(buffer, n, stdin);
  buffer[n + 1] = '\0';
  ptr = strchr(buffer, '\n');
  if (ptr != NULL) {
    ptr[0] = '\0';
  }
  return strlen(buffer);
}


x86 assembly (clang, -O0):
<safegets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
call   1050 <fgets@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1189 <safegets+0x59>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safegets>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
call   1050 <fgets@plt>
movslq %ebp,%rax
movb   $0x0,0x1(%rax,%rbx,1)
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1163 <safegets+0x33>
movb   $0x0,(%rax)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @safegets(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %6, i32 %7, i32 %8)
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %3
%16 = call i8* @strchr(i8* %15, i8 signext 10)
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 0, i8* %21
br label %22
22: ; preds = %19, %2
%23 = load i8*, i8** %3
%24 = call i32 @strlen(i8* %23)
ret i32 %24
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @safegets(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %0, i32 %1, i32 %3)
%5 = add nsw i32 %1, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
%8 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%9 = icmp eq i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
store i8 0, i8* %8
br label %11
11: ; preds = %10, %2
%12 = tail call i32 @strlen(i8* %0)
ret i32 %12
}
/* Variables and functions */
scalar_t__ USART_IsSendReady();
int /*<<< orphan*/ USART_Send(char *);
void setup_usart() {
  if (USART_IsSendReady()) {
    USART_Send("AT+NAMExyz");
  }
}


x86 assembly (clang, -O0):
<setup_usart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <USART_IsSendReady@plt>
cmp    $0x0,%rax
je     1141 <setup_usart+0x21>
lea    0xec4(%rip),%rdi
call   1030 <USART_Send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_usart>:
push   %rax
xor    %eax,%eax
call   1040 <USART_IsSendReady@plt>
test   %rax,%rax
je     113a <setup_usart+0x1a>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <USART_Send@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"AT+NAMExyz\00"
define void @setup_usart() {
%1 = call i64 (...) @USART_IsSendReady()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @USART_Send(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"AT+NAMExyz\00"
define void @setup_usart() {
%1 = tail call i64 (...) @USART_IsSendReady()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @USART_Send(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ parent;
};
typedef TYPE_1__ XMapRequestEvent;
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void do_MapRequest(FILE *out_f, XEvent *eventp) {
  XMapRequestEvent *e = (XMapRequestEvent *)eventp;
  fprintf(out_f, "    parent 0x%lx, window 0x%lx\n", e->parent, e->window);
}


x86 assembly (clang, -O0):
<do_MapRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_MapRequest>:
mov    (%rsi),%ecx
mov    0x4(%rsi),%edx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32 }
@.str = [32 x i8] c" parent 0x%lx, window 0x%lx\0A\00"
define void @do_MapRequest(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.TYPE_2__*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = bitcast i32* %6 to %struct.TYPE_2__*
store %struct.TYPE_2__* %7, %struct.TYPE_2__** %5
%8 = load i32*, i32** %3
%9 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%13 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c" parent 0x%lx, window 0x%lx\0A\00"
define void @do_MapRequest(i32* nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = load i32, i32* %3
%5 = load i32, i32* %1
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
void foo080(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo080(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
void in4(uint32_t *x) { *x = be32toh(*x); }


x86 assembly (clang, -O0):
<in4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <be32toh@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in4>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <be32toh@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @in4(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @be32toh(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s2eras();
void s2eras_() { s2eras(); }


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

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

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

LLVM IR (-O2):
define void @s2eras_() {
%1 = tail call i32 (...) @s2eras()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PWM4_FAULT_DriverIRQHandler();
__attribute__((weak)) void PWM4_FAULT_IRQHandler(void) {
  PWM4_FAULT_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM4_FAULT_IRQHandler() {
%1 = call i32 (...) @PWM4_FAULT_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM4_FAULT_IRQHandler() {
%1 = tail call i32 (...) @PWM4_FAULT_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void modInitFunc2(void) {
  printf("modInitFunc2\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<modInitFunc2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<modInitFunc2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"modInitFunc2\0A\00"
@stdout = global i32 0
define void @modInitFunc2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [13 x i8] c"modInitFunc2\00"
define void @modInitFunc2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int rOne();
int main(void) { return rOne(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rOne()
ret i32 %1
}
void unlock_mm() {}


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

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

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

LLVM IR (-O2):
define void @unlock_mm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function(char *);
int sum(char *);
int main() {
  char t[] = "asdf";
  function(t);
  return sum(t) % 256;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rdi
call   1040 <function@plt>
lea    -0x9(%rbp),%rdi
call   1030 <sum@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x66647361,0x8(%rsp)
66
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <function@plt>
mov    %rbx,%rdi
call   1030 <sum@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.t = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = bitcast [5 x i8]* %2 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @function(i8* %4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @sum(i8* %6)
%8 = srem i32 %7, 256
ret i32 %8
}

LLVM IR (-O2):
@__const.main.t = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @function(i8* %2)
%4 = call i32 @sum(i8* %2)
%5 = srem i32 %4, 256
ret i32 %5
}
int evaluate(int x, int (*funzione)(int)) { return 0; }


x86 assembly (clang, -O0):
<evaluate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @evaluate(i32 %0, i32 (i32)* nocapture readnone %1) {
ret i32 0
}
unsigned xrop3_197_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_197_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_197_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
and    $0xffffff00,%eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_197_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %7
%39 = xor i32 %38, -1
%40 = and i32 %37, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = and i32 %41, %42
%44 = or i32 %40, %43
%45 = load i32, i32* %5
%46 = load i32, i32* %7
%47 = and i32 %45, %46
%48 = or i32 %44, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @xrop3_197_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %4, %6
%8 = or i32 %7, 255
%9 = xor i32 %8, -1
%10 = or i8 %1, %0
%11 = zext i8 %10 to i32
%12 = or i32 %11, %9
ret i32 %12
}
unsigned foo(unsigned a, unsigned b) { return (a & ~b) | (~a & b); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
int isalpha(int c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ? 1 : 0);
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isalpha+0x39>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 %19
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
int CRYPTO_secure_allocated(const void *ptr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CRYPTO_secure_allocated(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "\nUsage:\n   %s\n\n",
          "meta2envi"
          " [-log <logfile>] <meta_name> <envi_name>\n"
          "             [-license] [-version] [-help]");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xee5(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [94 x i8] c"meta2envi [-log <logfile>] <meta_name> <envi_name>\0A [-license] [-version] [-help]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [94 x i8] c"meta2envi [-log <logfile>] <meta_name> <envi_name>\0A [-license] [-version] [-help]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.1, i64 0, i64 0))
ret void
}