xunge/DecIR huggingface dataset:
double test_huge_val(void) { return __builtin_huge_val(); }


x86 assembly (clang, -O0):
<test_huge_val>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_huge_val>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @test_huge_val() {
ret double 0x7FF0000000000000
}

LLVM IR (-O2):
define double @test_huge_val() {
ret double 0x7FF0000000000000
}
/* Type definitions */
struct ticket_lock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ticket_lock *);
void ticket_lock_dispose(struct ticket_lock *l) { free(l); }


x86 assembly (clang, -O0):
<ticket_lock_dispose>:
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):
<ticket_lock_dispose>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ticket_lock = type { i32 }
define void @ticket_lock_dispose(%struct.ticket_lock* %0) {
%2 = alloca %struct.ticket_lock*
store %struct.ticket_lock* %0, %struct.ticket_lock** %2
%3 = load %struct.ticket_lock*, %struct.ticket_lock** %2
%4 = call i32 @free(%struct.ticket_lock* %3)
ret void
}

LLVM IR (-O2):
%struct.ticket_lock = type { i32 }
define void @ticket_lock_dispose(%struct.ticket_lock* nocapture %0) {
%2 = tail call i32 @free(%struct.ticket_lock* %0)
ret void
}
/* Variables and functions */
int strlen(char *);
char *hash(char *passwd) {
  int i;
  for (i = 0; i < strlen(passwd); i++)
    passwd[i] = passwd[i] % 10;
  return passwd;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    116c <hash+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <hash+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1164 <hash+0x54>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%eax
imul   $0x67,%eax,%ecx
movzwl %cx,%edx
shr    $0xa,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <hash+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @hash(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = srem i8 %7, 10
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
char *level1_1_s(char *, size_t, int, char *, size_t *);
int /*<<< orphan*/ ntos(int, char *, size_t *);
char *level1_1(int num, int ge, char *regstr, size_t *reglen) {
  char str[128], *s = str, d;
  size_t len = sizeof str;
  ntos(num, str, &len);
  return level1_1_s(str, len, ge, regstr, reglen);
}


x86 assembly (clang, -O0):
<level1_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
movq   $0x80,-0xb8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xa0(%rbp),%rsi
lea    -0xb8(%rbp),%rdx
call   1030 <ntos@plt>
lea    -0xa0(%rbp),%rdi
mov    -0xb8(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1040 <level1_1_s@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<level1_1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%ebp
movq   $0x80,0x8(%rsp)
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%rdx
mov    %r15,%rsi
call   1030 <ntos@plt>
mov    0x8(%rsp),%rsi
mov    %r15,%rdi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <level1_1_s@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @level1_1(i32 %0, i32 %1, i8* %2, i64* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca [128 x i8]
%10 = alloca i8*
%11 = alloca i8
%12 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64* %3, i64** %8
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
store i8* %13, i8** %10
store i64 128, i64* %12
%14 = load i32, i32* %5
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%16 = call i32 @ntos(i32 %14, i8* %15, i64* %12)
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%18 = load i64, i64* %12
%19 = load i32, i32* %6
%20 = load i8*, i8** %7
%21 = load i64*, i64** %8
%22 = call i8* @level1_1_s(i8* %17, i64 %18, i32 %19, i8* %20, i64* %21)
ret i8* %22
}

LLVM IR (-O2):
define i8* @level1_1(i32 %0, i32 %1, i8* %2, i64* %3) {
%5 = alloca [128 x i8]
%6 = alloca i64
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%8 = bitcast i64* %6 to i8*
store i64 128, i64* %6
%9 = call i32 @ntos(i32 %0, i8* %7, i64* %6)
%10 = load i64, i64* %6
%11 = call i8* @level1_1_s(i8* %7, i64 %10, i32 %1, i8* %2, i64* %3)
ret i8* %11
}
int main(void) {
  int *p = 0;
  return *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
read_bmp_image(file_name, array) char *file_name;
short **array;
{}


x86 assembly (clang, -O0):
<read_bmp_image>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read_bmp_image(i8* %0, i16** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i16**
store i8* %0, i8** %4
store i16** %1, i16*** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @read_bmp_image(i8* nocapture readnone %0, i16** nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ inet_addr_test();
int /*<<< orphan*/ printf(char *);
int main() {
  inet_addr_test();
  printf("inet addr test OK!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"inet addr test OK!\00"
define i32 @main() {
%1 = tail call i32 (...) @inet_addr_test()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void systemShutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @systemShutdown() {
ret void
}
void __delay_blink(void) {
  volatile int count = 500000;
  while (count--)
    ;
}


x86 assembly (clang, -O0):
<__delay_blink>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7a120,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1124 <__delay_blink+0x24>
jmp    110b <__delay_blink+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__delay_blink>:
movl   $0x7a120,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
subl   $0x1,-0x4(%rsp)
jae    1110 <__delay_blink+0x10>
ret

LLVM IR (-O0):
define void @__delay_blink() {
%1 = alloca i32
store volatile i32 500000, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, -1
store volatile i32 %4, i32* %1
%5 = icmp ne i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @__delay_blink() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 500000, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = add nsw i32 %4, -1
store volatile i32 %5, i32* %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
/* Variables and functions */
int __syscall(int, char const *);
int rmdir(const char *d) { return __syscall(84, d); }


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

x86 assembly (clang, -O2):
<rmdir>:
mov    %rdi,%rsi
mov    $0x54,%edi
jmp    1030 <__syscall@plt>

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

LLVM IR (-O2):
define i32 @rmdir(i8* %0) {
%2 = tail call i32 @__syscall(i32 84, i8* %0)
ret i32 %2
}
void ff_hevc_put_hevc_uni_w_epel_h64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h64_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void eFinal(char plvra[]) { printf("\n%s sim ;", plvra); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"\0A%s sim ;\00"
define void @eFinal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
long reverseNum(long num) {
  long rev = 0;
  while (num) {
    rev = rev * 10 + num % 10;
    num /= 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<reverseNum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1154 <reverseNum+0x54>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1110 <reverseNum+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseNum>:
test   %rdi,%rdi
je     1158 <reverseNum+0x58>
mov    %rdi,%rcx
xor    %eax,%eax
movabs $0x6666666666666667,%r8
66 66 66
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rax,%rax,4),%rsi
mov    %rcx,%rax
imul   %r8
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%rdi
sub    %rax,%rdi
lea    (%rdi,%rsi,2),%rax
add    $0x9,%rcx
cmp    $0x12,%rcx
mov    %rdx,%rcx
ja     1120 <reverseNum+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @reverseNum(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i64 %4, 10
%7 = srem i64 %5, 10
%8 = add nsw i64 %6, %7
%9 = sdiv i64 %5, 10
%10 = add i64 %5, 9
%11 = icmp ult i64 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i64 [ 0, %1 ], [ %8, %3 ]
ret i64 %13
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void zeroOut(uint8_t *array, int startPos, int endPos) {
  for (int i = startPos; i < endPos; i++) {
    array[i] = 0x00;
  }
}


x86 assembly (clang, -O0):
<zeroOut>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    113d <zeroOut+0x3d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <zeroOut+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroOut>:
cmp    %edx,%esi
jge    1133 <zeroOut+0x23>
push   %rax
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
not    %esi
add    %edx,%esi
lea    0x4(,%rsi,4),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zeroOut(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr i32, i32* %0, i64 %6
%8 = bitcast i32* %7 to i8*
%9 = xor i32 %1, -1
%10 = add i32 %9, %2
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 2
%13 = add nuw nsw i64 %12, 4
br label %14
14: ; preds = %5, %3
ret void
}
int Operand_label8_decode(unsigned int *valp) {
  unsigned label8_0, imm8_0;
  imm8_0 = *valp & 0xff;
  label8_0 = 0x4 + (((int)imm8_0 << 24) >> 24);
  *valp = label8_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_label8_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x18,%eax
sar    $0x18,%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_label8_decode>:
movsbl (%rdi),%eax
add    $0x4,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_label8_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 255
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 24
%10 = ashr i32 %9, 24
%11 = add nsw i32 4, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32*, i32** %2
store i32 %12, i32* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_label8_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = ashr exact i32 %3, 24
%5 = add nsw i32 %4, 4
store i32 %5, i32* %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int,
                           int /*<<< orphan*/, int /*<<< orphan*/);
void print_version(FILE *fp) {
  fprintf(fp,
          "P2P Food Lab Sensorbox\n"
          "  update\n"
          "  Version %d.%d.%d\n",
          1, 0, 0);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"P2P Food Lab Sensorbox\0A update\0A Version %d.%d.%d\0A\00"
define void @print_version(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"P2P Food Lab Sensorbox\0A update\0A Version %d.%d.%d\0A\00"
define void @print_version(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
ret void
}
unsigned long long ffi_test_60(unsigned long long x) { return x; }


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

x86 assembly (clang, -O2):
<ffi_test_60>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @ffi_test_60(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ crypt(char *, char *);
int /*<<< orphan*/ strcmp(int /*<<< orphan*/, char *);
int tl_checkpassword(char *password, char *shadow) {
  return !strcmp(crypt(password, shadow), shadow);
}


x86 assembly (clang, -O0):
<tl_checkpassword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <crypt@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl_checkpassword>:
push   %rbx
mov    %rsi,%rbx
call   1030 <crypt@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tl_checkpassword(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 @crypt(i8* %5, i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @strcmp(i32 %7, i8* %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @tl_checkpassword(i8* %0, i8* %1) {
%3 = tail call i32 @crypt(i8* %0, i8* %1)
%4 = tail call i32 @strcmp(i32 %3, i8* %1)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int test1(int i, int k) {
  if (i > 0 && i <= 5 && k >= 10 && k < 42) {
    int j = i + 1 + k;
    return j == 10;
  }
  return 1;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1152 <test1+0x52>
cmpl   $0x5,-0x8(%rbp)
jg     1152 <test1+0x52>
cmpl   $0xa,-0xc(%rbp)
jl     1152 <test1+0x52>
cmpl   $0x2a,-0xc(%rbp)
jge    1152 <test1+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <test1+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
add    $0xfffffffa,%edi
cmp    $0xfffffffb,%edi
setb   %al
add    $0xffffffd6,%esi
cmp    $0xffffffe0,%esi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @test1(i32 %0, i32 %1) {
%3 = add i32 %0, -6
%4 = icmp ult i32 %3, -5
%5 = add i32 %1, -42
%6 = icmp ult i32 %5, -32
%7 = or i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help15(void) {
  printf("  load <n>          load an S-record file from serial line <n>\n");
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c" load <n> load an S-record file from serial line <n>\0A\00"
define void @help15() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c" load <n> load an S-record file from serial line <n>\00"
define void @help15() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
char *strndup(char *, int);
char *remove_from_string(int debut, char *s, int fin) {
  return strndup(s + debut, strlen(s) - debut - fin);
}


x86 assembly (clang, -O0):
<remove_from_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
sub    -0x4(%rbp),%esi
sub    -0x14(%rbp),%esi
call   1040 <strndup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_from_string>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
movslq %edi,%rbp
lea    (%rsi,%rbp,1),%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
add    %r14d,%ebp
sub    %ebp,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strndup@plt>

LLVM IR (-O0):
define i8* @remove_from_string(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* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8*, i8** %5
%12 = call i32 @strlen(i8* %11)
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = load i32, i32* %6
%16 = sub nsw i32 %14, %15
%17 = call i8* @strndup(i8* %10, i32 %16)
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @remove_from_string(i32 %0, i8* %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = tail call i32 @strlen(i8* %1)
%7 = add i32 %2, %0
%8 = sub i32 %6, %7
%9 = tail call i8* @strndup(i8* %5, i32 %8)
ret i8* %9
}
/* Variables and functions */
double _sin(double);
double sin(double angle) { return _sin(angle); }


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

x86 assembly (clang, -O2):
<sin>:
jmp    1030 <_sin@plt>

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

LLVM IR (-O2):
define double @sin(double %0) {
%2 = tail call double @_sin(double %0)
ret double %2
}
int fly_set_font(char *fontname) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fly_set_font(i8* nocapture readnone %0) {
ret i32 1
}
int sched_init(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @sched_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @sched_init() {
ret i32 1
}
unsigned long test_flag_8bit(unsigned long mask,
                             const volatile unsigned char *addr) {
  return ((*addr) & mask) != 0;
}


x86 assembly (clang, -O0):
<test_flag_8bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
movzbl %al,%eax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_flag_8bit>:
movzbl (%rsi),%ecx
xor    %eax,%eax
test   %edi,%ecx
setne  %al
ret

LLVM IR (-O0):
define i64 @test_flag_8bit(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load volatile i8, i8* %5
%7 = zext i8 %6 to i64
%8 = load i64, i64* %3
%9 = and i64 %7, %8
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @test_flag_8bit(i64 %0, i8* %1) {
%3 = load volatile i8, i8* %1
%4 = zext i8 %3 to i64
%5 = and i64 %4, %0
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
ret i64 %7
}
int f11(int x) {
  switch (x) {
  default:
    return 3;
  case 10 ... 0xFFFFFFFF:
    return 0;
  }
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f11(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
]
5: ; preds = %1
store i32 3, i32* %2
br label %7
6: ; No predecessors!
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @f11(i32 %0) {
ret i32 3
}
/* Type definitions */
struct ndb_s_fileentry {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ndb_expandExtraStream(struct ndb_s_fileentry *pFile, FILE *fArchive,
                          const char *sDefaultPath, int opt_testintegrity) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.ndb_s_fileentry = type { i32 }
define i32 @ndb_expandExtraStream(%struct.ndb_s_fileentry* %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca %struct.ndb_s_fileentry*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store %struct.ndb_s_fileentry* %0, %struct.ndb_s_fileentry** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.ndb_s_fileentry = type { i32 }
define i32 @ndb_expandExtraStream(%struct.ndb_s_fileentry* nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IF_fct_2(char);
void IF_Lsupeg(void) { IF_fct_2('s'); }


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

x86 assembly (clang, -O2):
<IF_Lsupeg>:
mov    $0x73,%edi
jmp    1030 <IF_fct_2@plt>

LLVM IR (-O0):
define void @IF_Lsupeg() {
%1 = call i32 @IF_fct_2(i8 signext 115)
ret void
}

LLVM IR (-O2):
define void @IF_Lsupeg() {
%1 = tail call i32 @IF_fct_2(i8 signext 115)
ret void
}
void gtk_tree_selection_get_selected() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_selection_get_selected() {
ret void
}
/* Variables and functions */
unsigned char *calloc(int, int);
unsigned char *stoc(short num) {
  unsigned char *temp = calloc(1, sizeof(char) * 2);
  temp[0] = num;
  temp[1] = num >> 8;
  return temp;
}


x86 assembly (clang, -O0):
<stoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movswl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoc>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <calloc@plt>
mov    %bx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @stoc(i16 signext %0) {
%2 = alloca i16
%3 = alloca i8*
store i16 %0, i16* %2
%4 = call i8* @calloc(i32 1, i32 2)
store i8* %4, i8** %3
%5 = load i16, i16* %2
%6 = trunc i16 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @stoc(i16 signext %0) {
%2 = tail call dereferenceable_or_null(2) i8* @calloc(i32 1, i32 2)
%3 = trunc i16 %0 to i8
store i8 %3, i8* %2
%4 = lshr i16 %0, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %2, i64 1
store i8 %5, i8* %6
ret i8* %2
}
/* Variables and functions */
int pow(double, int);
double fp(double x) { return (3 * pow(x, 2) - 6); }


x86 assembly (clang, -O0):
<fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0x3,%eax,%eax
sub    $0x6,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp>:
push   %rax
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,2),%eax
add    $0xfffffffa,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 2)
%5 = mul nsw i32 3, %4
%6 = sub nsw i32 %5, 6
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @fp(double %0) {
%2 = tail call i32 @pow(double %0, i32 2)
%3 = mul nsw i32 %2, 3
%4 = add nsw i32 %3, -6
%5 = sitofp i32 %4 to double
ret double %5
}
int islower(int c) { return ((c >= 'a') && (c <= 'z')) ? 1 : 0; }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double log(double);
double genacoth(double num) { return ((0.5) * log((num + 1.0) / (num - 1.0))); }


x86 assembly (clang, -O0):
<genacoth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xed1(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genacoth>:
push   %rax
movsd  0xee7(%rip),%xmm1
addsd  %xmm0,%xmm1
addsd  0xee3(%rip),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genacoth(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
%5 = load double, double* %2
%6 = fsub double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = call double @log(double %7)
%9 = fmul double 5.000000e-01, %8
ret double %9
}

LLVM IR (-O2):
define double @genacoth(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fadd double %0, -1.000000e+00
%4 = fdiv double %2, %3
%5 = tail call double @log(double %4)
%6 = fmul double %5, 5.000000e-01
ret double %6
}
/* Variables and functions */
int print();
int main() { return print(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @print()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print()
ret i32 %1
}
/* Variables and functions */
char **calloc(int, int);
char **MakeCharArray(int size) { return calloc(sizeof(char *), size); }


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

x86 assembly (clang, -O2):
<MakeCharArray>:
mov    %edi,%esi
mov    $0x8,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8** @MakeCharArray(i32 %0) {
%2 = tail call i8** @calloc(i32 8, i32 %0)
ret i8** %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((destructor)) cleanUpLibrary(void) {
  printf("Library is exited\n");
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Library is exited\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @cleanUpLibrary, i8* null }]
define void @cleanUpLibrary() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @cleanUpLibrary, i8* null }]
@str = [18 x i8] c"Library is exited\00"
define void @cleanUpLibrary() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int g_get_object_id(char *);
int g_set_objectstatus(int, int);
int g_set_objectstatus_byname(char *label, int status) {
  int id;
  if ((id = g_get_object_id(label)) == -1)
    return -1;
  return g_set_objectstatus(id, status);
}


x86 assembly (clang, -O0):
<g_set_objectstatus_byname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <g_get_object_id@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1150 <g_set_objectstatus_byname+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <g_set_objectstatus_byname+0x3e>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <g_set_objectstatus@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_set_objectstatus_byname>:
push   %rbx
mov    %esi,%ebx
call   1030 <g_get_object_id@plt>
cmp    $0xffffffff,%eax
je     1137 <g_set_objectstatus_byname+0x17>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <g_set_objectstatus@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @g_set_objectstatus_byname(i8* %0, i32 %1) {
%3 = tail call i32 @g_get_object_id(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @g_set_objectstatus(i32 %3, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ MSort(int *, int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void Merge_Sort(int A[], int N) {
  int *TmpA = (int *)malloc(N * sizeof(int));
  if (NULL == TmpA)
    exit(-1);
  else {
    MSort(A, TmpA, 0, N - 1);
    free(TmpA);
  }
  return;
}


x86 assembly (clang, -O0):
<Merge_Sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1178 <Merge_Sort+0x38>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <MSort@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Merge_Sort>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     117d <Merge_Sort+0x3d>
mov    %rax,%r15
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
call   1030 <MSort@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <free@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define void @Merge_Sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = icmp eq i32* null, %12
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %3
%18 = load i32*, i32** %5
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = call i32 @MSort(i32* %17, i32* %18, i32 0, i32 %20)
%22 = load i32*, i32** %5
%23 = call i32 @free(i32* %22)
br label %24
24: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @Merge_Sort(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
%10 = add nsw i32 %1, -1
%11 = tail call i32 @MSort(i32* %0, i32* %5, i32 0, i32 %10)
%12 = tail call i32 @free(i32* %5)
ret void
}
long unsigned int fx(char *a, long unsigned int sz) {
  char *b = a + sz;
  return b - a;
}


x86 assembly (clang, -O0):
<fx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fx>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @fx(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @fx(i8* nocapture readnone %0, i64 returned %1) {
ret i64 %1
}
void _native_LED_RED_OFF(void) {}


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

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

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

LLVM IR (-O2):
define void @_native_LED_RED_OFF() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void fputs(int fd, const char *s) {
  if (!s)
    s = "NULL";
  write(fd, s, strlen(s));
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1145 <fputs+0x25>
lea    0xebf(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
test   %rsi,%rsi
lea    0xece(%rip),%rax
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"NULL\00"
define void @fputs(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @write(i32 %0, i8* %4, i32 %5)
ret void
}
/* Variables and functions */
double __nv_frexp(double, int *);
double frexp(double __a, int *__b) { return __nv_frexp(__a, __b); }


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

x86 assembly (clang, -O2):
<frexp>:
jmp    1030 <__nv_frexp@plt>

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

LLVM IR (-O2):
define double @frexp(double %0, i32* %1) {
%3 = tail call double @__nv_frexp(double %0, i32* %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glWindowPos4fMESAemulate(int /*<<< orphan*/,
                                            int /*<<< orphan*/,
                                            int /*<<< orphan*/, int);
void glWindowPos2fMESAemulate(GLfloat x, GLfloat y) {
  glWindowPos4fMESAemulate(x, y, 0, 1);
}


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

x86 assembly (clang, -O2):
<glWindowPos2fMESAemulate>:
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <glWindowPos4fMESAemulate@plt>

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

LLVM IR (-O2):
define void @glWindowPos2fMESAemulate(i32 %0, i32 %1) {
%3 = tail call i32 @glWindowPos4fMESAemulate(i32 %0, i32 %1, i32 0, i32 1)
ret void
}
/* Variables and functions */
void *memxor_timec(void *, void const *, size_t);
void *tc_memxor(void *dest, const void *src, size_t n) {
  return memxor_timec(dest, src, n);
}


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

x86 assembly (clang, -O2):
<tc_memxor>:
jmp    1030 <memxor_timec@plt>

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

LLVM IR (-O2):
define i8* @tc_memxor(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @memxor_timec(i8* %0, i8* %1, i64 %2)
ret i8* %4
}