xunge/DecIR huggingface dataset:
int min3i(int x, int y, int z) {
  return (z < y) ? ((z < x) ? z : x) : ((y < x) ? y : x);
}


x86 assembly (clang, -O0):
<min3i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1141 <min3i+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1130 <min3i+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <min3i+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <min3i+0x64>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <min3i+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115e <min3i+0x5e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min3i(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %0
%5 = select i1 %4, i32 %2, i32 %0
%6 = icmp slt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
A0RX1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*((float *)10000000)) = (p1[x1]); }


x86 assembly (clang, -O0):
<A0RX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    $0x989680,%eax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0RX1>:
movslq %esi,%rax
movss  (%rcx,%rax,4),%xmm0
movss  %xmm0,0x989680
ret

LLVM IR (-O0):
define i32 @A0RX1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %13
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %16, i64 %18
%20 = load float, float* %19
store float %20, float* inttoptr (i64 10000000 to float*)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @A0RX1(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* %5, i64 %7
%9 = load float, float* %8
store float %9, float* inttoptr (i64 10000000 to float*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ charset_remove(char *, char);
int /*<<< orphan*/ strcat(char *, char const *);
void charset_add(char buffer[], char value) {
  const char value_str[] = {value, '\0'};
  charset_remove(buffer, value);
  strcat(buffer, value_str);
}


x86 assembly (clang, -O0):
<charset_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <charset_remove@plt>
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charset_add>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %sil,0xe(%rsp)
movb   $0x0,0xf(%rsp)
call   1030 <charset_remove@plt>
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @charset_add(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca [2 x i8]
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%7 = load i8, i8* %4
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %8
%9 = load i8*, i8** %3
%10 = load i8, i8* %4
%11 = call i32 @charset_remove(i8* %9, i8 signext %10)
%12 = load i8*, i8** %3
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcat(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @charset_add(i8* %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %5
%6 = tail call i32 @charset_remove(i8* %0, i8 signext %1)
%7 = call i32 @strcat(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void thin_closelog(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @thin_closelog() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void message() { printf("Smile, and the world smiles with you...\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Smile, and the world smiles with you...\0A\00"
define void @message() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Smile, and the world smiles with you...\00"
define void @message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FFT_transform_internal(int, double *, int);
void FFT_transform(int N, double *data) { FFT_transform_internal(N, data, -1); }


x86 assembly (clang, -O0):
<FFT_transform>:
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    $0xffffffff,%edx
call   1030 <FFT_transform_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FFT_transform>:
mov    $0xffffffff,%edx
jmp    1030 <FFT_transform_internal@plt>

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

LLVM IR (-O2):
define void @FFT_transform(i32 %0, double* %1) {
%3 = tail call i32 @FFT_transform_internal(i32 %0, double* %1, i32 -1)
ret void
}
/* Variables and functions */
const char *get_next_container() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @get_next_container() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @get_next_container() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *);
int gethostname(char *name, size_t len) {
  snprintf(name, len, "localhost");
  return 0;
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"localhost\00"
define i32 @gethostname(i8* nocapture writeonly %0, i64 %1) {
%3 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int itoa_r(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int x = -248;
  char str[100];
  int pos;
  pos = itoa_r(x, str);
  str[pos] = '\0';
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffff08,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x70(%rbp),%rsi
call   1040 <itoa_r@plt>
mov    %eax,-0x74(%rbp)
movslq -0x74(%rbp),%rax
movb   $0x0,-0x70(%rbp,%rax,1)
lea    -0x70(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    $0xffffff08,%edi
mov    %rbx,%rsi
call   1040 <itoa_r@plt>
cltq
movb   $0x0,(%rsp,%rax,1)
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i8]
%4 = alloca i32
store i32 0, i32* %1
store i32 -248, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @itoa_r(i32 %5, i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %9
store i8 0, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa_r(i32 -248, i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %4
store i8 0, i8* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
char *getstr(char *id, char **cpp) { return (0); }


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

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

LLVM IR (-O0):
define i8* @getstr(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @getstr(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t AUXTDCLimitGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x0000000C))));
}


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

x86 assembly (clang, -O2):
<AUXTDCLimitGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0xc(%rax),%rax
ret

LLVM IR (-O0):
define i64 @AUXTDCLimitGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @AUXTDCLimitGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_regrdwr_usage(void) {
  printf("\nUsage : uaputl.exe regrdwr <TYPE> <OFFSET> [value]\n");
  printf("\nTYPE Options: 1     - read/write MAC register");
  printf("\n              2     - read/write BBP register");
  printf("\n              3     - read/write RF register");
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<print_regrdwr_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
lea    0xf54(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_regrdwr_usage>:
push   %rax
lea    0xf54(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
call   1050 <printf@plt>
lea    0xedf(%rip),%rdi
call   1050 <printf@plt>
lea    0xf02(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"\0AUsage : uaputl.exe regrdwr <TYPE> <OFFSET> [value]\0A\00"
@.str.1 = [47 x i8] c"\0ATYPE Options: 1 - read/write MAC register\00"
@.str.2 = [47 x i8] c"\0A 2 - read/write BBP register\00"
@.str.3 = [46 x i8] c"\0A 3 - read/write RF register\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @print_regrdwr_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [47 x i8] c"\0ATYPE Options: 1 - read/write MAC register\00"
@.str.2 = [47 x i8] c"\0A 2 - read/write BBP register\00"
@.str.3 = [46 x i8] c"\0A 3 - read/write RF register\00"
@str = [52 x i8] c"\0AUsage : uaputl.exe regrdwr <TYPE> <OFFSET> [value]\00"
define void @print_regrdwr_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ __printerr(int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
void verr(int exitcode, const char *fmt, va_list ap) {
  __printerr(1, fmt, ap);
  exit(exitcode);
}


x86 assembly (clang, -O0):
<verr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%edi
call   1030 <__printerr@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<verr>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <__printerr@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @verr(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @__printerr(i32 1, i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
define void @verr(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @__printerr(i32 1, i8* %1, i32 %2)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
int roll(ndie, nsides)
int ndie, nsides;
{
  int tot;
  tot = 0;
  while (ndie--)
    tot += random() % nsides + 1;
  return tot;
}


x86 assembly (clang, -O0):
<roll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1154 <roll+0x44>
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <roll+0x15>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1137 <roll+0x27>
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %r14d
add    %edx,%ebx
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1120 <roll+0x10>
jmp    1139 <roll+0x29>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @roll(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 (...) @random()
%9 = srem i32 %8, %1
%10 = add i32 %5, 1
%11 = add i32 %10, %9
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void globus_l_error_string_free(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<globus_l_error_string_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @globus_l_error_string_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
char Int2char(int src) {
  int temp = src;
  if (temp >= 0 && temp <= 9) {
    return temp - 0 + '0';
  }
  if (temp >= 10 && temp <= 15) {
    return temp - 10 + 'a';
  }
}


x86 assembly (clang, -O0):
<Int2char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1132 <Int2char+0x32>
cmpl   $0x9,-0xc(%rbp)
jg     1132 <Int2char+0x32>
mov    -0xc(%rbp),%eax
sub    $0x0,%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1152 <Int2char+0x52>
cmpl   $0xa,-0xc(%rbp)
jl     1152 <Int2char+0x52>
cmpl   $0xf,-0xc(%rbp)
jg     1152 <Int2char+0x52>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int2char>:
mov    %edi,%eax
cmp    $0x9,%edi
ja     110a <Int2char+0xa>
add    $0x30,%al
ret
lea    -0xa(%rax),%ecx
cmp    $0x5,%ecx
ja     1114 <Int2char+0x14>
add    $0x57,%al
ret

LLVM IR (-O0):
define signext i8 @Int2char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 9
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 0
%14 = add nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %27
16: ; preds = %8, %1
%17 = load i32, i32* %4
%18 = icmp sge i32 %17, 10
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i32, i32* %4
%21 = icmp sle i32 %20, 15
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* %4
%24 = sub nsw i32 %23, 10
%25 = add nsw i32 %24, 97
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
br label %27
27: ; preds = %11, %22, %19, %16
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @Int2char(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add nuw nsw i8 %4, 48
br label %12
6: ; preds = %1
%7 = add i32 %0, -10
%8 = icmp ult i32 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = trunc i32 %0 to i8
%11 = add nuw nsw i8 %10, 87
br label %12
12: ; preds = %6, %9, %3
%13 = phi i8 [ %5, %3 ], [ %11, %9 ], [ undef, %6 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_serial_write_rts(char const *, int const);
void drv_EA232graphic_send(const char *data, const int len) {
  drv_generic_serial_write_rts(data, len);
}


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

x86 assembly (clang, -O2):
<drv_EA232graphic_send>:
jmp    1030 <drv_generic_serial_write_rts@plt>

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

LLVM IR (-O2):
define void @drv_EA232graphic_send(i8* %0, i32 %1) {
%3 = tail call i32 @drv_generic_serial_write_rts(i8* %0, i32 %1)
ret void
}
void i(void) {
  const enum e0 { E1 };
}


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

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

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

LLVM IR (-O2):
define void @i() {
ret void
}
cpy(char a[80], char b[80]) {
  int i;
  for (i = 0; b[i] != '\0' && i < 80; i++)
    a[i] = b[i];
  a[i] = '\0';
}


x86 assembly (clang, -O0):
<cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
je     1137 <cpy+0x37>
cmpl   $0x50,-0x1c(%rbp)
setl   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1147 <cpy+0x47>
jmp    116b <cpy+0x6b>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <cpy+0x13>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy>:
mov    (%rsi),%al
test   %al,%al
je     112e <cpy+0x2e>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rdx,1)
lea    0x1(%rdx),%rcx
movzbl 0x1(%rsi,%rdx,1),%eax
test   %al,%al
je     1129 <cpy+0x29>
cmp    $0x4f,%rdx
mov    %rcx,%rdx
jb     1110 <cpy+0x10>
movb   $0x0,(%rdi,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define i32 @cpy(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %30, %2
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %7
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 80
br label %18
18: ; preds = %15, %7
%19 = phi i1 [ false, %7 ], [ %17, %15 ]
br i1 %19, label %20, label %33
20: ; preds = %18
%21 = load i8*, i8** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = load i8*, i8** %4
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
store i8 %25, i8* %29
br label %30
30: ; preds = %20
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %7
33: ; preds = %18
%34 = load i8*, i8** %4
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
store i8 0, i8* %37
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @cpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
%13 = icmp ult i64 %6, 79
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %5, label %15
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %9, %5 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i32 undef
}
main() {
  int true = 1;
#pragma omp parallel
  {
#pragma omp for
    do {
      true = 0;
    } while (true);
  }
  printf("err_for 003 : FAILED, can not compile this program.\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1126 <main+0x16>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [53 x i8] c"err_for 003 : FAILED, can not compile this program.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %4, %0
store i32 0, i32* %2
br label %4
4: ; preds = %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [52 x i8] c"err_for 003 : FAILED, can not compile this program.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
bool gen_is_snb(int devid) {
  return (devid == 0x0102 || devid == 0x0112 || devid == 0x0122 ||
          devid == 0x0106 || devid == 0x0116 || devid == 0x0126 ||
          devid == 0x010a);
}


x86 assembly (clang, -O0):
<gen_is_snb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x102,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1180 <gen_is_snb+0x80>
mov    $0x1,%al
cmpl   $0x112,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1180 <gen_is_snb+0x80>
mov    $0x1,%al
cmpl   $0x122,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1180 <gen_is_snb+0x80>
mov    $0x1,%al
cmpl   $0x106,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1180 <gen_is_snb+0x80>
mov    $0x1,%al
cmpl   $0x116,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1180 <gen_is_snb+0x80>
mov    $0x1,%al
cmpl   $0x126,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1180 <gen_is_snb+0x80>
cmpl   $0x10a,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_is_snb>:
lea    -0x102(%rdi),%ecx
rol    $0x1e,%ecx
cmp    $0xa,%ecx
jae    111d <gen_is_snb+0x1d>
mov    $0x1,%eax
mov    $0x333,%edx
bt     %ecx,%edx
jb     1128 <gen_is_snb+0x28>
xor    %eax,%eax
cmp    $0x10a,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @gen_is_snb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 258
br i1 %4, label %23, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 274
br i1 %7, label %23, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 290
br i1 %10, label %23, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 262
br i1 %13, label %23, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 278
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 294
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 266
br label %23
23: ; preds = %20, %17, %14, %11, %8, %5, %1
%24 = phi i1 [ true, %17 ], [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @gen_is_snb(i32 %0) {
%2 = add i32 %0, -258
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 30)
%4 = icmp ult i32 %3, 10
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = icmp eq i32 %0, 266
%7 = zext i1 %6 to i32
br label %13
8: ; preds = %1
%9 = trunc i32 %3 to i16
%10 = lshr i16 819, %9
%11 = and i16 %10, 1
%12 = icmp eq i16 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %8, %5
%14 = phi i32 [ %7, %5 ], [ 1, %8 ]
ret i32 %14
}
void PAGE_TimerEvent() {}


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

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

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

LLVM IR (-O2):
define void @PAGE_TimerEvent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void __cyg_profile_func_exit(void *this_fn, void *call_site) {
  printf("exit: addr=%p\n", this_fn);
  return;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"exit: addr=%p\0A\00"
define void @__cyg_profile_func_exit(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 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"exit: addr=%p\0A\00"
define void @__cyg_profile_func_exit(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "usage: %s [--socket-file=/path/to/socket] [--pid-file=/path/to"
          "/pid]\n",
          getprogname());
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xec8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [69 x i8] c"usage: %s [--socket-file=/path/to/socket] [--pid-file=/path/to/pid]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [69 x i8] c"usage: %s [--socket-file=/path/to/socket] [--pid-file=/path/to/pid]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
void gtk_tool_item_set_proxy_menu_item() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_set_proxy_menu_item() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void DisplayUsage(void) {
  {
    fprintf(stderr, "%s\n",
            "usage: projection [-v] mppfile\n"
            "\n"
            " input : mppfile - map projection parameters file\n"
            "         or gpdfile - grid parameters defintion file\n"
            "\n"
            " output: The standard name of the projection defined by mppfile "
            "or gpdfile.\n"
            "\n"
            " options:v - verbose\n"
            "\n");
    exit(EXIT_FAILURE);
  };
}


x86 assembly (clang, -O0):
<DisplayUsage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xec9(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<DisplayUsage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecc(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [236 x i8] c"usage: projection [-v] mppfile\0A\0A input : mppfile - map projection parameters file\0A or gpdfile - grid parameters defintion file\0A\0A output: The standard name of the projection defined by mppfile or gpdfile.\0A\0A options:v - verbose\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @DisplayUsage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([236 x i8], [236 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [236 x i8] c"usage: projection [-v] mppfile\0A\0A input : mppfile - map projection parameters file\0A or gpdfile - grid parameters defintion file\0A\0A output: The standard name of the projection defined by mppfile or gpdfile.\0A\0A options:v - verbose\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @DisplayUsage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([236 x i8], [236 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void write_four_chars(unsigned char *head, const unsigned char *match) {
  int i;
  for (i = 0; i < 4; i++)
    head[i] = match[i];
}


x86 assembly (clang, -O0):
<write_four_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1141 <write_four_chars+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%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    1113 <write_four_chars+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_four_chars>:
mov    (%rsi),%al
mov    %al,(%rdi)
mov    0x1(%rsi),%al
mov    %al,0x1(%rdi)
mov    0x2(%rsi),%al
mov    %al,0x2(%rdi)
mov    0x3(%rsi),%al
mov    %al,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @write_four_chars(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %1, i64 3
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strchr(char *, char);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char const *);
char *strcat(char *dst, const char *src) {
  strcpy(strchr(dst, '\0'), src);
  return dst;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <strchr@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <strchr@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(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 = call i32 @strchr(i8* %5, i8 signext 0)
%7 = load i8*, i8** %4
%8 = call i32 @strcpy(i32 %6, i8* %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strchr(i8* %0, i8 signext 0)
%4 = tail call i32 @strcpy(i32 %3, i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int code) {
  fprintf(
      stderr,
      "usage: mknews [-o] [-d output_dir] [-b output_basename] totnews.cdr\n");
  exit(code);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [69 x i8] c"usage: mknews [-o] [-d output_dir] [-b output_basename] totnews.cdr\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [69 x i8] c"usage: mknews [-o] [-d output_dir] [-b output_basename] totnews.cdr\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dup();
int /*<<< orphan*/ pull();
int /*<<< orphan*/ push();
int /*<<< orphan*/ swap();
void over() {
  push();
  dup();
  pull();
  swap();
}


x86 assembly (clang, -O0):
<over>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <push@plt>
mov    $0x0,%al
call   1040 <dup@plt>
mov    $0x0,%al
call   1030 <pull@plt>
mov    $0x0,%al
call   1060 <swap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<over>:
push   %rax
xor    %eax,%eax
call   1050 <push@plt>
xor    %eax,%eax
call   1040 <dup@plt>
xor    %eax,%eax
call   1030 <pull@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <swap@plt>

LLVM IR (-O0):
define void @over() {
%1 = call i32 (...) @push()
%2 = call i32 (...) @dup()
%3 = call i32 (...) @pull()
%4 = call i32 (...) @swap()
ret void
}

LLVM IR (-O2):
define void @over() {
%1 = tail call i32 (...) @push()
%2 = tail call i32 (...) @dup()
%3 = tail call i32 (...) @pull()
%4 = tail call i32 (...) @swap()
ret void
}
/* Variables and functions */
int tuner_i2c_write(void *, unsigned char, unsigned char, unsigned char *,
                    unsigned char);
int bbm_com_tuner_write(void *handle, unsigned char addr,
                        unsigned char addr_len, unsigned char *buffer,
                        unsigned char len) {
  int res;
  res = tuner_i2c_write(handle, addr, addr_len, buffer, len);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_tuner_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %dl,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%dl
mov    -0xa(%rbp),%al
mov    -0x18(%rbp),%rcx
movzbl %dl,%esi
movzbl %al,%edx
movzbl -0x19(%rbp),%r8d
call   1030 <tuner_i2c_write@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_tuner_write>:
jmp    1030 <tuner_i2c_write@plt>

LLVM IR (-O0):
define i32 @bbm_com_tuner_write(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4) {
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i8
%11 = alloca i32
store i8* %0, i8** %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i8 %4, i8* %10
%12 = load i8*, i8** %6
%13 = load i8, i8* %7
%14 = load i8, i8* %8
%15 = load i8*, i8** %9
%16 = load i8, i8* %10
%17 = call i32 @tuner_i2c_write(i8* %12, i8 zeroext %13, i8 zeroext %14, i8* %15, i8 zeroext %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
ret i32 %18
}

LLVM IR (-O2):
define i32 @bbm_com_tuner_write(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4) {
%6 = tail call i32 @tuner_i2c_write(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4)
ret i32 %6
}
int fn3(int a, int b, int m) {
  int tem1 = ~m & a;
  int tem2 = m & b;
  return tem1 | tem2;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
mov    %esi,%eax
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = xor i32 %9, -1
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = and i32 %13, %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = or i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef int socklen_t;

/* Variables and functions */
int getsockopt(int, int, int, int *, int *);
int getintsockopt(int sockfd, int level, int optname) {
  socklen_t len = sizeof(int);
  int option, error;
  error = getsockopt(sockfd, level, optname, &option, &len);
  if (error) {
    return error;
  }
  return option;
}


x86 assembly (clang, -O0):
<getintsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x18(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1156 <getintsockopt+0x46>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <getintsockopt+0x4c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getintsockopt>:
push   %rax
movl   $0x4,0x4(%rsp)
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
test   %eax,%eax
jne    112d <getintsockopt+0x1d>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getintsockopt(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
store i32 4, i32* %4
%7 = bitcast i32* %5 to i8*
%8 = call i32 @getsockopt(i32 %0, i32 %1, i32 %2, i32* %5, i32* %4)
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* %5
%11 = select i1 %9, i32 %10, i32 %8
ret i32 %11
}
/* Variables and functions */
bool bitmask_test(unsigned int *bitmask, int bit) {
  return bitmask[((bit) / (sizeof(unsigned int) * 8))] &
         (1 << ((bit) % (sizeof(unsigned int) * 8)));
}


x86 assembly (clang, -O0):
<bitmask_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shr    $0x5,%rcx
mov    (%rax,%rcx,4),%eax
movslq -0xc(%rbp),%rcx
and    $0x1f,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmask_test>:
movslq %esi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x5,%rcx
and    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @bitmask_test(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 = sext i32 %6 to i64
%8 = udiv i64 %7, 32
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = urem i64 %12, 32
%14 = trunc i64 %13 to i32
%15 = shl i32 1, %14
%16 = and i32 %10, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @bitmask_test(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = lshr i64 %3, 5
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 31
%8 = shl nuw i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}