xunge/DecIR huggingface dataset:
void fdmi_dtype_op_MAX_int(void *a, void *b) {
  (*(int *)a = (((*(int *)a) > (*(int *)b)) ? *(int *)a : *(int *)b));
}


x86 assembly (clang, -O0):
<fdmi_dtype_op_MAX_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    112c <fdmi_dtype_op_MAX_int+0x2c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <fdmi_dtype_op_MAX_int+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdmi_dtype_op_MAX_int>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
cmovg  %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @fdmi_dtype_op_MAX_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
br label %20
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to i32*
%19 = load i32, i32* %18
br label %20
20: ; preds = %16, %12
%21 = phi i32 [ %15, %12 ], [ %19, %16 ]
%22 = load i8*, i8** %3
%23 = bitcast i8* %22 to i32*
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @fdmi_dtype_op_MAX_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = select i1 %7, i32 %4, i32 %6
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
const char *metisAbout_ShortNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\n";
}


x86 assembly (clang, -O0):
<metisAbout_ShortNotice>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<metisAbout_ShortNotice>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @metisAbout_ShortNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @metisAbout_ShortNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
void zputhex(int c, char *pos) {
  static char digits[] = "0123456789abcdef";
  pos[0] = digits[(c & 0xF0) >> 4];
  pos[1] = digits[c & 0x0F];
}


x86 assembly (clang, -O0):
<zputhex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0x2f10(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2ef7(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<zputhex>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0xef1(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,(%rsi)
and    $0xf,%edi
mov    (%rdi,%rcx,1),%al
mov    %al,0x1(%rsi)
ret

LLVM IR (-O0):
@zputhex.digits = internal global [17 x i8] c"0123456789abcdef\00"
define void @zputhex(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 240
%7 = ashr i32 %6, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %3
%14 = and i32 %13, 15
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
ret void
}

LLVM IR (-O2):
@zputhex.digits = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define void @zputhex(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %5
%7 = load i8, i8* %6
store i8 %7, i8* %1
%8 = and i32 %0, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int fsync(int);
int hal_flush(int fd) { return fsync(1); }


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

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

LLVM IR (-O0):
define i32 @hal_flush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @fsync(i32 1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @hal_flush(i32 %0) {
%2 = tail call i32 @fsync(i32 1)
ret i32 %2
}
int test_imm_D2uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xD2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D2uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 210
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned int CPUIntStatus();
unsigned int IntMasterStatusGet(void) { return CPUIntStatus(); }


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

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

LLVM IR (-O0):
define i32 @IntMasterStatusGet() {
%1 = call i32 (...) @CPUIntStatus()
ret i32 %1
}

LLVM IR (-O2):
define i32 @IntMasterStatusGet() {
%1 = tail call i32 (...) @CPUIntStatus()
ret i32 %1
}
void wpas_ctrl_radio_work_flush(struct wpa_supplicant *wpa_s) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_ctrl_radio_work_flush(%struct.wpa_supplicant* nocapture %0) {
ret void
}
int test_imm_16uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x16 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_16uint64_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, 22
%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_16uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 94489280512
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned short hash_sip(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned short);
int main() {
  unsigned int ip = 0xf00f77cc;
  unsigned short ht = 1;
  ht = hash_sip(ip);
  printf("ip=%#-8x,ht=%#x\r\n", ip, ht);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf00f77cc,-0x8(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <hash_sip@plt>
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
movzwl -0xa(%rbp),%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf00f77cc,%edi
call   1030 <hash_sip@plt>
movzwl %ax,%edx
lea    0xecb(%rip),%rdi
mov    $0xf00f77cc,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"ip=%#-8x,ht=%#x\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
store i32 0, i32* %1
store i32 -267421748, i32* %2
store i16 1, i16* %3
%4 = load i32, i32* %2
%5 = call zeroext i16 @hash_sip(i32 %4)
store i16 %5, i16* %3
%6 = load i32, i32* %2
%7 = load i16, i16* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6, i16 zeroext %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"ip=%#-8x,ht=%#x\0D\0A\00"
define i32 @main() {
%1 = tail call zeroext i16 @hash_sip(i32 -267421748)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 -267421748, i16 zeroext %1)
ret i32 0
}
int test_imm_6Eint8_mem(signed char *val) {
  return ((*val) & (-0x6E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -110
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strncmp(char *, char *, int);
int is_uri_file_scheme(char *p) {
  if (!strncmp(p, "file:", 5))
    return 5;
  return 0;
}


x86 assembly (clang, -O0):
<is_uri_file_scheme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1146 <is_uri_file_scheme+0x36>
movl   $0x5,-0x4(%rbp)
jmp    114d <is_uri_file_scheme+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_uri_file_scheme>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,4),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"file:\00"
define i32 @is_uri_file_scheme(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 5, i32 0
ret i32 %4
}
void gtk_dialog_set_has_separator() {}


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

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

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

LLVM IR (-O2):
define void @gtk_dialog_set_has_separator() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_diagram(char *, int **);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char sentence[50];
  int letters[26][2];
  scanf("%[^\n]s", sentence);
  create_letter_distribution_diagram(sentence, letters);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x110,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0x40(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [26 x [2 x i32]]
store i32 0, i32* %1
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [26 x [2 x i32]], [26 x [2 x i32]]* %3, i64 0, i64 0
%8 = bitcast [2 x i32]* %7 to i32**
%9 = call i32 @create_letter_distribution_diagram(i8* %6, i32** %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [26 x [2 x i32]]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = bitcast [26 x [2 x i32]]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = bitcast [26 x [2 x i32]]* %2 to i32**
%7 = call i32 @create_letter_distribution_diagram(i8* %3, i32** %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
main() {
  int i = 0;
  int j = 0;
  for (i = 0; i < 100; i++)
    j = i;
  puts("hello world");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1152 <main+0x42>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
store i32 %8, i32* %3
br label %9
9: ; preds = %7
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void testComparisons(int a) {
  int b = a;
  if (!(b == a))
    ((void)*(char *)0);
  if (!(b >= a))
    ((void)*(char *)0);
  if (!(b <= a))
    ((void)*(char *)0);
  if (b != a)
    ((void)*(char *)0);
  if (b > a)
    ((void)*(char *)0);
  if (b < a)
    ((void)*(char *)0);
}


x86 assembly (clang, -O0):
<testComparisons>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1119 <testComparisons+0x19>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1125 <testComparisons+0x25>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1131 <testComparisons+0x31>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     113d <testComparisons+0x3d>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1149 <testComparisons+0x49>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1155 <testComparisons+0x55>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testComparisons(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8, i8* null
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp sge i32 %11, %12
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = load i8, i8* null
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = icmp sle i32 %17, %18
br i1 %19, label %22, label %20
20: ; preds = %16
%21 = load i8, i8* null
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = icmp ne i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = load i8, i8* null
br label %28
28: ; preds = %26, %22
%29 = load i32, i32* %3
%30 = load i32, i32* %2
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = load i8, i8* null
br label %34
34: ; preds = %32, %28
%35 = load i32, i32* %3
%36 = load i32, i32* %2
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = load i8, i8* null
br label %40
40: ; preds = %38, %34
ret void
}

LLVM IR (-O2):
define void @testComparisons(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
void do_init(void) { setenv("RTPE_PRELOAD_TEST_ACTIVE", "1", 1); }


x86 assembly (clang, -O0):
<do_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef7(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_init>:
lea    0xee9(%rip),%rdi
lea    0xefb(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <setenv@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"RTPE_PRELOAD_TEST_ACTIVE\00"
@.str.1 = [2 x i8] c"1\00"
define void @do_init() {
%1 = call i32 @setenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"RTPE_PRELOAD_TEST_ACTIVE\00"
@.str.1 = [2 x i8] c"1\00"
define void @do_init() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void debugp_cleanup(void) {
  closelog();
  return;
}


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

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

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

LLVM IR (-O2):
define void @debugp_cleanup() {
%1 = tail call i32 (...) @closelog()
ret void
}
void swap(int *pData1, int *pData2) {
  *pData1 ^= *pData2;
  *pData2 ^= *pData1;
  *pData1 ^= *pData2;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t num, size_t size) {
  register void *p;
  size *= num;
  p = malloc(size);
  if (p)
    memset(p, 0, size);
  return (p);
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <calloc+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ gc_init();
void c_runtime_init() { gc_init(); }


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

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

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

LLVM IR (-O2):
define void @c_runtime_init() {
%1 = tail call i32 (...) @gc_init()
ret void
}
void g_file_test() {}


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

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

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

LLVM IR (-O2):
define void @g_file_test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec_bt(int, int, int);
void test_bt(void) {
  int i;
  for (i = 0; i < 32; i++)
    exec_bt(0x21ad3d34, 0x12345678, i);
  for (i = 0; i < 32; i++)
    exec_bt(0x813f3421, 0x82345678, i);
}


x86 assembly (clang, -O0):
<test_bt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1149 <test_bt+0x39>
mov    -0x4(%rbp),%edx
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
call   1030 <exec_bt@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_bt+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    117a <test_bt+0x6a>
mov    -0x4(%rbp),%edx
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
call   1030 <exec_bt@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <test_bt+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bt>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
mov    %ebx,%edx
call   1030 <exec_bt@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <test_bt+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
mov    %ebx,%edx
call   1030 <exec_bt@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <test_bt+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_bt() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @exec_bt(i32 565001524, i32 305419896, i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 0, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @exec_bt(i32 -2126564319, i32 -2110499208, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @test_bt() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @exec_bt(i32 565001524, i32 305419896, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @exec_bt(i32 -2126564319, i32 -2110499208, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
unsigned int nextPow2_32(unsigned int x) {
  x--;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  x++;
  return x;
}


x86 assembly (clang, -O0):
<nextPow2_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextPow2_32>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nextPow2_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @nextPow2_32(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
void B_init_optional_attributes(struct B *_B) {}


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

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

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

LLVM IR (-O2):
%struct.B = type opaque
define void @B_init_optional_attributes(%struct.B* nocapture %0) {
ret void
}
void ECRYPT_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ECRYPT_init() {
ret void
}
/* Variables and functions */
double parse_expression(char const *);
int /*<<< orphan*/ printf(char *, char const *, double);
void parser_test(const char *expr) {
  double val = parse_expression(expr);
  printf("%s=%f\n", expr, val);
}


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

x86 assembly (clang, -O2):
<parser_test>:
push   %rbx
mov    %rdi,%rbx
call   1040 <parse_expression@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s=%f\0A\00"
define void @parser_test(i8* %0) {
%2 = tail call double @parse_expression(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, double %2)
ret void
}
__attribute__((constructor)) void hardware_rand64_init(void) {}


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @hardware_rand64_init, i8* null }]
define void @hardware_rand64_init() {
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @hardware_rand64_init() {
ret void
}
int CONFIG_WriteString(const char *FileName, const char *ConfName,
                       const char *Value) {
  return 42;
}


x86 assembly (clang, -O0):
<CONFIG_WriteString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @CONFIG_WriteString(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 42
}

LLVM IR (-O2):
define i32 @CONFIG_WriteString(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 42
}
/* Type definitions */
struct lwan_strbuf {
  int dummy;
};

/* Variables and functions */
char *int_to_string(int, char *, size_t *);
int /*<<< orphan*/ lwan_strbuf_append_str(struct lwan_strbuf *, char *, size_t);
void lwan_append_int_to_strbuf(struct lwan_strbuf *buf, void *ptr) {
  char convertbuf[(3 * sizeof(size_t))];
  size_t len;
  char *converted;
  converted = int_to_string(*(int *)ptr, convertbuf, &len);
  lwan_strbuf_append_str(buf, converted, len);
}


x86 assembly (clang, -O0):
<lwan_append_int_to_strbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1040 <int_to_string@plt>
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1030 <lwan_strbuf_append_str@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwan_append_int_to_strbuf>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
mov    (%rsi),%edi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <int_to_string@plt>
mov    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <lwan_strbuf_append_str@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.lwan_strbuf = type { i32 }
define void @lwan_append_int_to_strbuf(%struct.lwan_strbuf* %0, i8* %1) {
%3 = alloca %struct.lwan_strbuf*
%4 = alloca i8*
%5 = alloca [24 x i8]
%6 = alloca i64
%7 = alloca i8*
store %struct.lwan_strbuf* %0, %struct.lwan_strbuf** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 0
%12 = call i8* @int_to_string(i32 %10, i8* %11, i64* %6)
store i8* %12, i8** %7
%13 = load %struct.lwan_strbuf*, %struct.lwan_strbuf** %3
%14 = load i8*, i8** %7
%15 = load i64, i64* %6
%16 = call i32 @lwan_strbuf_append_str(%struct.lwan_strbuf* %13, i8* %14, i64 %15)
ret void
}

LLVM IR (-O2):
%struct.lwan_strbuf = type { i32 }
define void @lwan_append_int_to_strbuf(%struct.lwan_strbuf* %0, i8* nocapture %1) {
%3 = alloca [24 x i8]
%4 = alloca i64
%5 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%6 = bitcast i64* %4 to i8*
%7 = bitcast i8* %1 to i32*
%8 = load i32, i32* %7
%9 = call i8* @int_to_string(i32 %8, i8* %5, i64* %4)
%10 = load i64, i64* %4
%11 = call i32 @lwan_strbuf_append_str(%struct.lwan_strbuf* %0, i8* %9, i64 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ T2DLP_errormsg();
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int T2DLP_off(long alpid) {
  T2DLP_errormsg();
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<T2DLP_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <T2DLP_errormsg@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<T2DLP_off>:
push   %rax
xor    %eax,%eax
call   1040 <T2DLP_errormsg@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @T2DLP_off(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @T2DLP_errormsg()
%4 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @T2DLP_off(i64 %0) {
%2 = tail call i32 (...) @T2DLP_errormsg()
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
double timeval_to_double(struct timeval *tv) {
  return tv->tv_sec + tv->tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<timeval_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  0xedf(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_double>:
movsd  0x8(%rdi),%xmm0
divsd  0xef3(%rip),%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @timeval_to_double(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%5 = load double, double* %4
%6 = load %struct.timeval*, %struct.timeval** %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @timeval_to_double(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load double, double* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%5 = load double, double* %4
%6 = fdiv double %5, 1.000000e+06
%7 = fadd double %3, %6
ret double %7
}
void RTSha1(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ getppid();
pid_t c_getppid_() { return getppid(); }


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

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

LLVM IR (-O0):
define i32 @c_getppid_() {
%1 = call i32 (...) @getppid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @c_getppid_() {
%1 = tail call i32 (...) @getppid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int SRLerrorout(char *c1, char *c2) {
  printf("\nERROR: %s - '%s'.", c1, c2);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"\0AERROR: %s - '%s'.\00"
define i32 @SRLerrorout(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 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AERROR: %s - '%s'.\00"
define i32 @SRLerrorout(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int _get_u8(int /*<<< orphan*/ const *);
uint32_t _get_u16(const uint8_t *p) {
  return _get_u8(p) | (_get_u8(p + 1) << 8);
}


x86 assembly (clang, -O0):
<_get_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_u8@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1030 <_get_u8@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_u16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <_get_u8@plt>
mov    %eax,%ebp
add    $0x4,%rbx
mov    %rbx,%rdi
call   1030 <_get_u8@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_get_u16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @_get_u8(i32* %3)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = call i32 @_get_u8(i32* %6)
%8 = shl i32 %7, 8
%9 = or i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @_get_u16(i32* %0) {
%2 = tail call i32 @_get_u8(i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = tail call i32 @_get_u8(i32* %3)
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
int __128bit_popcount(unsigned __int128 x) {
  return __builtin_popcountll((unsigned long long)x) +
         __builtin_popcountll((unsigned long long)(x >> 64));
}


x86 assembly (clang, -O0):
<__128bit_popcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rsi
55 55 55
and    %rsi,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rsi
33 33 33
mov    %rcx,%rax
and    %rsi,%rax
shr    $0x2,%rcx
and    %rsi,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
mov    %rdx,%rcx
shr    %rcx
movabs $0x5555555555555555,%rsi
55 55 55
and    %rsi,%rcx
sub    %rcx,%rdx
movabs $0x3333333333333333,%rsi
33 33 33
mov    %rdx,%rcx
and    %rsi,%rcx
shr    $0x2,%rdx
and    %rsi,%rdx
add    %rdx,%rcx
mov    %rcx,%rdx
shr    $0x4,%rdx
add    %rdx,%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rdx,%rcx
movabs $0x101010101010101,%rdx
01 01 01
imul   %rdx,%rcx
shr    $0x38,%rcx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__128bit_popcount>:
movq   %rdi,%xmm0
movq   %rsi,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa %xmm1,%xmm0
psrlw  $0x1,%xmm0
pand   0xee1(%rip),%xmm0
psubb  %xmm0,%xmm1
movdqa 0xee5(%rip),%xmm0
movdqa %xmm1,%xmm2
pand   %xmm0,%xmm2
psrlw  $0x2,%xmm1
pand   %xmm0,%xmm1
paddb  %xmm2,%xmm1
movdqa %xmm1,%xmm0
psrlw  $0x4,%xmm0
paddb  %xmm1,%xmm0
pand   0xecb(%rip),%xmm0
pxor   %xmm1,%xmm1
psadbw %xmm0,%xmm1
pshufd $0xaa,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @__128bit_popcount(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = bitcast i128* %3 to { i64, i64 }*
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 0
store i64 %0, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = load i128, i128* %3
store i128 %8, i128* %4
%9 = load i128, i128* %4
%10 = trunc i128 %9 to i64
%11 = call i64 @llvm.ctpop.i64(i64 %10)
%12 = trunc i64 %11 to i32
%13 = load i128, i128* %4
%14 = lshr i128 %13, 64
%15 = trunc i128 %14 to i64
%16 = call i64 @llvm.ctpop.i64(i64 %15)
%17 = trunc i64 %16 to i32
%18 = add nsw i32 %12, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @__128bit_popcount(i64 %0, i64 %1) {
%3 = insertelement <2 x i64> poison, i64 %1, i64 0
%4 = insertelement <2 x i64> %3, i64 %0, i64 1
%5 = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %4)
%6 = trunc <2 x i64> %5 to <2 x i32>
%7 = shufflevector <2 x i32> %6, <2 x i32> poison, <2 x i32> <i32 1, i32 undef>
%8 = add nuw nsw <2 x i32> %7, %6
%9 = extractelement <2 x i32> %8, i64 0
ret i32 %9
}
/* Variables and functions */
int chdir(char *);
char *getenv(char *);
int /*<<< orphan*/ strlen(char *);
int _cd(char *directory) {
  if (!directory || !strlen(directory)) {
    return chdir(getenv("HOME"));
  }
  return chdir(directory);
}


x86 assembly (clang, -O0):
<_cd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1159 <_cd+0x29>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%eax
jne    1175 <_cd+0x45>
lea    0xea0(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   1050 <chdir@plt>
mov    %eax,-0x4(%rbp)
jmp    1181 <_cd+0x51>
mov    -0x10(%rbp),%rdi
call   1050 <chdir@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cd>:
push   %rbx
test   %rdi,%rdi
je     114b <_cd+0x1b>
mov    %rdi,%rbx
call   1040 <strlen@plt>
test   %eax,%eax
je     114b <_cd+0x1b>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <chdir@plt>
lea    0xeae(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1050 <chdir@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
define i32 @_cd(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3, %1
%7 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @chdir(i8* %7)
br label %11
9: ; preds = %3
%10 = tail call i32 @chdir(i8* %0)
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %10, %9 ], [ %8, %6 ]
ret i32 %12
}
/* Variables and functions */
double log(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double param, result;
  param = 5.5;
  result = log(param);
  printf("log(%f) = %f\n", param, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"log(%f) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 5.500000e+00, double* %2
%4 = load double, double* %2
%5 = call double @log(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %6, double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"log(%f) = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double 5.500000e+00, double 0x3FFB46A5EF8151A0)
ret i32 0
}