xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int year;
  scanf("%d", &year);
  if (year % 4 == 0) {
    printf("Leap Year");
  } else {
    printf("Not Leap Year");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1164 <main+0x44>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x3,0x4(%rsp)
lea    0xec9(%rip),%rax
lea    0xebe(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"Leap Year\00"
@.str.2 = [14 x i8] c"Not Leap Year\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"Leap Year\00"
@.str.2 = [14 x i8] c"Not Leap Year\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IF_fct_2(char);
void IF_Legal(void) { IF_fct_2('='); }


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

x86 assembly (clang, -O2):
<IF_Legal>:
mov    $0x3d,%edi
jmp    1030 <IF_fct_2@plt>

LLVM IR (-O0):
define void @IF_Legal() {
%1 = call i32 @IF_fct_2(i8 signext 61)
ret void
}

LLVM IR (-O2):
define void @IF_Legal() {
%1 = tail call i32 @IF_fct_2(i8 signext 61)
ret void
}
void f(void) {
  int a[100][100];
#pragma hlt block
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 100; j++) {
      a[i][j] = i * j;
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9bd0,%rsp
movl   $0x0,-0x9c44(%rbp)
cmpl   $0x64,-0x9c44(%rbp)
jge    1195 <f+0x95>
movl   $0x0,-0x9c48(%rbp)
cmpl   $0x64,-0x9c48(%rbp)
jge    117c <f+0x7c>
mov    -0x9c44(%rbp),%edx
imul   -0x9c48(%rbp),%edx
movslq -0x9c44(%rbp),%rcx
lea    -0x9c40(%rbp),%rax
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
movslq -0x9c48(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x9c48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c48(%rbp)
jmp    112c <f+0x2c>
jmp    1181 <f+0x81>
mov    -0x9c44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c44(%rbp)
jmp    1115 <f+0x15>
add    $0x9bd0,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
int compare2(const void *a, const void *b) { return (*(int *)b - *(int *)a); }


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

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

LLVM IR (-O0):
define i32 @compare2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare2(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
unsigned char command_check4(int number) {
  int response;
  response = 0x30 + number;
  return response;
}


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

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

LLVM IR (-O0):
define zeroext i8 @command_check4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 48, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @command_check4(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
int rte_calc_order(int size) {
  int order;
  size = (size - 1) >> (12U - 1);
  order = -1;
  do {
    size >>= 1;
    order++;
  } while (size);
  return order;
}


x86 assembly (clang, -O0):
<rte_calc_order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
sar    $0xb,%eax
mov    %eax,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111a <rte_calc_order+0x1a>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_calc_order>:
add    $0xffffffff,%edi
sar    $0xb,%edi
mov    $0xffffffff,%eax
mov    %edi,%ecx
nopl   (%rax)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <rte_calc_order+0x10>
ret

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

LLVM IR (-O2):
define i32 @rte_calc_order(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 11
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ %3, %1 ], [ %7, %4 ]
%6 = phi i32 [ -1, %1 ], [ %8, %4 ]
%7 = ashr i32 %5, 1
%8 = add nsw i32 %6, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 %8
}
unsigned base32_decode_length(unsigned length) { return (length * 5) / 8; }


x86 assembly (clang, -O0):
<base32_decode_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%eax
shr    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base32_decode_length>:
lea    (%rdi,%rdi,4),%eax
shr    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @base32_decode_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 5
%5 = udiv i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @base32_decode_length(i32 %0) {
%2 = mul i32 %0, 5
%3 = lshr i32 %2, 3
ret i32 %3
}
/* Variables and functions */
int scr_set(char *);
int wrap_scr_set(char *filename) { return scr_set(filename); }


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

x86 assembly (clang, -O2):
<wrap_scr_set>:
jmp    1030 <scr_set@plt>

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

LLVM IR (-O2):
define i32 @wrap_scr_set(i8* %0) {
%2 = tail call i32 @scr_set(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ mainloop();
int /*<<< orphan*/ pre_initialize();
int /*<<< orphan*/ process_args(int, char **);
int main(int argc, char *argv[]) {
  pre_initialize();
  process_args(argc, argv);
  initialize();
  mainloop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <pre_initialize@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <process_args@plt>
mov    $0x0,%al
call   1040 <initialize@plt>
mov    $0x0,%al
call   1050 <mainloop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <pre_initialize@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <process_args@plt>
xor    %eax,%eax
call   1040 <initialize@plt>
xor    %eax,%eax
call   1050 <mainloop@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @pre_initialize()
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @process_args(i32 %7, i8** %8)
%10 = call i32 (...) @initialize()
%11 = call i32 (...) @mainloop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @pre_initialize()
%4 = tail call i32 @process_args(i32 %0, i8** %1)
%5 = tail call i32 (...) @initialize()
%6 = tail call i32 (...) @mainloop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void shr_reg32_cl(unsigned int reg32) {
  put8(0xD3);
  put8(0xE8 + reg32);
}


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

x86 assembly (clang, -O2):
<shr_reg32_cl>:
push   %rbx
mov    %edi,%ebx
mov    $0xd3,%edi
call   1030 <put8@plt>
add    $0xe8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

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

LLVM IR (-O2):
define void @shr_reg32_cl(i32 %0) {
%2 = tail call i32 @put8(i32 211)
%3 = add i32 %0, 232
%4 = tail call i32 @put8(i32 %3)
ret void
}
void openmm_take_one_step(void *data) {}


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

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

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

LLVM IR (-O2):
define void @openmm_take_one_step(i8* nocapture %0) {
ret void
}
float funAuxiliar(float x) {
  if (x < 0)
    x = -x;
  return x;
}


x86 assembly (clang, -O0):
<funAuxiliar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <funAuxiliar+0x2d>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<funAuxiliar>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @funAuxiliar(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
store float %7, float* %2
br label %8
8: ; preds = %5, %1
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @funAuxiliar(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
unsigned xrop3_69_0_0(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 = ~S;
  stk2 = T & stk3;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_69_0_0>:
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    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_69_0_0(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* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
ret i32 %33
}

LLVM IR (-O2):
define i32 @xrop3_69_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = xor i32 %8, -256
ret i32 %9
}
/* Variables and functions */
size_t cwk_path_output_sized(char *, size_t, size_t, char const *, size_t);
size_t strlen(char const *);
size_t cwk_path_output(char *buffer, size_t buffer_size, size_t position,
                       const char *str) {
  size_t length;
  length = strlen(str);
  return cwk_path_output_sized(buffer, buffer_size, position, str, length);
}


x86 assembly (clang, -O0):
<cwk_path_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <cwk_path_output_sized@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwk_path_output>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rcx,%rdi
call   1030 <strlen@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %rax,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <cwk_path_output_sized@plt>

LLVM IR (-O0):
define i64 @cwk_path_output(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %9
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = load i64, i64* %7
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = call i64 @cwk_path_output_sized(i8* %12, i64 %13, i64 %14, i8* %15, i64 %16)
ret i64 %17
}

LLVM IR (-O2):
define i64 @cwk_path_output(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%6 = tail call i64 @cwk_path_output_sized(i8* %0, i64 %1, i64 %2, i8* %3, i64 %5)
ret i64 %6
}
/* Variables and functions */
int foobar(int, char **);
int main(int argc, char *argv[]) { return foobar(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <foobar@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @foobar(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __initialize__();
int /*<<< orphan*/ hello_world();
int main() {
  __initialize__();
  hello_world();
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @__initialize__()
%2 = call i32 (...) @hello_world()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__initialize__()
%2 = tail call i32 (...) @hello_world()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float stdlib_strided_snansumkbn(int /*<<< orphan*/ const, float const *,
                                int /*<<< orphan*/ const);
float stdlib_strided_snansum(const int64_t N, const float *X,
                             const int64_t stride) {
  return stdlib_strided_snansumkbn(N, X, stride);
}


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

x86 assembly (clang, -O2):
<stdlib_strided_snansum>:
jmp    1030 <stdlib_strided_snansumkbn@plt>

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

LLVM IR (-O2):
define float @stdlib_strided_snansum(i32 %0, float* %1, i32 %2) {
%4 = tail call float @stdlib_strided_snansumkbn(i32 %0, float* %1, i32 %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ RunFuriatune(char *);
void xFpuOff(void) { RunFuriatune("fpu off"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"fpu off\00"
define void @xFpuOff() {
%1 = call i32 @RunFuriatune(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"fpu off\00"
define void @xFpuOff() {
%1 = tail call i32 @RunFuriatune(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t __getpgid(pid_t pid) { return pid; }


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

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

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

LLVM IR (-O2):
define i32 @__getpgid(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void swap(void *p1, void *p2, size_t size) {
  char buffer[size];
  memcpy(buffer, p1, size);
  memcpy(p1, p2, size);
  memcpy(p2, buffer, size);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8, i64 %2
%5 = call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = call i32 @memcpy(i8* %1, i8* %4, i64 %2)
ret void
}
const char *display_available(int *dpy_avail) {
  *dpy_avail = 0;
  const char *err_msg = "";
  err_msg = "no graphical display found";
  return err_msg;
}


x86 assembly (clang, -O0):
<display_available>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
lea    0xf01(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_available>:
movl   $0x0,(%rdi)
lea    0xef3(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [27 x i8] c"no graphical display found\00"
define i8* @display_available(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32 0, i32* %4
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %3
ret i8* %5
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"no graphical display found\00"
define i8* @display_available(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0)
}
/* Variables and functions */
int f242(int *);
int f243(int *p) { return f242(p); }


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

x86 assembly (clang, -O2):
<f243>:
jmp    1030 <f242@plt>

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

LLVM IR (-O2):
define i32 @f243(i32* %0) {
%2 = tail call i32 @f242(i32* %0)
ret i32 %2
}
int test_imm_BBint32_mem(int *val) {
  return ((*val) & (0xBB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BBint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xbb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BBint32_mem>:
testb  $0xbb,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BBint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 187
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int EEPROMDeviceName(char *DevName) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @EEPROMDeviceName(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int _getmpeg2frame(unsigned char *, int /*<<< orphan*/);
int getmpeg2frameRGB(unsigned char *rgb) { return _getmpeg2frame(rgb, 0); }


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

x86 assembly (clang, -O2):
<getmpeg2frameRGB>:
xor    %esi,%esi
jmp    1030 <_getmpeg2frame@plt>

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

LLVM IR (-O2):
define i32 @getmpeg2frameRGB(i8* %0) {
%2 = tail call i32 @_getmpeg2frame(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void file_closer(void *data) {
  int fd = (int)(long)data;
  close(fd);
}


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

x86 assembly (clang, -O2):
<file_closer>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @file_closer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
ret void
}

LLVM IR (-O2):
define void @file_closer(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @close(i32 %3)
ret void
}
int main() { int x$1[6]; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [6 x i32]
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(void) {
  fputs("Usage: word_counter file\n"
        "Count word occurences in given file.\n",
        stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Usage: word_counter file\0ACount word occurences in given file.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [63 x i8] c"Usage: word_counter file\0ACount word occurences in given file.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
unsigned long sum(unsigned int n) {
  unsigned long sum = 0;
  for (unsigned long i = 1; i <= n; i++) {
    sum -= i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
cmp    %rcx,%rax
ja     1147 <sum+0x47>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <sum+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
je     1123 <sum+0x23>
mov    %edi,%ecx
lea    -0x1(%rcx),%rax
lea    -0x2(%rcx),%rdx
mul    %rdx
shld   $0x3f,%rax,%rdx
lea    (%rdx,%rcx,2),%rcx
mov    $0x1,%eax
sub    %rcx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @sum(i32 %0) {
%2 = zext i32 %0 to i64
%3 = icmp eq i32 %0, 0
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = add nsw i64 %2, -1
%6 = zext i64 %5 to i65
%7 = add nsw i64 %2, -2
%8 = zext i64 %7 to i65
%9 = mul i65 %6, %8
%10 = lshr i65 %9, 1
%11 = trunc i65 %10 to i64
%12 = mul nsw i64 %2, -2
%13 = sub i64 1, %11
%14 = add i64 %12, %13
br label %15
15: ; preds = %4, %1
%16 = phi i64 [ 0, %1 ], [ %14, %4 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int buffer[20];
  int in, out;
  printf("Hello world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ minor_code;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
int get_XNoExposeEvent_minor_code(void *_p) {
  return (int)((XNoExposeEvent *)_p)->minor_code;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XNoExposeEvent_minor_code(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XNoExposeEvent_minor_code(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ error(char *);
scalar_t__ tcgetattr(int, struct termios *);
void etcgetattr(int fd, struct termios *tm) {
  if (tcgetattr(fd, tm) < 0)
    error("tcgetattr");
}


x86 assembly (clang, -O0):
<etcgetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <tcgetattr@plt>
cmp    $0x0,%rax
jge    1151 <etcgetattr+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etcgetattr>:
push   %rax
call   1040 <tcgetattr@plt>
test   %rax,%rax
js     112d <etcgetattr+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <error@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@.str = [10 x i8] c"tcgetattr\00"
define void @etcgetattr(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
%5 = load i32, i32* %3
%6 = load %struct.termios*, %struct.termios** %4
%7 = call i64 @tcgetattr(i32 %5, %struct.termios* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@.str = [10 x i8] c"tcgetattr\00"
define void @etcgetattr(i32 %0, %struct.termios* %1) {
%3 = tail call i64 @tcgetattr(i32 %0, %struct.termios* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
void gtk_window_activate_default() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_activate_default() {
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
void dec_json_key(char *key) {
  char *ptr = NULL;
  if (key && (ptr = strrchr(key, '.')))
    *ptr = '\0';
  else if (key && !(ptr = strrchr(key, '.')))
    key[0] = '\0';
}


x86 assembly (clang, -O0):
<dec_json_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <dec_json_key+0x47>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1157 <dec_json_key+0x47>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    118a <dec_json_key+0x7a>
cmpq   $0x0,-0x8(%rbp)
je     1185 <dec_json_key+0x75>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1185 <dec_json_key+0x75>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    118a <dec_json_key+0x7a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_json_key>:
test   %rdi,%rdi
je     112e <dec_json_key+0x1e>
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
cmove  %rbx,%rax
movb   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @dec_json_key(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i8* @strrchr(i8* %7, i8 signext 46)
store i8* %8, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = load i8*, i8** %3
store i8 0, i8* %11
br label %23
12: ; preds = %6, %1
%13 = load i8*, i8** %2
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i8*, i8** %2
%17 = call i8* @strrchr(i8* %16, i8 signext 46)
store i8* %17, i8** %3
%18 = icmp ne i8* %17, null
br i1 %18, label %22, label %19
19: ; preds = %15
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 0, i8* %21
br label %22
22: ; preds = %19, %15, %12
br label %23
23: ; preds = %22, %10
ret void
}

LLVM IR (-O2):
define void @dec_json_key(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 46)
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* %0, i8* %4
store i8 0, i8* %6
br label %7
7: ; preds = %3, %1
ret void
}
void default_exit_func() {}


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

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

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

LLVM IR (-O2):
define void @default_exit_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doStuff2(int);
void f_8(void) {
  int g;
  doStuff2(g);
}


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

x86 assembly (clang, -O2):
<f_8>:
jmp    1030 <doStuff2@plt>

LLVM IR (-O0):
define void @f_8() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @doStuff2(i32 %2)
ret void
}

LLVM IR (-O2):
define void @f_8() {
%1 = tail call i32 @doStuff2(i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int, double);
int main(void) {
  printf("character: %c\ninteger: %d\nfloating poit: %f\n", '}', 34, 3.14);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"character: %c\0Ainteger: %d\0Afloating poit: %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8 signext 125, i32 34, double 3.140000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"character: %c\0Ainteger: %d\0Afloating poit: %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8 signext 125, i32 34, double 3.140000e+00)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int read_i2c_reg(int, int, int /*<<< orphan*/ *);
int piups_get_v5vconv(int file_i2c, uint16_t *v5vconv) {
  return read_i2c_reg(file_i2c, 0x58, v5vconv);
}


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

x86 assembly (clang, -O2):
<piups_get_v5vconv>:
mov    %rsi,%rdx
mov    $0x58,%esi
jmp    1030 <read_i2c_reg@plt>

LLVM IR (-O0):
define i32 @piups_get_v5vconv(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 = call i32 @read_i2c_reg(i32 %5, i32 88, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @piups_get_v5vconv(i32 %0, i32* %1) {
%3 = tail call i32 @read_i2c_reg(i32 %0, i32 88, i32* %1)
ret i32 %3
}
void swift_getWitnessTable(void) {}


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

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

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

LLVM IR (-O2):
define void @swift_getWitnessTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int close_fifo(int fifo_fd) { close(fifo_fd); }


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

x86 assembly (clang, -O2):
<close_fifo>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @close_fifo(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern long shmem_swap(long *target, long value, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define i64 @shmem_swap(i64* nocapture readnone %0, i64 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i64 undef
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ showDmzSetting();
void cmdShowDmz(int cmdType, struct cmd_arg *pCmdArg) { showDmzSetting(); }


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdShowDmz(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @showDmzSetting()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdShowDmz(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @showDmzSetting()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_list_char();
int /*<<< orphan*/ test_list_int();
int main(int argc, char *argv[]) {
  test_list_int();
  test_list_char();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_list_int@plt>
xor    %eax,%eax
call   1040 <test_list_char@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_list_int()
%7 = call i32 (...) @test_list_char()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_list_int()
%4 = tail call i32 (...) @test_list_char()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_module_if_kaput_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_module_if@%p::kaput (rtpp_module_if_kaput) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_module_if_kaput_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_module_if_kaput_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [85 x i8] c"Method rtpp_module_if@%p::kaput (rtpp_module_if_kaput) is invoked after destruction\0A\00"
define void @rtpp_module_if_kaput_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [85 x i8] c"Method rtpp_module_if@%p::kaput (rtpp_module_if_kaput) is invoked after destruction\0A\00"
define void @rtpp_module_if_kaput_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}