xunge/DecIR huggingface dataset:
void tea_decode_byte(char *v, int *k, int p) {
  char y[] = "NpK!TeA";
  *v = *v ^ (char)(k[p % 4] % 0xFF) ^ y[p];
}


x86 assembly (clang, -O0):
<tea_decode_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
mov    %dl,%cl
movsbl %cl,%ecx
xor    %ecx,%eax
movslq -0x14(%rbp),%rcx
movsbl -0x1c(%rbp,%rcx,1),%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tea_decode_byte>:
lea    0x3(%rdx),%eax
test   %edx,%edx
cmovns %edx,%eax
and    $0xfffffffc,%eax
movslq %edx,%rcx
sub    %eax,%edx
movslq %edx,%rax
movslq (%rsi,%rax,4),%rax
imul   $0xffffffff80808081,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%esi
shr    $0x1f,%esi
shr    $0x7,%edx
add    %esi,%edx
add    %eax,%edx
lea    0xec9(%rip),%rax
mov    (%rcx,%rax,1),%al
xor    (%rdi),%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
@__const.tea_decode_byte.y = [8 x i8] c"NpK!TeA\00"
define void @tea_decode_byte(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [8 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = bitcast [8 x i8]* %7 to i8*
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i32*, i32** %5
%13 = load i32, i32* %6
%14 = srem i32 %13, 4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i32, i32* %16
%18 = srem i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = sext i8 %19 to i32
%21 = xor i32 %11, %20
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = xor i32 %21, %26
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %4
store i8 %28, i8* %29
ret void
}

LLVM IR (-O2):
@__const.tea_decode_byte.y = [8 x i8] c"NpK!TeA\00"
define void @tea_decode_byte(i8* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i8, i8* %0
%5 = srem i32 %2, 4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = srem i32 %8, 255
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.tea_decode_byte.y, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = trunc i32 %9 to i8
%14 = xor i8 %12, %4
%15 = xor i8 %14, %13
store i8 %15, i8* %0
ret void
}
void VP8LDspInitMIPSdspR2(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8LDspInitMIPSdspR2() {
ret void
}
int test_imm_A0int64_highword_reg(long long val) {
  return ((val >> 32) & (0xA0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A0int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xa0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A0int64_highword_reg>:
movabs $0xa000000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A0int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 160
%6 = icmp ne i64 %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_A0int64_highword_reg(i64 %0) {
%2 = and i64 %0, 687194767360
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_widget_get_visual() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_visual() {
ret void
}
void pmu_adc_read_latest() {}


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

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

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

LLVM IR (-O2):
define void @pmu_adc_read_latest() {
ret void
}
void swap(char s[], int i, int j) {
  char temp = s[j];
  s[j] = s[i];
  s[i] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %edx,%rax
mov    (%rdi,%rax,1),%r8b
movslq %esi,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %r8b,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putdec(int, unsigned int);
void putdec8(unsigned char v) { putdec(100, (unsigned int)v); }


x86 assembly (clang, -O0):
<putdec8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%esi
mov    $0x64,%edi
call   1030 <putdec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putdec8>:
mov    %edi,%esi
mov    $0x64,%edi
jmp    1030 <putdec@plt>

LLVM IR (-O0):
define void @putdec8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = call i32 @putdec(i32 100, i32 %4)
ret void
}

LLVM IR (-O2):
define void @putdec8(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = tail call i32 @putdec(i32 100, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
void foo() { FILE *x = fopen("xyz", "r"); }


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

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"xyz\00"
@.str.1 = [2 x i8] c"r\00"
define void @foo() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"xyz\00"
@.str.1 = [2 x i8] c"r\00"
define void @foo() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clr_avails();
int /*<<< orphan*/ clr_entities();
int /*<<< orphan*/ clr_stack();
int /*<<< orphan*/ start_valnum();
void cs_clear() {
  clr_avails();
  clr_entities();
  clr_stack();
  start_valnum();
}


x86 assembly (clang, -O0):
<cs_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clr_avails@plt>
mov    $0x0,%al
call   1040 <clr_entities@plt>
mov    $0x0,%al
call   1060 <clr_stack@plt>
mov    $0x0,%al
call   1050 <start_valnum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_clear>:
push   %rax
xor    %eax,%eax
call   1030 <clr_avails@plt>
xor    %eax,%eax
call   1040 <clr_entities@plt>
xor    %eax,%eax
call   1060 <clr_stack@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <start_valnum@plt>

LLVM IR (-O0):
define void @cs_clear() {
%1 = call i32 (...) @clr_avails()
%2 = call i32 (...) @clr_entities()
%3 = call i32 (...) @clr_stack()
%4 = call i32 (...) @start_valnum()
ret void
}

LLVM IR (-O2):
define void @cs_clear() {
%1 = tail call i32 (...) @clr_avails()
%2 = tail call i32 (...) @clr_entities()
%3 = tail call i32 (...) @clr_stack()
%4 = tail call i32 (...) @start_valnum()
ret void
}
/* Variables and functions */
int max(int, int);
main() {
  int printf();
  printf("%d\n", max(1, 2));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @max(i32 1, i32 2)
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @printf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int main() {
  char word[] = {'H', 'e', 'a', 'c', '\0'};
  return 0;
  char *str = "Hello";
  char woord[] = "Hello";
  char wrd[10] = "Hello";
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeef(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeea(%rip),%al
mov    %al,-0x5(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.word = [5 x i8] c"Heac\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca i8*
%4 = alloca [6 x i8]
%5 = alloca [10 x i8]
store i32 0, i32* %1
%6 = bitcast [5 x i8]* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned xrop3_46_0_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 ^ T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

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

LLVM IR (-O0):
define i32 @xrop3_46_0_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* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_46_0_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 = xor i32 %6, 255
%8 = or i32 %7, %4
%9 = xor i32 %8, %6
%10 = and i32 %9, %4
%11 = xor i32 %6, -1
%12 = and i32 %8, %11
%13 = xor i32 %4, -1
%14 = and i32 %13, %5
%15 = or i32 %12, %14
%16 = or i32 %15, %10
ret i32 %16
}
int abs(int n) {
  if (n < 0)
    n = 0 - n;
  return n;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <abs+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void osTaskResumeAll(void) {}


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

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

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

LLVM IR (-O2):
define void @osTaskResumeAll() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, char const *, void *, size_t);
ssize_t _fgetxattr(int fd, const char *name, void *value, size_t size) {
  return syscall(193, fd, name, value, size);
}


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

x86 assembly (clang, -O2):
<_fgetxattr>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xc1,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @_fgetxattr(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @syscall(i32 193, i32 %9, i8* %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @_fgetxattr(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @syscall(i32 193, i32 %0, i8* %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ stdout;
void printUsage(char const *const execFile) {
  fprintf(
      stdout,
      "Usage : %s -i <filename> [-h] [-m <value>] [-d <dir>] [-b <value>]\n    "
      "-i, --input <filename> : Define the file containg pathes (local "
      "or\ndistant) to images.\n    -a, --annotation <filename> : Path to the "
      "file containing annotations\n    -h, --help : Display this help and "
      "quit.\n    -m, --max-file <value> : Treat only <value> files from the "
      "list\n    -d, --output-dir <dir> : Directory where to generate new "
      "files\n    -b, --bin <value> : Define number of bin for histograms\n",
      execFile);
}


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

x86 assembly (clang, -O2):
<printUsage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [473 x i8] c"Usage : %s -i <filename> [-h] [-m <value>] [-d <dir>] [-b <value>]\0A -i, --input <filename> : Define the file containg pathes (local or\0Adistant) to images.\0A -a, --annotation <filename> : Path to the file containing annotations\0A -h, --help : Display this help and quit.\0A -m, --max-file <value> : Treat only <value> files from the list\0A -d, --output-dir <dir> : Directory where to generate new files\0A -b, --bin <value> : Define number of bin for histograms\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([473 x i8], [473 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [473 x i8] c"Usage : %s -i <filename> [-h] [-m <value>] [-d <dir>] [-b <value>]\0A -i, --input <filename> : Define the file containg pathes (local or\0Adistant) to images.\0A -a, --annotation <filename> : Path to the file containing annotations\0A -h, --help : Display this help and quit.\0A -m, --max-file <value> : Treat only <value> files from the list\0A -d, --output-dir <dir> : Directory where to generate new files\0A -b, --bin <value> : Define number of bin for histograms\0A\00"
define void @printUsage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([473 x i8], [473 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int _index_offset(int i, int lvl, int max_lvl) {
  return ((i + 1) - (1 << lvl)) << (max_lvl - lvl);
}


x86 assembly (clang, -O0):
<_index_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_index_offset>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
add    %edi,%eax
add    $0x1,%eax
sub    %esi,%edx
mov    %edx,%ecx
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @_index_offset(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 1
%5 = shl nsw i32 -1, %1
%6 = add i32 %4, %5
%7 = sub nsw i32 %2, %1
%8 = shl i32 %6, %7
ret i32 %8
}
void g_io_channel_write_chars() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_write_chars() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  int x;
  x = 10;
  x > 10 ? puts("hello") : puts("world");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
jmp    114d <main+0x3d>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%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 = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
__int128_t quad_fetch_or(__int128_t *ptr, __int128_t value) {
  return __atomic_fetch_or(ptr, value, 2);
}


x86 assembly (clang, -O0):
<quad_fetch_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdi,-0x28(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x68(%rbp)
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <__atomic_fetch_or_16@plt>
mov    %rax,-0x80(%rbp)
mov    %rdx,-0x78(%rbp)
mov    -0x80(%rbp),%rax
mov    -0x78(%rbp),%rcx
mov    %rcx,-0x58(%rbp)
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quad_fetch_or>:
mov    $0x2,%ecx
jmp    1030 <__atomic_fetch_or_16@plt>

LLVM IR (-O0):
define { i64, i64 } @quad_fetch_or(i128* %0, i64 %1, i64 %2) {
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128*
%7 = alloca i128
%8 = alloca i128
%9 = alloca i128
%10 = alloca i128
%11 = alloca i128
%12 = bitcast i128* %5 to { i64, i64 }*
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 0
store i64 %1, i64* %13
%14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 1
store i64 %2, i64* %14
%15 = load i128, i128* %5
store i128* %0, i128** %6
store i128 %15, i128* %7
%16 = load i128*, i128** %6
%17 = load i128, i128* %7
store i128 %17, i128* %8
%18 = bitcast i128* %16 to i8*
%19 = load i128, i128* %8
store i128 %19, i128* %10
%20 = bitcast i128* %10 to { i64, i64 }*
%21 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %20, i32 0, i32 0
%22 = load i64, i64* %21
%23 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %20, i32 0, i32 1
%24 = load i64, i64* %23
%25 = call { i64, i64 } @__atomic_fetch_or_16(i8* %18, i64 %22, i64 %24, i32 2)
%26 = bitcast i128* %11 to { i64, i64 }*
%27 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %26, i32 0, i32 0
%28 = extractvalue { i64, i64 } %25, 0
store i64 %28, i64* %27
%29 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %26, i32 0, i32 1
%30 = extractvalue { i64, i64 } %25, 1
store i64 %30, i64* %29
%31 = load i128, i128* %11
store i128 %31, i128* %9
%32 = load i128, i128* %9
store i128 %32, i128* %4
%33 = bitcast i128* %4 to { i64, i64 }*
%34 = load { i64, i64 }, { i64, i64 }* %33
ret { i64, i64 } %34
}

LLVM IR (-O2):
define { i64, i64 } @quad_fetch_or(i128* %0, i64 %1, i64 %2) {
%4 = bitcast i128* %0 to i8*
%5 = tail call { i64, i64 } @__atomic_fetch_or_16(i8* %4, i64 %1, i64 %2, i32 2)
ret { i64, i64 } %5
}
/* Variables and functions */
int /*<<< orphan*/ get_string(char *);
scalar_t__ pingSrv(int /*<<< orphan*/);
char *s_let(char *, char *);
char *macpingServer(char *arg) {
  if (pingSrv(get_string(arg)))
    return s_let("alive", arg);
  return s_let("", arg);
}


x86 assembly (clang, -O0):
<macpingServer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <get_string@plt>
mov    %eax,%edi
call   1050 <pingSrv@plt>
cmp    $0x0,%rax
je     116f <macpingServer+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1030 <s_let@plt>
mov    %rax,-0x8(%rbp)
jmp    1183 <macpingServer+0x53>
mov    -0x10(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1030 <s_let@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macpingServer>:
push   %rbx
mov    %rdi,%rbx
call   1040 <get_string@plt>
mov    %eax,%edi
call   1050 <pingSrv@plt>
test   %rax,%rax
lea    0xebb(%rip),%rax
lea    0xeaf(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <s_let@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"alive\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @macpingServer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @get_string(i8* %4)
%6 = call i64 @pingSrv(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @s_let(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i8* @s_let(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %12)
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %8
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"alive\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @macpingServer(i8* %0) {
%2 = tail call i32 @get_string(i8* %0)
%3 = tail call i64 @pingSrv(i32 %2)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
%6 = tail call i8* @s_let(i8* %5, i8* %0)
ret i8* %6
}
void __attribute__((section(".after_vectors"))) BusFault_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<BusFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <BusFault_Handler+0x9>
jmp    1109 <BusFault_Handler+0x9>

x86 assembly (clang, -O2):
<BusFault_Handler>:
jmp    1100 <BusFault_Handler>

LLVM IR (-O0):
define void @BusFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @BusFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
double gammp(int, double);
double pchisq(double z, int df) { return gammp(df / 2.0, z / 2.0); }


x86 assembly (clang, -O0):
<pchisq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x8(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <gammp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pchisq>:
cvtsi2sd %edi,%xmm1
movsd  0xee4(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
mulsd  %xmm2,%xmm0
jmp    1030 <gammp@plt>

LLVM IR (-O0):
define double @pchisq(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 2.000000e+00
%8 = fptosi double %7 to i32
%9 = load double, double* %3
%10 = fdiv double %9, 2.000000e+00
%11 = call double @gammp(i32 %8, double %10)
ret double %11
}

LLVM IR (-O2):
define double @pchisq(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fmul double %3, 5.000000e-01
%5 = fptosi double %4 to i32
%6 = fmul double %0, 5.000000e-01
%7 = tail call double @gammp(i32 %5, double %6)
ret double %7
}
double opr_e(struct lifo *stack) { return 1.60217733E-19; }


x86 assembly (clang, -O0):
<opr_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<opr_e>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
%struct.lifo = type opaque
define double @opr_e(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
store %struct.lifo* %0, %struct.lifo** %2
ret double 0x3C07A4DAD55E53FE
}

LLVM IR (-O2):
%struct.lifo = type opaque
define double @opr_e(%struct.lifo* nocapture readnone %0) {
ret double 0x3C07A4DAD55E53FE
}
/* Variables and functions */
int _echo();
int _usage();
int main(int argc, char *argv[]) {
  if (argc != 1)
    return _usage();
  return _echo();
}


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)
cmpl   $0x1,-0x8(%rbp)
je     114f <main+0x2f>
mov    $0x0,%al
call   1030 <_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    1159 <main+0x39>
mov    $0x0,%al
call   1040 <_echo@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x1,%edi
jne    112c <main+0xc>
jmp    1040 <_echo@plt>
jmp    1030 <_usage@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 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @_usage()
store i32 %9, i32* %3
br label %12
10: ; preds = %2
%11 = call i32 (...) @_echo()
store i32 %11, i32* %3
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @_usage()
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @_echo()
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ draw_scene();
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glutSwapBuffers();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  draw_scene();
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <draw_scene@plt>
mov    $0x0,%al
call   1050 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1040 <draw_scene@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 (...) @draw_scene()
%6 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 (...) @draw_scene()
%6 = tail call i32 (...) @glutSwapBuffers()
ret void
}
void glFinish() { ; }


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

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

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

LLVM IR (-O2):
define void @glFinish() {
ret void
}
void minMax(double *min, double *max, double a, double b) {
  if (a < b) {
    *min = a;
    *max = b;
  } else {
    *min = b;
    *max = a;
  }
}


x86 assembly (clang, -O0):
<minMax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1149 <minMax+0x49>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1163 <minMax+0x63>
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minMax>:
movapd %xmm0,%xmm2
minsd  %xmm1,%xmm2
maxsd  %xmm0,%xmm1
movsd  %xmm2,(%rdi)
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @minMax(double* %0, double* %1, double %2, double %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = fcmp olt double %9, %10
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load double, double* %7
%14 = load double*, double** %5
store double %13, double* %14
%15 = load double, double* %8
%16 = load double*, double** %6
store double %15, double* %16
br label %22
17: ; preds = %4
%18 = load double, double* %8
%19 = load double*, double** %5
store double %18, double* %19
%20 = load double, double* %7
%21 = load double*, double** %6
store double %20, double* %21
br label %22
22: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
define void @minMax(double* nocapture writeonly %0, double* nocapture writeonly %1, double %2, double %3) {
%5 = fcmp olt double %2, %3
%6 = select i1 %5, double %2, double %3
%7 = select i1 %5, double %3, double %2
store double %6, double* %0
store double %7, double* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_strings(char *);
int main(int argc, char **argv) { get_strings(argv[0]); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <get_strings@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @get_strings(i8* %3)
ret i32 0
}
void stress_invalid_mkdirat(const int bad_fd) { (void)bad_fd; }


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

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

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

LLVM IR (-O2):
define void @stress_invalid_mkdirat(i32 %0) {
ret void
}
/* Variables and functions */
char *strchrnul(char const *, int);
char *strchr(const char *str, int ch) {
  char *chp = strchrnul(str, ch);
  if (*chp == '\0') {
    return ch == *chp ? chp : NULL;
  }
  return chp;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strchrnul@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1176 <strchr+0x66>
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115e <strchr+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1169 <strchr+0x59>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1169 <strchr+0x59>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117e <strchr+0x6e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
push   %rbx
mov    %esi,%ebx
call   1030 <strchrnul@plt>
xor    %ecx,%ecx
test   %ebx,%ebx
cmove  %rax,%rcx
cmpb   $0x0,(%rax)
cmove  %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i8* @strchrnul(i8* %7, i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %2
%15 = load i32, i32* %5
%16 = load i8*, i8** %6
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %15, %18
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = load i8*, i8** %6
br label %23
22: ; preds = %14
br label %23
23: ; preds = %22, %20
%24 = phi i8* [ %21, %20 ], [ null, %22 ]
store i8* %24, i8** %3
br label %27
25: ; preds = %2
%26 = load i8*, i8** %6
store i8* %26, i8** %3
br label %27
27: ; preds = %25, %23
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchrnul(i8* %0, i32 %1)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i8* %3, i8* null
%8 = select i1 %5, i8* %7, i8* %3
ret i8* %8
}
/* Type definitions */
struct kfifo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __kfifo_reset(struct kfifo *);
void kfifo_reset(struct kfifo *fifo) {
  unsigned long flags;
  __kfifo_reset(fifo);
}


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

x86 assembly (clang, -O2):
<kfifo_reset>:
jmp    1030 <__kfifo_reset@plt>

LLVM IR (-O0):
%struct.kfifo = type { i32 }
define void @kfifo_reset(%struct.kfifo* %0) {
%2 = alloca %struct.kfifo*
%3 = alloca i64
store %struct.kfifo* %0, %struct.kfifo** %2
%4 = load %struct.kfifo*, %struct.kfifo** %2
%5 = call i32 @__kfifo_reset(%struct.kfifo* %4)
ret void
}

LLVM IR (-O2):
%struct.kfifo = type { i32 }
define void @kfifo_reset(%struct.kfifo* %0) {
%2 = tail call i32 @__kfifo_reset(%struct.kfifo* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void removeArquivo(int numeroArq) {
  char arqRodada[20];
  sprintf(arqRodada, "rodada-%d.txt", numeroArq);
  remove(arqRodada);
}


x86 assembly (clang, -O0):
<removeArquivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <remove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeArquivo>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"rodada-%d.txt\00"
define void @removeArquivo(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i32 @remove(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"rodada-%d.txt\00"
define void @removeArquivo(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @remove(i8* %3)
ret void
}
int btlza_ctxindex(int ctx, int mask) {
  int i;
  i = ((ctx >> 16) * 251) >> 8;
  return ((ctx ^ (i << 16)) & mask);
}


x86 assembly (clang, -O0):
<btlza_ctxindex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
imul   $0xfb,%eax,%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
xor    %ecx,%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btlza_ctxindex>:
mov    %edi,%eax
sar    $0x10,%eax
imul   $0xfb00,%eax,%eax
and    $0xffff0000,%eax
xor    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @btlza_ctxindex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = ashr i32 %6, 16
%8 = mul nsw i32 %7, 251
%9 = ashr i32 %8, 8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = shl i32 %11, 16
%13 = xor i32 %10, %12
%14 = load i32, i32* %4
%15 = and i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @btlza_ctxindex(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = mul nsw i32 %3, 64256
%5 = and i32 %4, -65536
%6 = xor i32 %5, %0
%7 = and i32 %6, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ArgText();
int /*<<< orphan*/ Me();
int /*<<< orphan*/ SetOutMsg(int /*<<< orphan*/, char *);
char *TextOf(int /*<<< orphan*/);
void Act_SetOut(void) {
  char *x = TextOf(ArgText());
  SetOutMsg(Me(), x);
}


x86 assembly (clang, -O0):
<Act_SetOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <Me@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <SetOutMsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_SetOut>:
push   %rbx
xor    %eax,%eax
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <Me@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <SetOutMsg@plt>

LLVM IR (-O0):
define void @Act_SetOut() {
%1 = alloca i8*
%2 = call i32 (...) @ArgText()
%3 = call i8* @TextOf(i32 %2)
store i8* %3, i8** %1
%4 = call i32 (...) @Me()
%5 = load i8*, i8** %1
%6 = call i32 @SetOutMsg(i32 %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @Act_SetOut() {
%1 = tail call i32 (...) @ArgText()
%2 = tail call i8* @TextOf(i32 %1)
%3 = tail call i32 (...) @Me()
%4 = tail call i32 @SetOutMsg(i32 %3, i8* %2)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int pstrcmp(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<pstrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @pstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void htonb3(uint32_t host, uint8_t *network3) {
  network3[0] = (host & 0x00ff0000) >> 16;
  network3[1] = (host & 0x0000ff00) >> 8;
  network3[2] = host & 0x000000ff;
}


x86 assembly (clang, -O0):
<htonb3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonb3>:
mov    %edi,%eax
movzbl %ah,%ecx
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,(%rsi)
mov    %ecx,0x4(%rsi)
mov    %edx,0x8(%rsi)
ret

LLVM IR (-O0):
define void @htonb3(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 = and i32 %5, 16711680
%7 = ashr i32 %6, 16
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %3
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %3
%16 = and i32 %15, 255
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 %16, i32* %18
ret void
}

LLVM IR (-O2):
define void @htonb3(i32 %0, i32* nocapture writeonly %1) {
%3 = lshr i32 %0, 16
%4 = and i32 %3, 255
store i32 %4, i32* %1
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %6, i32* %7
%8 = and i32 %0, 255
%9 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dui_stbi_image_free(void *retval_from_stbi_load) {
  free(retval_from_stbi_load);
}


x86 assembly (clang, -O0):
<dui_stbi_image_free>:
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):
<dui_stbi_image_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @dui_stbi_image_free(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 @dui_stbi_image_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void _pthread_cleanup_pop() {}


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

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

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

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