xunge/DecIR huggingface dataset:
/* Variables and functions */
int fn2(int, int /*<<< orphan*/);
int fn3(int x) { return fn2(x, 0); }


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

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

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

LLVM IR (-O2):
define i32 @fn3(i32 %0) {
%2 = tail call i32 @fn2(i32 %0, i32 0)
ret i32 %2
}
int get_ms_clock_value() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_ms_clock_value() {
ret i32 0
}
void mhl_bist_initilize(struct device *pdev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @mhl_bist_initilize(%struct.device* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *entrustash_fopen(char const *file_name, char const *mode) {
  return fopen(file_name, mode);
}


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

x86 assembly (clang, -O2):
<entrustash_fopen>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i32* @entrustash_fopen(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 = load i8*, i8** %4
%7 = call i32* @fopen(i8* %5, i8* %6)
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @entrustash_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_queue_new() {
  printf("NOT IMPLEMENTED:"
         "pa_queue_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"NOT IMPLEMENTED:pa_queue_new\0A\00"
define i32 @pa_queue_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [29 x i8] c"NOT IMPLEMENTED:pa_queue_new\00"
define i32 @pa_queue_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int fileExists(const char *filename) {
  int status = 0;
  struct stat buf;
  if (stat(filename, &buf) == 0) {
    if (buf.st_size > 0)
      status = 1;
  }
  return (status);
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1151 <fileExists+0x41>
cmpq   $0x0,-0x18(%rbp)
jle    114c <fileExists+0x3c>
movl   $0x1,-0xc(%rbp)
jmp    1151 <fileExists+0x41>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
sete   %al
cmpq   $0x0,(%rsp)
setg   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @fileExists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = icmp sgt i64 %7, 0
%9 = select i1 %5, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int sqrt(int);
double Esx2y2(double l, double m, double n) {
  return sqrt(3) / 2 * l * l * -0.03709;
}


x86 assembly (clang, -O0):
<Esx2y2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x3,%edi
call   1030 <sqrt@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Esx2y2>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x3,%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xebb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Esx2y2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = call i32 @sqrt(i32 3)
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to double
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = load double, double* %4
%13 = fmul double %11, %12
%14 = fmul double %13, -3.709000e-02
ret double %14
}

LLVM IR (-O2):
define double @Esx2y2(double %0, double %1, double %2) {
%4 = tail call i32 @sqrt(i32 3)
%5 = sdiv i32 %4, 2
%6 = sitofp i32 %5 to double
%7 = fmul double %6, %0
%8 = fmul double %7, %0
%9 = fmul double %8, -3.709000e-02
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ string_to_hex(char *, char *);
int gui_send_data(char *tx_data_in) {
  char tx_data[1024];
  char temp[1024];
  string_to_hex(temp, tx_data_in);
  sprintf(tx_data, "hex%s", temp);
  return 0;
}


x86 assembly (clang, -O0):
<gui_send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <string_to_hex@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rdx
lea    0xeac(%rip),%rsi
call   1040 <sprintf@plt>
xor    %eax,%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_send_data>:
push   %rbx
sub    $0x800,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <string_to_hex@plt>
lea    0xec3(%rip),%rsi
lea    0x400(%rsp),%rdi
mov    %rbx,%rdx
call   1040 <sprintf@plt>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hex%s\00"
define i32 @gui_send_data(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
store i8* %0, i8** %2
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @string_to_hex(i8* %5, i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hex%s\00"
define i32 @gui_send_data(i8* %0) {
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i32 @string_to_hex(i8* %5, i8* %0)
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int basic_expand_protocol_text(char *, char const *, int);
int expand_protocol_text(char *dest, const char *src, int n) {
  return basic_expand_protocol_text(dest, src, n);
}


x86 assembly (clang, -O0):
<expand_protocol_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <basic_expand_protocol_text@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_protocol_text>:
jmp    1030 <basic_expand_protocol_text@plt>

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

LLVM IR (-O2):
define i32 @expand_protocol_text(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @basic_expand_protocol_text(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
int bits(unsigned x) {
  int i = 0;
  if (x == 0)
    return 0;
  while (x > 0) {
    i++;
    x >>= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <bits+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1150 <bits+0x50>
jmp    1129 <bits+0x29>
cmpl   $0x0,-0x8(%rbp)
jbe    114a <bits+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <bits+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bits+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bits+0x10>
ret

LLVM IR (-O0):
define i32 @bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
br label %9
9: ; preds = %12, %8
%10 = load i32, i32* %3
%11 = icmp ugt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = lshr i32 %15, 1
store i32 %16, i32* %3
br label %9
17: ; preds = %9
%18 = load i32, i32* %4
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void gpu_send_data(int v) {
  (*(volatile uint32_t *)(0x00000000 + 0x1F801810)) = v;
}


x86 assembly (clang, -O0):
<gpu_send_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1f801810,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpu_send_data>:
mov    %edi,0x1f801810
ret

LLVM IR (-O0):
define void @gpu_send_data(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 528488464 to i32*)
ret void
}

LLVM IR (-O2):
define void @gpu_send_data(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 528488464 to i32*)
ret void
}
/* Variables and functions */
int findComplement(int);
char *when7_shouldReturn0() {
  int complement = findComplement(7);
  do {
    if (!(complement == 0))
      return "error, something went wrong";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<when7_shouldReturn0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1030 <findComplement@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113f <when7_shouldReturn0+0x2f>
lea    0xeca(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <when7_shouldReturn0+0x3c>
jmp    1144 <when7_shouldReturn0+0x34>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<when7_shouldReturn0>:
push   %rax
mov    $0x7,%edi
call   1030 <findComplement@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xeda(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"error, something went wrong\00"
define i8* @when7_shouldReturn0() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 @findComplement(i32 7)
store i32 %3, i32* %2
br label %4
4: ; preds = %0
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %4
br label %9
9: ; preds = %8
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"error, something went wrong\00"
define i8* @when7_shouldReturn0() {
%1 = tail call i32 @findComplement(i32 7)
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
int hostapd_prepare_rates(struct hostapd_data *hapd,
                          struct hostapd_hw_modes *mode) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.hostapd_data = type opaque
%struct.hostapd_hw_modes = type opaque
define i32 @hostapd_prepare_rates(%struct.hostapd_data* %0, %struct.hostapd_hw_modes* %1) {
%3 = alloca %struct.hostapd_data*
%4 = alloca %struct.hostapd_hw_modes*
store %struct.hostapd_data* %0, %struct.hostapd_data** %3
store %struct.hostapd_hw_modes* %1, %struct.hostapd_hw_modes** %4
ret i32 0
}

LLVM IR (-O2):
%struct.hostapd_data = type opaque
%struct.hostapd_hw_modes = type opaque
define i32 @hostapd_prepare_rates(%struct.hostapd_data* nocapture readnone %0, %struct.hostapd_hw_modes* nocapture readnone %1) {
ret i32 0
}
void urt_sys_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @urt_sys_exit() {
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
void walltm_(double *ai) {
  struct timeval tp;
  struct timezone tzp;
  (void)gettimeofday(&tp, &tzp);
  *ai = (double)tp.tv_sec + ((double)tp.tv_usec) * 1.0e-6;
}


x86 assembly (clang, -O0):
<walltm_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x10(%rbp),%xmm1
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xec3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<walltm_>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x18(%rsp),%xmm0
cvtsi2sdq 0x10(%rsp),%xmm1
mulsd  0xec3(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define void @walltm_(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
%4 = alloca %struct.timezone
store double* %0, double** %2
%5 = call i32 @gettimeofday(%struct.timeval* %3, %struct.timezone* %4)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
%13 = load double*, double** %2
store double %12, double* %13
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define void @walltm_(double* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = alloca %struct.timezone
%4 = bitcast %struct.timeval* %2 to i8*
%5 = bitcast %struct.timezone* %3 to i8*
%6 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %3)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %9)
store double %13, double* %0
ret void
}
/* Variables and functions */
char *swap_char(char *str, char replace, char with) {
  char *ptr = (char *)NULL;
  for (ptr = str; *ptr != '\0'; ptr++) {
    if (*ptr == replace) {
      *ptr = with;
    }
  }
  return str;
}


x86 assembly (clang, -O0):
<swap_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <swap_char+0x65>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114f <swap_char+0x4f>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1154 <swap_char+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1123 <swap_char+0x23>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_char>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <swap_char+0x25>
lea    0x1(%rax),%rdi
jmp    111b <swap_char+0x1b>
nop
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1125 <swap_char+0x25>
cmp    %sil,%cl
jne    1110 <swap_char+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <swap_char+0x10>
ret

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

LLVM IR (-O2):
define i8* @swap_char(i8* returned %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ eof_va_write(int, int, int, char *);
int eof_ui_quit(int sockfd) {
  if (!eof_va_write(sockfd, 1, 4, "2199")) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<eof_ui_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
mov    $0x4,%edx
lea    0xed1(%rip),%rcx
call   1030 <eof_va_write@plt>
cmp    $0x0,%eax
jne    1149 <eof_ui_quit+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1150 <eof_ui_quit+0x40>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eof_ui_quit>:
push   %rax
lea    0xee8(%rip),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <eof_va_write@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"2199\00"
define i32 @eof_ui_quit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @eof_va_write(i32 %4, i32 1, i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"2199\00"
define i32 @eof_ui_quit(i32 %0) {
%2 = tail call i32 @eof_va_write(i32 %0, i32 1, i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct carray {
  int dummy;
};

/* Variables and functions */
struct carray *_carray_map(struct carray *, int (*)(void *, void *), void *,
                           int);
struct carray *carray_collect(struct carray *a, int (*match_fn)(void *, void *),
                              void *arg) {
  return _carray_map(a, match_fn, arg, 1);
}


x86 assembly (clang, -O0):
<carray_collect>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <_carray_map@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carray_collect>:
mov    $0x1,%ecx
jmp    1030 <_carray_map@plt>

LLVM IR (-O0):
%struct.carray = type { i32 }
define %struct.carray* @carray_collect(%struct.carray* %0, i32 (i8*, i8*)* %1, i8* %2) {
%4 = alloca %struct.carray*
%5 = alloca i32 (i8*, i8*)*
%6 = alloca i8*
store %struct.carray* %0, %struct.carray** %4
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %5
store i8* %2, i8** %6
%7 = load %struct.carray*, %struct.carray** %4
%8 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %5
%9 = load i8*, i8** %6
%10 = call %struct.carray* @_carray_map(%struct.carray* %7, i32 (i8*, i8*)* %8, i8* %9, i32 1)
ret %struct.carray* %10
}

LLVM IR (-O2):
%struct.carray = type { i32 }
define %struct.carray* @carray_collect(%struct.carray* %0, i32 (i8*, i8*)* %1, i8* %2) {
%4 = tail call %struct.carray* @_carray_map(%struct.carray* %0, i32 (i8*, i8*)* %1, i8* %2, i32 1)
ret %struct.carray* %4
}
/* Variables and functions */
int /*<<< orphan*/ set_size(int);
void size1(void) { set_size(1); }


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

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

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

LLVM IR (-O2):
define void @size1() {
%1 = tail call i32 @set_size(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait(int *);
void my_wait(int signum) {
  int status;
  wait(&status);
}


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

x86 assembly (clang, -O2):
<my_wait>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <wait@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @my_wait(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
ret void
}
int comb(int n, int k) {
  if (k == 0 || k == n)
    return 1;
  return comb(n - 1, k - 1) + comb(n - 1, k);
}


x86 assembly (clang, -O0):
<comb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1134 <comb+0x24>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <comb+0x30>
movl   $0x1,-0x4(%rbp)
jmp    116c <comb+0x5c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <comb@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1030 <comb@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comb>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebp
test   %esi,%esi
je     1162 <comb+0x52>
mov    %esi,%r14d
mov    %edi,%ebx
cmp    %edi,%esi
je     1162 <comb+0x52>
lea    -0x1(%r14),%r15d
neg    %r14d
add    $0xffffffff,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r15d,%esi
call   1030 <comb@plt>
add    %eax,%ebp
lea    (%r14,%rbx,1),%eax
add    $0xffffffff,%eax
mov    %ebx,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%ebx
cmp    $0xffffffff,%eax
jne    1140 <comb+0x30>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @comb(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = icmp eq i32 %1, %0
%5 = or i1 %3, %4
br i1 %5, label %17, label %6
6: ; preds = %2
%7 = add nsw i32 %1, -1
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %0, %6 ], [ %11, %8 ]
%10 = phi i32 [ 0, %6 ], [ %13, %8 ]
%11 = add nsw i32 %9, -1
%12 = tail call i32 @comb(i32 %11, i32 %7)
%13 = add nsw i32 %12, %10
%14 = icmp eq i32 %11, %1
br i1 %14, label %15, label %8
15: ; preds = %8
%16 = add i32 %13, 1
br label %17
17: ; preds = %15, %2
%18 = phi i32 [ 1, %2 ], [ %16, %15 ]
ret i32 %18
}
void gdk_drag_find_window() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drag_find_window() {
ret void
}
char *PlatformGetOutputPointer() { return (char *)0xE5200000; }


x86 assembly (clang, -O0):
<PlatformGetOutputPointer>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe5200000,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @PlatformGetOutputPointer() {
ret i8* inttoptr (i64 3844079616 to i8*)
}

LLVM IR (-O2):
define i8* @PlatformGetOutputPointer() {
ret i8* inttoptr (i64 3844079616 to i8*)
}
/* Variables and functions */
int __CCAPRICE_MATH_HI_L(double);
int finite(double x) {
  return (unsigned)((__CCAPRICE_MATH_HI_L(x) & 0x7FFFFFFF) - 0x7FFFFFFF) >> 31;
}


x86 assembly (clang, -O0):
<finite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__CCAPRICE_MATH_HI_L@plt>
and    $0x7fffffff,%eax
sub    $0x7fffffff,%eax
shr    $0x1f,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finite>:
push   %rax
call   1030 <__CCAPRICE_MATH_HI_L@plt>
and    $0x7fffffff,%eax
add    $0x80000001,%eax
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @finite(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @__CCAPRICE_MATH_HI_L(double %3)
%5 = and i32 %4, 2147483647
%6 = sub nsw i32 %5, 2147483647
%7 = lshr i32 %6, 31
ret i32 %7
}

LLVM IR (-O2):
define i32 @finite(double %0) {
%2 = tail call i32 @__CCAPRICE_MATH_HI_L(double %0)
%3 = and i32 %2, 2147483647
%4 = add nsw i32 %3, -2147483647
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void handler(int c) {
  printf("UNKNOWN\nUNKNOWN\n\nTimeout on connect.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"UNKNOWN\0AUNKNOWN\0A\0ATimeout on connect.\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [37 x i8] c"UNKNOWN\0AUNKNOWN\0A\0ATimeout on connect.\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int go(char *feature) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @go(i8* nocapture readnone %0) {
ret i32 2
}
int ReadADC(int Chan) {
  int ChannelMask = 1 << Chan;
  (*((volatile unsigned int *)(0x4001c000 + 0x000))) |= ChannelMask + (1 << 24);
  while (((*((volatile unsigned int *)(0x4001c000 + 0x004))) & (1 << 31)) == 0)
    ;
  return (((*((volatile unsigned int *)(0x4001c000 + 0x004))) >> 6) & 0x3ff);
}


x86 assembly (clang, -O0):
<ReadADC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1000000,%eax
mov    $0x4001c000,%ecx
mov    (%rcx),%ecx
or     %eax,%ecx
mov    $0x4001c000,%eax
mov    %ecx,(%rax)
mov    $0x4001c004,%eax
mov    (%rax),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
jne    1146 <ReadADC+0x46>
jmp    112c <ReadADC+0x2c>
mov    $0x4001c004,%eax
mov    (%rax),%eax
shr    $0x6,%eax
and    $0x3ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadADC>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x1000000,%eax
or     %eax,0x4001c000
cs nopw 0x0(%rax,%rax,1)
nop
cmpl   $0x0,0x4001c004
jns    1120 <ReadADC+0x20>
mov    0x4001c004,%eax
shr    $0x6,%eax
and    $0x3ff,%eax
ret

LLVM IR (-O0):
define i32 @ReadADC(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 1, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 16777216
%8 = load volatile i32, i32* inttoptr (i64 1073856512 to i32*)
%9 = or i32 %8, %7
store volatile i32 %9, i32* inttoptr (i64 1073856512 to i32*)
br label %10
10: ; preds = %14, %1
%11 = load volatile i32, i32* inttoptr (i64 1073856516 to i32*)
%12 = and i32 %11, -2147483648
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
%16 = load volatile i32, i32* inttoptr (i64 1073856516 to i32*)
%17 = lshr i32 %16, 6
%18 = and i32 %17, 1023
ret i32 %18
}

LLVM IR (-O2):
define i32 @ReadADC(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = add nuw nsw i32 %2, 16777216
%4 = load volatile i32, i32* inttoptr (i64 1073856512 to i32*)
%5 = or i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 1073856512 to i32*)
br label %6
6: ; preds = %6, %1
%7 = load volatile i32, i32* inttoptr (i64 1073856516 to i32*)
%8 = icmp sgt i32 %7, -1
br i1 %8, label %6, label %9
9: ; preds = %6
%10 = load volatile i32, i32* inttoptr (i64 1073856516 to i32*)
%11 = lshr i32 %10, 6
%12 = and i32 %11, 1023
ret i32 %12
}
int test_imm_65uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x65 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_65uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 433791696896
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SYS_exit;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int);
void x__exit(int code) { syscall((SYS_exit), code); }


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

x86 assembly (clang, -O2):
<x__exit>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_exit = global i32 0
define void @x__exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_exit
%4 = load i32, i32* %2
%5 = call i32 @syscall(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SYS_exit = global i32 0
define void @x__exit(i32 %0) {
%2 = load i32, i32* @SYS_exit
%3 = tail call i32 @syscall(i32 %2, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
unsigned int UCHAR_MAX;
int /*<<< orphan*/ time(int /*<<< orphan*/);
unsigned jsw_time_seed() {
  time_t now = time(0);
  unsigned char *p = (unsigned char *)&now;
  unsigned seed = 0;
  size_t i;
  for (i = 0; i < sizeof now; i++)
    seed = seed * (UCHAR_MAX + 2U) + p[i];
  return seed;
}


x86 assembly (clang, -O0):
<jsw_time_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x4,-0x20(%rbp)
jae    1178 <jsw_time_seed+0x68>
mov    -0x14(%rbp),%eax
mov    0x2ea2(%rip),%rcx
mov    (%rcx),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1139 <jsw_time_seed+0x29>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsw_time_seed>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ecx
movzbl %al,%edx
movzbl %ah,%esi
shr    $0x10,%eax
shr    $0x18,%ecx
mov    0x2ec3(%rip),%rdi
mov    (%rdi),%edi
add    $0x2,%edi
imul   %edi,%edx
add    %edx,%esi
imul   %edi,%esi
movzbl %al,%eax
add    %esi,%eax
imul   %edi,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@UCHAR_MAX = global i32 0
define i32 @jsw_time_seed() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = call i32 @time(i32 0)
store i32 %5, i32* %1
%6 = bitcast i32* %1 to i8*
store i8* %6, i8** %2
store i32 0, i32* %3
store i64 0, i64* %4
br label %7
7: ; preds = %21, %0
%8 = load i64, i64* %4
%9 = icmp ult i64 %8, 4
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* @UCHAR_MAX
%13 = add i32 %12, 2
%14 = mul i32 %11, %13
%15 = load i8*, i8** %2
%16 = load i64, i64* %4
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = add i32 %14, %19
store i32 %20, i32* %3
br label %21
21: ; preds = %10
%22 = load i64, i64* %4
%23 = add i64 %22, 1
store i64 %23, i64* %4
br label %7
24: ; preds = %7
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@UCHAR_MAX = global i32 0
define i32 @jsw_time_seed() {
%1 = tail call i32 @time(i32 0)
%2 = lshr i32 %1, 8
%3 = lshr i32 %1, 16
%4 = lshr i32 %1, 24
%5 = load i32, i32* @UCHAR_MAX
%6 = add i32 %5, 2
%7 = and i32 %1, 255
%8 = mul i32 %6, %7
%9 = and i32 %2, 255
%10 = add i32 %8, %9
%11 = mul i32 %6, %10
%12 = and i32 %3, 255
%13 = add i32 %11, %12
%14 = mul i32 %6, %13
%15 = add i32 %14, %4
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int read_number(int /*<<< orphan*/ *, int);
int testlib_read_integer(FILE *__stream) {
  return read_number(__stream, 32767);
}


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

x86 assembly (clang, -O2):
<testlib_read_integer>:
mov    $0x7fff,%esi
jmp    1030 <read_number@plt>

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

LLVM IR (-O2):
define i32 @testlib_read_integer(i32* %0) {
%2 = tail call i32 @read_number(i32* %0, i32 32767)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char *, int /*<<< orphan*/ *);
int main(void) {
  execl("/bin/ls", "ls", "-al", "/etc/passwd", NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xed4(%rip),%rdx
lea    0xed1(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <execl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xee2(%rip),%rdx
lea    0xedf(%rip),%rcx
xor    %r8d,%r8d
call   1030 <execl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [4 x i8] c"-al\00"
@.str.3 = [12 x i8] c"/etc/passwd\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), 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), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [4 x i8] c"-al\00"
@.str.3 = [12 x i8] c"/etc/passwd\00"
define i32 @main() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), 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), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* null)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timespec {
  unsigned long tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int CHAR_BIT;
scalar_t__ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int main(void) {
  struct timespec ts;
  ts.tv_sec = ((1UL << (CHAR_BIT * sizeof(time_t) - 1UL)) - 1UL);
  ts.tv_nsec = 0;
  for (;;) {
    if (nanosleep(&ts, NULL))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
movslq (%rax),%rcx
shl    $0x2,%rcx
sub    $0x1,%rcx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
je     116b <main+0x5b>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    1149 <main+0x39>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ec4(%rip),%rax
mov    (%rax),%cl
shl    $0x2,%cl
add    $0xff,%cl
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %rax
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
test   %rax,%rax
je     1150 <main+0x40>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = load i32, i32* @CHAR_BIT
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 4
%6 = sub i64 %5, 1
%7 = shl i64 1, %6
%8 = sub i64 %7, 1
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %8, i64* %9
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 0, i64* %10
br label %11
11: ; preds = %15, %0
%12 = call i64 @nanosleep(%struct.timespec* %2, i32* null)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
ret i32 1
15: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CHAR_BIT
%4 = sext i32 %3 to i64
%5 = shl nsw i64 %4, 2
%6 = add nsw i64 %5, -1
%7 = shl nsw i64 -1, %6
%8 = xor i64 %7, -1
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i64 %8, i64* %9
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 0, i64* %10
br label %11
11: ; preds = %11, %0
%12 = call i64 @nanosleep(%struct.timespec* %1, i32* null)
%13 = icmp eq i64 %12, 0
br i1 %13, label %11, label %14
14: ; preds = %11
ret i32 1
}
unsigned char G2Bits(start, place)
unsigned char *start;
int place;
{
  unsigned char value;
  value = (start[place / 2] >> 4 * (place % 2)) & 0x0f;

  return (value);
}


x86 assembly (clang, -O0):
<G2Bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
mov    %edx,%ecx
shl    $0x2,%ecx
sar    %cl,%eax
and    $0xf,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<G2Bits>:
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
mov    %ecx,%eax
sar    %eax
cltq
movzbl (%rdi,%rax,1),%eax
and    $0x3e,%ecx
sub    %ecx,%esi
lea    0x0(,%rsi,4),%ecx
shr    %cl,%eax
and    $0xf,%al
ret

LLVM IR (-O0):
define zeroext i8 @G2Bits(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i32, i32* %4
%14 = srem i32 %13, 2
%15 = mul nsw i32 4, %14
%16 = ashr i32 %12, %15
%17 = and i32 %16, 15
%18 = trunc i32 %17 to i8
store i8 %18, i8* %5
%19 = load i8, i8* %5
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @G2Bits(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = srem i32 %1, 2
%9 = shl nsw i32 %8, 2
%10 = lshr i32 %7, %9
%11 = trunc i32 %10 to i8
%12 = and i8 %11, 15
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void printString(const char *str, size_t count) {
  for (; count; count--, str++)
    printf("%c", *str);
}


x86 assembly (clang, -O0):
<printString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <printString+0x4b>
mov    -0x8(%rbp),%rax
lea    0xeca(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <printString+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printString>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1146 <printString+0x36>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printString(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = add i64 %5, -1
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = icmp eq i64 %9, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Hello,world"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello,world\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello,world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}