xunge/DecIR huggingface dataset:
unsigned int longIntToRegister(long int l) {
  return (unsigned int)(l & 0xffff);
}


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

x86 assembly (clang, -O2):
<longIntToRegister>:
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @longIntToRegister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 65535
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @longIntToRegister(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 65535
ret i32 %3
}
void write_u32_be(unsigned char *dest, unsigned int src) {
  dest[0] = src >> 24;
  dest[1] = src >> 16;
  dest[2] = src >> 8;
  dest[3] = src >> 0;
}


x86 assembly (clang, -O0):
<write_u32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @write_u32_be(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_RST(int);
void do0xCF() { _I8080_RST(1); }


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

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

LLVM IR (-O0):
define void @do0xCF() {
%1 = call i32 @_I8080_RST(i32 1)
ret void
}

LLVM IR (-O2):
define void @do0xCF() {
%1 = tail call i32 @_I8080_RST(i32 1)
ret void
}
/* Variables and functions */
int preco(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("Total: R$ %.2lf", preco(a) * b / 100.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <preco@plt>
imul   -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe95(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <preco@plt>
imul   (%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xea2(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [16 x i8] c"Total: R$ %.2lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @preco(i32 %5)
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.000000e+02
%11 = fptosi double %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [16 x i8] c"Total: R$ %.2lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = call i32 @preco(i32 %6)
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.000000e+02
%12 = fptosi double %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}
/* Variables and functions */
int __nv_isfinited(double);
int __finite(double __a) { return __nv_isfinited(__a); }


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

x86 assembly (clang, -O2):
<__finite>:
jmp    1030 <__nv_isfinited@plt>

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

LLVM IR (-O2):
define i32 @__finite(double %0) {
%2 = tail call i32 @__nv_isfinited(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test3();
int main() {
  test1();
  test3();
  test1();
  test3();
  test1();
  test3();
  printf("pid %u\n", getpid());
  fflush(stdout);
  sleep(-1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test1@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1050 <test1@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1050 <test1@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe57(%rip),%rdi
call   1060 <printf@plt>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0xffffffff,%edi
call   1080 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe67(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0xffffffff,%edi
call   1080 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"pid %u\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test3()
%4 = call i32 (...) @test1()
%5 = call i32 (...) @test3()
%6 = call i32 (...) @test1()
%7 = call i32 (...) @test3()
%8 = call i32 (...) @getpid()
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
%12 = call i32 @sleep(i32 -1)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"pid %u\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test3()
%3 = tail call i32 (...) @test1()
%4 = tail call i32 (...) @test3()
%5 = tail call i32 (...) @test1()
%6 = tail call i32 (...) @test3()
%7 = tail call i32 (...) @getpid()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
%11 = tail call i32 @sleep(i32 -1)
ret i32 0
}
unsigned char VIM_HIF_GetReg8(unsigned long adr) {
  unsigned char TEMP;
  ;
  *(volatile unsigned short *)(0x8000000) = (unsigned short)adr;
  ;
  if ((adr & 0x1) == 0) {
    TEMP = (unsigned char)*(volatile unsigned short *)(0x8000100);
  } else
    TEMP = (unsigned char)((*(volatile unsigned short *)(0x8000100)) >> 8);
  return TEMP;
}


x86 assembly (clang, -O0):
<VIM_HIF_GetReg8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %ax,%cx
mov    $0x8000000,%eax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1139 <VIM_HIF_GetReg8+0x39>
mov    $0x8000100,%eax
mov    (%rax),%ax
mov    %al,-0x9(%rbp)
jmp    114a <VIM_HIF_GetReg8+0x4a>
mov    $0x8000100,%eax
mov    (%rax),%ax
movzwl %ax,%eax
sar    $0x8,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_HIF_GetReg8>:
mov    %di,0x8000000
08
movzwl 0x8000100,%ecx
08
mov    %ecx,%eax
shr    $0x8,%eax
test   $0x1,%dil
cmove  %cx,%ax
ret

LLVM IR (-O0):
define zeroext i8 @VIM_HIF_GetReg8(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i16
store volatile i16 %5, i16* inttoptr (i64 134217728 to i16*)
%6 = load i64, i64* %2
%7 = and i64 %6, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load volatile i16, i16* inttoptr (i64 134217984 to i16*)
%11 = trunc i16 %10 to i8
store i8 %11, i8* %3
br label %17
12: ; preds = %1
%13 = load volatile i16, i16* inttoptr (i64 134217984 to i16*)
%14 = zext i16 %13 to i32
%15 = ashr i32 %14, 8
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
br label %17
17: ; preds = %12, %9
%18 = load i8, i8* %3
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @VIM_HIF_GetReg8(i64 %0) {
%2 = trunc i64 %0 to i16
store volatile i16 %2, i16* inttoptr (i64 134217728 to i16*)
%3 = and i64 %0, 1
%4 = icmp eq i64 %3, 0
%5 = load volatile i16, i16* inttoptr (i64 134217984 to i16*)
%6 = lshr i16 %5, 8
%7 = select i1 %4, i16 %5, i16 %6
%8 = trunc i16 %7 to i8
ret i8 %8
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void put16_le(void *p, uint16_t x) {
  *((uint8_t *)p) = x & 0xff;
  *((uint8_t *)p + 1) = x >> 8 & 0xff;
}


x86 assembly (clang, -O0):
<put16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put16_le>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @put16_le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i32*
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %11, i32* %14
ret void
}

LLVM IR (-O2):
define void @put16_le(i8* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}
void __irq(void) { return; }


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

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

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

LLVM IR (-O2):
define void @__irq() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displayArray(int *, int);
int /*<<< orphan*/ promptArray(int *, int);
int /*<<< orphan*/ sortArray(int *, int);
int main() {
  int arr[10];
  promptArray(arr, 10);
  sortArray(arr, 10);
  displayArray(arr, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <promptArray@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <sortArray@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <displayArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <promptArray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <sortArray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <displayArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%3 = call i32 @promptArray(i32* %2, i32 10)
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @sortArray(i32* %4, i32 10)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @displayArray(i32* %6, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @promptArray(i32* %3, i32 10)
%5 = call i32 @sortArray(i32* %3, i32 10)
%6 = call i32 @displayArray(i32* %3, i32 10)
ret i32 0
}
unsigned xrop3_198_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 = ~T;
  stk2 = D & stk3;
  stk1 = S ^ stk2;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_198_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
not    %sil
movzbl %sil,%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_198_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i8 %1, -1
%6 = zext i8 %5 to i32
%7 = xor i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ keyFile(unsigned char, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void menuFile(int item) { keyFile((unsigned char)item, 0, 0); }


x86 assembly (clang, -O0):
<menuFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <keyFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuFile>:
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <keyFile@plt>

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

LLVM IR (-O2):
define void @menuFile(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @keyFile(i8 zeroext %2, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void print_uint(unsigned int n) { printf("%u", n); }


x86 assembly (clang, -O0):
<print_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uint>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define void @print_uint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
const char *arity_suffix(int n) {
  if (n == 0)
    return "st";
  if (n == 1)
    return "nd";
  return "rd";
}


x86 assembly (clang, -O0):
<arity_suffix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <arity_suffix+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <arity_suffix+0x46>
cmpl   $0x1,-0xc(%rbp)
jne    113b <arity_suffix+0x3b>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <arity_suffix+0x46>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arity_suffix>:
cmp    $0x1,%edi
lea    0xef9(%rip),%rax
lea    0xef5(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"st\00"
@.str.1 = [3 x i8] c"nd\00"
@.str.2 = [3 x i8] c"rd\00"
define i8* @arity_suffix(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"st\00"
@.str.1 = [3 x i8] c"nd\00"
@.str.2 = [3 x i8] c"rd\00"
define i8* @arity_suffix(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int fu_Exists(const char *path) {
  struct stat s;
  return stat(path, &s);
}


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

x86 assembly (clang, -O2):
<fu_Exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fu_Exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fu_Exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
ret i32 %4
}
void ble_evt_attributes_user_read_request(
    const struct ble_msg_attributes_user_read_request_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attributes_user_read_request_evt_t = type opaque
define void @ble_evt_attributes_user_read_request(%struct.ble_msg_attributes_user_read_request_evt_t* nocapture %0) {
ret void
}
float circle(float r) { return (float)3.1415926 * r * r; }


x86 assembly (clang, -O0):
<circle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle>:
movss  0xef8(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @circle(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 0x400921FB40000000, %3
%5 = load float, float* %2
%6 = fmul float %4, %5
ret float %6
}

LLVM IR (-O2):
define float @circle(float %0) {
%2 = fmul float %0, 0x400921FB40000000
%3 = fmul float %2, %0
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ sendstuff(int, int *, int);
void doShield(int conn) {
  int tmp;
  sendstuff(conn, &tmp, sizeof(int));
  tmp = 1;
  sendstuff(conn, &tmp, sizeof(int));
}


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

x86 assembly (clang, -O2):
<doShield>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <sendstuff@plt>
movl   $0x1,0x4(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <sendstuff@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @doShield(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sendstuff(i32 %0, i32* %2, i32 4)
store i32 1, i32* %2
%5 = call i32 @sendstuff(i32 %0, i32* %2, i32 4)
ret void
}
int test_imm_96int8_reg(signed char val) {
  return ((val) & (0x96 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_96int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x96,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_96int8_reg>:
test   $0x96,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_96int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 150
%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_96int8_reg(i8 signext %0) {
%2 = and i8 %0, -106
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ sleep(int);
void HandlerSigusr2() {
  signal(SIGUSR2, HandlerSigusr2);
  sleep(1);
}


x86 assembly (clang, -O0):
<HandlerSigusr2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rsi
call   1030 <signal@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandlerSigusr2>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rsi
call   1030 <signal@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@SIGUSR2 = global i32 0
define void @HandlerSigusr2() {
%1 = load i32, i32* @SIGUSR2
%2 = call i32 @signal(i32 %1, void (...)* bitcast (void ()* @HandlerSigusr2 to void (...)*))
%3 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
@SIGUSR2 = global i32 0
define void @HandlerSigusr2() {
%1 = load i32, i32* @SIGUSR2
%2 = tail call i32 @signal(i32 %1, void (...)* bitcast (void ()* @HandlerSigusr2 to void (...)*))
%3 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *mpv_error_string(int);
int /*<<< orphan*/ printf(char *, char *);
void check_error(int status) {
  if (status < 0) {
    printf("mpv API error: %s\n", mpv_error_string(status));
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1166 <check_error+0x36>
mov    -0x4(%rbp),%edi
call   1050 <mpv_error_string@plt>
mov    %rax,%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_error>:
test   %edi,%edi
js     1135 <check_error+0x5>
ret
push   %rax
call   1050 <mpv_error_string@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"mpv API error: %s\0A\00"
define void @check_error(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 %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i8* @mpv_error_string(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"mpv API error: %s\0A\00"
define void @check_error(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i8* @mpv_error_string(i32 %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t GET_TIMESTAMP(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<GET_TIMESTAMP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_TIMESTAMP>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @GET_TIMESTAMP() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @GET_TIMESTAMP() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int main(int argc, char **buffer) {
  char buf[10];
  memcpy(buf, "test", 4);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rsi
lea    0xe(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
void XkbGetNamedIndicator() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetNamedIndicator() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ S_IRWXU;
int mkdir(char *, int /*<<< orphan*/);
int _mkdir(char *path) {
  int status;
  status = mkdir(path, S_IRWXU);
  return status;
}


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

x86 assembly (clang, -O2):
<_mkdir>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@S_IRWXU = global i32 0
define i32 @_mkdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @S_IRWXU
%6 = call i32 @mkdir(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
define i32 @_mkdir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = tail call i32 @mkdir(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void bar(int i) { printf("bar %d\n", i); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

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

/* Variables and functions */
int lstat(char *, struct stat *);
int file_exists(char *filename) {
  struct stat buf;
  int st;
  st = lstat(filename, &buf);
  if (st)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <lstat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1142 <file_exists+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <file_exists+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <lstat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM1_BRK_TIM15_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @TIM1_BRK_TIM15_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int insert_mode();
int /*<<< orphan*/ lnbegin();
int insert_before(void) {
  lnbegin();
  return insert_mode();
}


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

x86 assembly (clang, -O2):
<insert_before>:
push   %rax
xor    %eax,%eax
call   1040 <lnbegin@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <insert_mode@plt>

LLVM IR (-O0):
define i32 @insert_before() {
%1 = call i32 (...) @lnbegin()
%2 = call i32 (...) @insert_mode()
ret i32 %2
}

LLVM IR (-O2):
define i32 @insert_before() {
%1 = tail call i32 (...) @lnbegin()
%2 = tail call i32 (...) @insert_mode()
ret i32 %2
}
int dwc_dq_alignment(struct ddr_set *ddr_setting, unsigned lane,
                     unsigned char *tra, unsigned char *dqs,
                     unsigned char *dqsn) {
  return 0;
}


x86 assembly (clang, -O0):
<dwc_dq_alignment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ddr_set = type opaque
define i32 @dwc_dq_alignment(%struct.ddr_set* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca %struct.ddr_set*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store %struct.ddr_set* %0, %struct.ddr_set** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret i32 0
}

LLVM IR (-O2):
%struct.ddr_set = type opaque
define i32 @dwc_dq_alignment(%struct.ddr_set* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
ret i32 0
}
/* Type definitions */
struct Logger {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int logger_destroy_null(struct Logger *logger) {
  assert(logger != NULL);
  return 0;
}


x86 assembly (clang, -O0):
<logger_destroy_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_destroy_null>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Logger = type { i32 }
define i32 @logger_destroy_null(%struct.Logger* %0) {
%2 = alloca %struct.Logger*
store %struct.Logger* %0, %struct.Logger** %2
%3 = load %struct.Logger*, %struct.Logger** %2
%4 = icmp ne %struct.Logger* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
%struct.Logger = type { i32 }
define i32 @logger_destroy_null(%struct.Logger* readnone %0) {
%2 = icmp ne %struct.Logger* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int send(int, char *, int, int /*<<< orphan*/);
int unified_sockets__send(int _sd, char *_p, int _len) {
  int ret;
  ret = send(_sd, _p, _len, 0);
  if (ret >= 0) {
    ;
  } else {
    ret = -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<unified_sockets__send>:
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
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1145 <unified_sockets__send+0x35>
jmp    114c <unified_sockets__send+0x3c>
movl   $0xffffffff,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unified_sockets__send>:
push   %rax
xor    %ecx,%ecx
call   1030 <send@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @unified_sockets__send(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp sgt i32 %4, -1
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
/* Variables and functions */
scalar_t__ flashfsGetSize();
int /*<<< orphan*/ flashfsIdentifyStartOfFreeSpace();
int /*<<< orphan*/ flashfsSeekAbs(int /*<<< orphan*/);
void flashfsInit() {
  if (flashfsGetSize() > 0) {
    flashfsSeekAbs(flashfsIdentifyStartOfFreeSpace());
  }
}


x86 assembly (clang, -O0):
<flashfsInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <flashfsGetSize@plt>
cmp    $0x0,%rax
jle    1153 <flashfsInit+0x23>
mov    $0x0,%al
call   1050 <flashfsIdentifyStartOfFreeSpace@plt>
mov    %eax,%edi
call   1030 <flashfsSeekAbs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flashfsInit>:
push   %rax
xor    %eax,%eax
call   1040 <flashfsGetSize@plt>
test   %rax,%rax
jle    114c <flashfsInit+0x1c>
xor    %eax,%eax
call   1050 <flashfsIdentifyStartOfFreeSpace@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <flashfsSeekAbs@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @flashfsInit() {
%1 = call i64 (...) @flashfsGetSize()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @flashfsIdentifyStartOfFreeSpace()
%5 = call i32 @flashfsSeekAbs(i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @flashfsInit() {
%1 = tail call i64 (...) @flashfsGetSize()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @flashfsIdentifyStartOfFreeSpace()
%5 = tail call i32 @flashfsSeekAbs(i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void i830_debug_pp_control(char *result, int len, int reg, uint32_t val,
                           uint32_t devid) {
  snprintf(result, len, "power target: %s", val & (1 << 0) ? "on" : "off");
}


x86 assembly (clang, -O0):
<i830_debug_pp_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
and    $0x1,%edx
lea    0xed7(%rip),%rcx
lea    0xecd(%rip),%rax
cmp    $0x0,%edx
cmovne %rax,%rcx
lea    0xeae(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i830_debug_pp_control>:
test   $0x1,%cl
lea    0xefa(%rip),%rax
lea    0xef0(%rip),%rcx
cmove  %rax,%rcx
lea    0xed4(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"power target: %s\00"
@.str.1 = [3 x i8] c"on\00"
@.str.2 = [4 x i8] c"off\00"
define void @i830_debug_pp_control(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%18 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"power target: %s\00"
@.str.1 = [3 x i8] c"on\00"
@.str.2 = [4 x i8] c"off\00"
define void @i830_debug_pp_control(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = and i32 %3, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}
int min(const int a, const int b) { return (a < b ? a : b); }


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ exit(int);
int open(char const *, int, int);
int /*<<< orphan*/ perror(char const *);
void replacefd(int fd, const char *filename, int flags, int mode) {
  int n;
  n = open(filename, flags, mode);
  if (n < 0) {
    perror(filename);
    exit(1);
  } else {
    dup2(n, fd);
    close(n);
  }
}


x86 assembly (clang, -O0):
<replacefd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1194 <replacefd+0x44>
mov    -0x10(%rbp),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <dup2@plt>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replacefd>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
call   1050 <open@plt>
test   %eax,%eax
js     1181 <replacefd+0x31>
mov    %eax,%ebp
mov    %eax,%edi
mov    %r14d,%esi
call   1030 <dup2@plt>
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <close@plt>
mov    %rbx,%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define void @replacefd(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @open(i8* %10, i32 %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %4
%17 = load i8*, i8** %6
%18 = call i32 @perror(i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %4
%21 = load i32, i32* %9
%22 = load i32, i32* %5
%23 = call i32 @dup2(i32 %21, i32 %22)
%24 = load i32, i32* %9
%25 = call i32 @close(i32 %24)
br label %26
26: ; preds = %20
ret void
}

LLVM IR (-O2):
define void @replacefd(i32 %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32 @open(i8* %1, i32 %2, i32 %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @perror(i8* %1)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
%11 = tail call i32 @dup2(i32 %5, i32 %0)
%12 = tail call i32 @close(i32 %5)
ret void
}
/* Variables and functions */
unsigned int pack_rgba(int, int, int, int);
unsigned int pack_rgb_alpha_0xff(int r, int g, int b) {
  return pack_rgba(r, g, b, 0xFF);
}


x86 assembly (clang, -O0):
<pack_rgb_alpha_0xff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0xff,%ecx
call   1030 <pack_rgba@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_rgb_alpha_0xff>:
mov    $0xff,%ecx
jmp    1030 <pack_rgba@plt>

LLVM IR (-O0):
define i32 @pack_rgb_alpha_0xff(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @pack_rgba(i32 %7, i32 %8, i32 %9, i32 255)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pack_rgb_alpha_0xff(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pack_rgba(i32 %0, i32 %1, i32 %2, i32 255)
ret i32 %4
}