xunge/DecIR huggingface dataset:
int test_imm_6Cint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x6C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Cint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7077888
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ server_type(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int main() {
  server_type(0, 0, "standalone");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
lea    0xed8(%rip),%rdx
mov    %esi,%edi
call   1030 <server_type@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"standalone\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @server_type(i32 0, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"standalone\00"
define i32 @main() {
%1 = tail call i32 @server_type(i32 0, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int isdigit(int c) { return ((c) >= '0') && ((c) <= '9'); }


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

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

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int rie_min(int a, int b) {
  if (a > b) {
    return b;
  }
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @rie_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void _set(char *str, char value, int size) {
  int ind;
  for (ind = 0; ind < size; ind++) {
    str[ind] = (int)value;
  }
}


x86 assembly (clang, -O0):
<_set>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1143 <_set+0x43>
movsbl -0x9(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <_set+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set>:
test   %edx,%edx
jle    1124 <_set+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @_set(i8* nocapture writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
int allocationInit(void *ptr) {
  (void)ptr;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @allocationInit(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Mzero(void *, size_t);
int /*<<< orphan*/ Sys_failure(char *);
void *realloc(void *, size_t);
void *Realloc(void *ptr, size_t size) {
  void *retval;
  retval = realloc(ptr, size);
  if (retval == NULL)
    Sys_failure("realloc");
  if ((ptr == NULL) && (size > 0))
    Mzero(retval, size);
  return retval;
}


x86 assembly (clang, -O0):
<Realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <Realloc+0x38>
lea    0xe9d(%rip),%rdi
call   1030 <Sys_failure@plt>
cmpq   $0x0,-0x8(%rbp)
jne    118b <Realloc+0x5b>
cmpq   $0x0,-0x10(%rbp)
jbe    118b <Realloc+0x5b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <Mzero@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Realloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r15
test   %rax,%rax
jne    1154 <Realloc+0x24>
lea    0xeb1(%rip),%rdi
call   1030 <Sys_failure@plt>
test   %rbx,%rbx
jne    1169 <Realloc+0x39>
test   %r14,%r14
je     1169 <Realloc+0x39>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <Mzero@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"realloc\00"
define i8* @Realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @Sys_failure(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %3
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i64, i64* %4
%18 = icmp ugt i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i8*, i8** %5
%21 = load i64, i64* %4
%22 = call i32 @Mzero(i8* %20, i64 %21)
br label %23
23: ; preds = %19, %16, %13
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
define i8* @Realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = icmp eq i8* %0, null
%9 = icmp ne i64 %1, 0
%10 = and i1 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = tail call i32 @Mzero(i8* %3, i64 %1)
br label %13
13: ; preds = %11, %7
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int error(char *msg) {
  perror(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void Cin_OGM_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @Cin_OGM_Shutdown() {
ret void
}
int test_imm_18int8_mem(signed char *val) {
  return ((*val) & (0x18 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_18int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 24
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ERR_get_implementation(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_get_implementation() {
ret void
}
/* Variables and functions */
char const *getenv(char *);
const char *Sys_FS_GetHomeDirectory(void) { return getenv("HOME"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
define i8* @Sys_FS_GetHomeDirectory() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
define i8* @Sys_FS_GetHomeDirectory() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
short USBSTK5505_I2C_write(int, unsigned char *, int);
short AIC3204_rset(unsigned short regnum, unsigned short regval) {
  unsigned char cmd[2];
  cmd[0] = regnum & 0x007F;
  cmd[1] = regval;
  return USBSTK5505_I2C_write(0x18, cmd, 2);
}


x86 assembly (clang, -O0):
<AIC3204_rset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x7f,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x18,%edi
mov    $0x2,%edx
call   1030 <USBSTK5505_I2C_write@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AIC3204_rset>:
push   %rax
and    $0x7f,%dil
mov    %dil,0x6(%rsp)
mov    %sil,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x18,%edi
mov    $0x2,%edx
call   1030 <USBSTK5505_I2C_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @AIC3204_rset(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca [2 x i8]
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = and i32 %7, 127
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i16, i16* %4
%12 = trunc i16 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = call signext i16 @USBSTK5505_I2C_write(i32 24, i8* %14, i32 2)
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @AIC3204_rset(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i16 %0 to i8
%6 = and i8 %5, 127
store i8 %6, i8* %4
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call signext i16 @USBSTK5505_I2C_write(i32 24, i8* %4, i32 2)
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) { puts("hello"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%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"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char get_a(void) { return 'a'; }


x86 assembly (clang, -O0):
<get_a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_a>:
mov    $0x61,%al
ret

LLVM IR (-O0):
define signext i8 @get_a() {
ret i8 97
}

LLVM IR (-O2):
define signext i8 @get_a() {
ret i8 97
}
/* Variables and functions */
int /*<<< orphan*/ send_dv();
void router_heartbeat(void) { send_dv(); }


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

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

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

LLVM IR (-O2):
define void @router_heartbeat() {
%1 = tail call i32 (...) @send_dv()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void raint3072() {
  printf("\nChanging Read Ahead Cache size for Internal sdcard to 3072kb\n");
  char buf[256];
  sprintf(buf, "/system/bin/sh -c %s",
          "'echo 3072 > /sys/block/mmcblk0/queue/read_ahead_kb'");
  system(buf);
}


x86 assembly (clang, -O0):
<raint3072>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xeea(%rip),%rsi
lea    0xef8(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raint3072>:
push   %rbx
sub    $0x100,%rsp
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"\0AChanging Read Ahead Cache size for Internal sdcard to 3072kb\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [53 x i8] c"'echo 3072 > /sys/block/mmcblk0/queue/read_ahead_kb'\00"
define void @raint3072() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [53 x i8] c"'echo 3072 > /sys/block/mmcblk0/queue/read_ahead_kb'\00"
@str = [62 x i8] c"\0AChanging Read Ahead Cache size for Internal sdcard to 3072kb\00"
define void @raint3072() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *kaa_tcp_write_pending_services_allocator_fn(void *context,
                                                  size_t buffer_size) {
  do {
    if (!(context) || !(buffer_size))
      return NULL;
  } while (0);
  char *buffer = (char *)malloc(buffer_size);
  return buffer;
}


x86 assembly (clang, -O0):
<kaa_tcp_write_pending_services_allocator_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <kaa_tcp_write_pending_services_allocator_fn+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1143 <kaa_tcp_write_pending_services_allocator_fn+0x33>
movq   $0x0,-0x8(%rbp)
jmp    115d <kaa_tcp_write_pending_services_allocator_fn+0x4d>
jmp    1148 <kaa_tcp_write_pending_services_allocator_fn+0x38>
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kaa_tcp_write_pending_services_allocator_fn>:
xor    %eax,%eax
test   %rdi,%rdi
je     1129 <kaa_tcp_write_pending_services_allocator_fn+0x19>
test   %rsi,%rsi
je     1129 <kaa_tcp_write_pending_services_allocator_fn+0x19>
push   %rax
mov    %rsi,%rdi
call   1030 <malloc@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i8* @kaa_tcp_write_pending_services_allocator_fn(i8* readnone %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i64 @malloc(i64 %1)
%8 = inttoptr i64 %7 to i8*
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %8, %6 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char *);
char *missing_field(char *p, char *errline) {
  if (!p || !*p)
    errx(1, "missing field in config file:\n%s", errline);
  return (p);
}


x86 assembly (clang, -O0):
<missing_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <missing_field+0x28>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    114d <missing_field+0x3d>
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    0xeb8(%rip),%rsi
call   1030 <errx@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<missing_field>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1121 <missing_field+0x11>
cmpb   $0x0,(%rbx)
jne    1132 <missing_field+0x22>
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"missing field in config file:\0A%s\00"
define i8* @missing_field(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7, %2
%12 = load i8*, i8** %4
%13 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %7
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [33 x i8] c"missing field in config file:\0A%s\00"
define i8* @missing_field(i8* returned %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4, %2
%8 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %9
9: ; preds = %7, %4
ret i8* %0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double rtclock() {
  struct timeval Cnv;
  gettimeofday(&Cnv, NULL);
  return (Cnv.tv_sec * 1.0e3 + Cnv.tv_usec * 1.0e-3);
}


x86 assembly (clang, -O0):
<rtclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xec1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtclock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0xed2(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xecc(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @rtclock() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fmul double %6, 1.000000e-03
%8 = call double @llvm.fmuladd.f64(double %4, double 1.000000e+03, double %7)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @rtclock() {
%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 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fmul double %7, 1.000000e-03
%9 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char *);
void usage(const char *progname) {
  printf("usage: %s [options] IN_FILE [OUT_FILE [WORD...]]\n%s", progname,
         "  IN_FILE\n"
         "        an input file for this example program\n"
         "  OUT_FILE\n"
         "        where we'll put some output\n"
         "  WORD\n"
         "        word(s) of interest\n"
         "  -h  --help\n"
         "        print this usage and exit\n"
         "  -b  --block-size <num>  (aliased: --blocksize --bs)\n"
         "        set the block size, defaults to 12.\n"
         "      --fav-number <num>\n"
         "        your favorite number\n"
         "  -q  --quiet\n"
         "        disable output\n"
         "      --name <arg>\n"
         "        your name\n");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"usage: %s [options] IN_FILE [OUT_FILE [WORD...]]\0A%s\00"
@.str.1 = [413 x i8] c" IN_FILE\0A an input file for this example program\0A OUT_FILE\0A where we'll put some output\0A WORD\0A word(s) of interest\0A -h --help\0A print this usage and exit\0A -b --block-size <num> (aliased: --blocksize --bs)\0A set the block size, defaults to 12.\0A --fav-number <num>\0A your favorite number\0A -q --quiet\0A disable output\0A --name <arg>\0A your name\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([413 x i8], [413 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"usage: %s [options] IN_FILE [OUT_FILE [WORD...]]\0A%s\00"
@.str.1 = [413 x i8] c" IN_FILE\0A an input file for this example program\0A OUT_FILE\0A where we'll put some output\0A WORD\0A word(s) of interest\0A -h --help\0A print this usage and exit\0A -b --block-size <num> (aliased: --blocksize --bs)\0A set the block size, defaults to 12.\0A --fav-number <num>\0A your favorite number\0A -q --quiet\0A disable output\0A --name <arg>\0A your name\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([413 x i8], [413 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int is_container_device(struct acpi_device *adev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.acpi_device = type opaque
define i32 @is_container_device(%struct.acpi_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *__libc_calloc(size_t nmemb, size_t _size) {
  register size_t size = _size * nmemb;
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<__libc_calloc>:
imul   %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @__libc_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = mul i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = call i8* @malloc(i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @__libc_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
ret i8* %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_standard_t_value(double *tval) {
  int fail;
  int precision = 0;
  int *b;
  fail = _ada_use_c2phc4c(867, &precision, b, tval, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_standard_t_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x363,%edi
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_standard_t_value>:
push   %rax
mov    %rdi,%rcx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x363,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @padcon_get_standard_t_value(double* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @_ada_use_c2phc4c(i32 867, i32* %2, i32* undef, double* %0, i32 0)
ret i32 %4
}
/* Variables and functions */
int xdotool_main(int, char **);
int main(int argc, char **argv) { return xdotool_main(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @xdotool_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
unsigned char *medusaReceiveDataInternal(int, int *, int, int,
                                         int /*<<< orphan*/);
unsigned char *medusaReceiveLine(int socket, int *nBufferSize) {
  return medusaReceiveDataInternal(socket, nBufferSize, 1, 20 * 1000000, 0);
}


x86 assembly (clang, -O0):
<medusaReceiveLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
mov    $0x1312d00,%ecx
xor    %r8d,%r8d
call   1030 <medusaReceiveDataInternal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaReceiveLine>:
mov    $0x1,%edx
mov    $0x1312d00,%ecx
xor    %r8d,%r8d
jmp    1030 <medusaReceiveDataInternal@plt>

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

LLVM IR (-O2):
define i8* @medusaReceiveLine(i32 %0, i32* %1) {
%3 = tail call i8* @medusaReceiveDataInternal(i32 %0, i32* %1, i32 1, i32 20000000, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void puke(char *s) {
  fprintf(stderr, "%s\n", s);
  exit(3);
}


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

x86 assembly (clang, -O2):
<puke>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @puke(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @puke(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 3)
unreachable
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmotion_type(void *_p) {
  return (int)((XEvent *)_p)->xmotion.type;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xmotion_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int check_collision(int ball_z, int player_z, int ball_s, int player_s) {
  if (ball_z == player_z || ball_z == (player_z + 1)) {
    if (ball_s == player_s || ball_s == (player_s + 1)) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_collision>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     112d <check_collision+0x2d>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    115b <check_collision+0x5b>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     114a <check_collision+0x4a>
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1156 <check_collision+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1162 <check_collision+0x62>
jmp    115b <check_collision+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_collision>:
cmp    %esi,%edi
je     110b <check_collision+0xb>
add    $0x1,%esi
cmp    %edi,%esi
jne    111b <check_collision+0x1b>
mov    $0x1,%eax
cmp    %ecx,%edx
je     111d <check_collision+0x1d>
add    $0x1,%ecx
cmp    %edx,%ecx
je     111d <check_collision+0x1d>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check_collision(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = add nsw i32 %1, 1
%7 = icmp eq i32 %6, %0
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = icmp eq i32 %2, %3
%11 = add nsw i32 %3, 1
%12 = icmp eq i32 %11, %2
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %15, label %14
14: ; preds = %9, %4
br label %15
15: ; preds = %9, %14
%16 = phi i32 [ 0, %14 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
void *alloc(unsigned short);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned short);
void *zalloc(unsigned short size) {
  void *ret = alloc(size);
  memset(ret, 0, size);
  return ret;
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1040 <alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x2(%rbp),%ax
movzwl %ax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @zalloc(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8*
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8* @alloc(i16 zeroext %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i16, i16* %2
%8 = call i32 @memset(i8* %6, i32 0, i16 zeroext %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @zalloc(i16 zeroext %0) {
%2 = tail call i8* @alloc(i16 zeroext %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i16 zeroext %0)
ret i8* %2
}
float add_float(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<add_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_float>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @add_float(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ ReadMatrixAElements();
int /*<<< orphan*/ ReadMatrixBElements();
int /*<<< orphan*/ ReadMatrixSize();
void ReadMatrix(void) {
  ReadMatrixSize();
  ReadMatrixAElements();
  ReadMatrixBElements();
  return;
}


x86 assembly (clang, -O0):
<ReadMatrix>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ReadMatrixSize@plt>
mov    $0x0,%al
call   1040 <ReadMatrixAElements@plt>
mov    $0x0,%al
call   1030 <ReadMatrixBElements@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadMatrix>:
push   %rax
xor    %eax,%eax
call   1050 <ReadMatrixSize@plt>
xor    %eax,%eax
call   1040 <ReadMatrixAElements@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ReadMatrixBElements@plt>

LLVM IR (-O0):
define void @ReadMatrix() {
%1 = call i32 (...) @ReadMatrixSize()
%2 = call i32 (...) @ReadMatrixAElements()
%3 = call i32 (...) @ReadMatrixBElements()
ret void
}

LLVM IR (-O2):
define void @ReadMatrix() {
%1 = tail call i32 (...) @ReadMatrixSize()
%2 = tail call i32 (...) @ReadMatrixAElements()
%3 = tail call i32 (...) @ReadMatrixBElements()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long, char const *,
                           unsigned long);
void dump_addr(FILE *p, const char *desc, const void *addr) {
  fprintf(p, "0x%08lx %-32s\t%lu\n", (long)addr, desc, (unsigned long)addr);
}


x86 assembly (clang, -O0):
<dump_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_addr>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
mov    %rdx,%r8
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"0x%08lx %-32s\09%lu\0A\00"
define void @dump_addr(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %6
%9 = ptrtoint i8* %8 to i64
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %9, i8* %10, i64 %12)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"0x%08lx %-32s\09%lu\0A\00"
define void @dump_addr(i32* nocapture %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %4, i8* %1, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void version(void) {
  fprintf(stderr, "ioping %s\n",
          "0.9"
          "");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"ioping %s\0A\00"
@.str.1 = [4 x i8] c"0.9\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ioping %s\0A\00"
@.str.1 = [4 x i8] c"0.9\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t read_ai(int n) { return ((n % 2) == 0) ? 0xaaaa : 0xbbbb; }


x86 assembly (clang, -O0):
<read_ai>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0xbbbb,%eax
mov    $0xaaaa,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ai>:
test   $0x1,%dil
mov    $0xaaaa,%ecx
mov    $0xbbbb,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @read_ai(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 43690, i32 48059
ret i32 %7
}

LLVM IR (-O2):
define i32 @read_ai(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 43690, i32 48059
ret i32 %4
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
unsigned long Termios2TncomSpeed(struct termios *);
int /*<<< orphan*/ tcgetattr(int, struct termios *);
unsigned long int GetPortSpeed(int PortFd) {
  struct termios PortSettings;
  tcgetattr(PortFd, &PortSettings);
  return Termios2TncomSpeed(&PortSettings);
}


x86 assembly (clang, -O0):
<GetPortSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <tcgetattr@plt>
lea    -0x8(%rbp),%rdi
call   1030 <Termios2TncomSpeed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPortSpeed>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <tcgetattr@plt>
mov    %rbx,%rdi
call   1030 <Termios2TncomSpeed@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i64 @GetPortSpeed(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.termios
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @tcgetattr(i32 %4, %struct.termios* %3)
%6 = call i64 @Termios2TncomSpeed(%struct.termios* %3)
ret i64 %6
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i64 @GetPortSpeed(i32 %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = call i32 @tcgetattr(i32 %0, %struct.termios* %2)
%5 = call i64 @Termios2TncomSpeed(%struct.termios* %2)
ret i64 %5
}
void gl_shader_set_params(unsigned width, unsigned height, unsigned tex_width,
                          unsigned tex_height, unsigned out_width,
                          unsigned out_height, unsigned frame_count,
                          const struct gl_tex_info *info,
                          const struct gl_tex_info *prev_info,
                          const struct gl_tex_info *fbo_info,
                          unsigned fbo_info_cnt) {}


x86 assembly (clang, -O0):
<gl_shader_set_params>:
push   %rbp
mov    %rsp,%rbp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.gl_tex_info = type opaque
define void @gl_shader_set_params(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, %struct.gl_tex_info* %7, %struct.gl_tex_info* %8, %struct.gl_tex_info* %9, i32 %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca %struct.gl_tex_info*
%20 = alloca %struct.gl_tex_info*
%21 = alloca %struct.gl_tex_info*
%22 = alloca i32
store i32 %0, i32* %12
store i32 %1, i32* %13
store i32 %2, i32* %14
store i32 %3, i32* %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store i32 %6, i32* %18
store %struct.gl_tex_info* %7, %struct.gl_tex_info** %19
store %struct.gl_tex_info* %8, %struct.gl_tex_info** %20
store %struct.gl_tex_info* %9, %struct.gl_tex_info** %21
store i32 %10, i32* %22
ret void
}

LLVM IR (-O2):
%struct.gl_tex_info = type opaque
define void @gl_shader_set_params(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, %struct.gl_tex_info* nocapture %7, %struct.gl_tex_info* nocapture %8, %struct.gl_tex_info* nocapture %9, i32 %10) {
ret void
}