xunge/DecIR huggingface dataset:
int UTF8_TrailingBytes(unsigned char c) {
  if (c >= 0xC0 && c <= 0xDF)
    return 1;
  else if (c >= 0xE0 && c <= 0xEF)
    return 2;
  else if (c >= 0xF0 && c <= 0xF4)
    return 3;
  else
    return 0;
}


x86 assembly (clang, -O0):
<UTF8_TrailingBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0xc0,%eax
jl     1134 <UTF8_TrailingBytes+0x34>
movzbl -0x5(%rbp),%eax
cmp    $0xdf,%eax
jg     1134 <UTF8_TrailingBytes+0x34>
movl   $0x1,-0x4(%rbp)
jmp    118f <UTF8_TrailingBytes+0x8f>
movzbl -0x5(%rbp),%eax
cmp    $0xe0,%eax
jl     115e <UTF8_TrailingBytes+0x5e>
movzbl -0x5(%rbp),%eax
cmp    $0xef,%eax
jg     115e <UTF8_TrailingBytes+0x5e>
movl   $0x2,-0x4(%rbp)
jmp    118f <UTF8_TrailingBytes+0x8f>
movzbl -0x5(%rbp),%eax
cmp    $0xf0,%eax
jl     1188 <UTF8_TrailingBytes+0x88>
movzbl -0x5(%rbp),%eax
cmp    $0xf4,%eax
jg     1188 <UTF8_TrailingBytes+0x88>
movl   $0x3,-0x4(%rbp)
jmp    118f <UTF8_TrailingBytes+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTF8_TrailingBytes>:
mov    %edi,%ecx
and    $0xe0,%cl
mov    $0x1,%eax
cmp    $0xc0,%cl
je     112e <UTF8_TrailingBytes+0x2e>
mov    %edi,%ecx
and    $0xf0,%cl
mov    $0x2,%eax
cmp    $0xe0,%cl
je     112e <UTF8_TrailingBytes+0x2e>
add    $0x10,%dil
xor    %eax,%eax
cmp    $0x5,%dil
setb   %al
lea    (%rax,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @UTF8_TrailingBytes(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 192
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 223
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp sge i32 %14, 224
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = icmp sle i32 %18, 239
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 2, i32* %2
br label %31
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = icmp sge i32 %23, 240
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = zext i8 %26 to i32
%28 = icmp sle i32 %27, 244
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 3, i32* %2
br label %31
30: ; preds = %25, %21
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29, %20, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @UTF8_TrailingBytes(i8 zeroext %0) {
%2 = and i8 %0, -32
%3 = icmp eq i8 %2, -64
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i8 %0, -16
%6 = icmp eq i8 %5, -32
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = add i8 %0, 16
%9 = icmp ult i8 %8, 5
%10 = select i1 %9, i32 3, i32 0
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 2, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
struct proctal {
  int dummy;
};

/* Variables and functions */
void proctal_global_free(void const *);
void proctal_free(struct proctal *p, const void *address) {
  return proctal_global_free(address);
}


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

x86 assembly (clang, -O2):
<proctal_free>:
mov    %rsi,%rdi
jmp    1030 <proctal_global_free@plt>

LLVM IR (-O0):
%struct.proctal = type { i32 }
define void @proctal_free(%struct.proctal* %0, i8* %1) {
%3 = alloca %struct.proctal*
%4 = alloca i8*
store %struct.proctal* %0, %struct.proctal** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
%struct.proctal = type { i32 }
define void @proctal_free(%struct.proctal* nocapture readnone %0, i8* %1) {
tail call void @proctal_global_free(i8* %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ map_installed;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
int get_XWindowAttributes_map_installed(void *_p) {
  return (int)((XWindowAttributes *)_p)->map_installed;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XWindowAttributes_map_installed(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int ksmbd_rdma_destroy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ksmbd_rdma_destroy() {
ret i32 0
}
int get_val(void *array, int index) {
  int *arr = array;
  return arr[index];
}


x86 assembly (clang, -O0):
<get_val>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_val>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @get_val(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int die;
  srand(time(NULL));
  die = rand() % 6 + 1;
  printf("Congratulations, you rolled a %d!", die);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Congratulations, you rolled a %d!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Congratulations, you rolled a %d!\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void key_init() {
  (*(volatile unsigned *)0x56000050) &= ~0x33;
  (*(volatile unsigned *)0x56000050) |= 0x22;
  (*(volatile unsigned *)0x4a000008) &= ~((1 << 0) | (1 << 2));
}


x86 assembly (clang, -O0):
<key_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000050,%eax
mov    (%rax),%ecx
and    $0xffffffcc,%ecx
mov    $0x56000050,%eax
mov    %ecx,(%rax)
mov    $0x56000050,%eax
mov    (%rax),%ecx
or     $0x22,%ecx
mov    $0x56000050,%eax
mov    %ecx,(%rax)
mov    $0x4a000008,%eax
mov    (%rax),%ecx
and    $0xfffffffa,%ecx
mov    $0x4a000008,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_init>:
andl   $0xffffffcc,0x56000050
cc
orl    $0x22,0x56000050
22
andl   $0xfffffffa,0x4a000008
fa
ret

LLVM IR (-O0):
define void @key_init() {
%1 = load volatile i32, i32* inttoptr (i64 1442840656 to i32*)
%2 = and i32 %1, -52
store volatile i32 %2, i32* inttoptr (i64 1442840656 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1442840656 to i32*)
%4 = or i32 %3, 34
store volatile i32 %4, i32* inttoptr (i64 1442840656 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1241513992 to i32*)
%6 = and i32 %5, -6
store volatile i32 %6, i32* inttoptr (i64 1241513992 to i32*)
ret void
}

LLVM IR (-O2):
define void @key_init() {
%1 = load volatile i32, i32* inttoptr (i64 1442840656 to i32*)
%2 = and i32 %1, -52
store volatile i32 %2, i32* inttoptr (i64 1442840656 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1442840656 to i32*)
%4 = or i32 %3, 34
store volatile i32 %4, i32* inttoptr (i64 1442840656 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1241513992 to i32*)
%6 = and i32 %5, -6
store volatile i32 %6, i32* inttoptr (i64 1241513992 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execle(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
main() {
  char *cbook = "http://publications.gbdirect.co.uk/c_book/thecbook.pdf";
  printf("Downloading C Book\n");
  execle("/usr/bin/wget", "wget", cbook, NULL);
  printf("Error Downloading\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xefa(%rip),%rdi
lea    0xefc(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <execle@plt>
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
lea    0xf05(%rip),%rsi
lea    0xebe(%rip),%rdx
xor    %ecx,%ecx
call   1040 <execle@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"http://publications.gbdirect.co.uk/c_book/thecbook.pdf\00"
@.str.1 = [20 x i8] c"Downloading C Book\0A\00"
@.str.2 = [14 x i8] c"/usr/bin/wget\00"
@.str.3 = [5 x i8] c"wget\00"
@.str.4 = [19 x i8] c"Error Downloading\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @execle(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %4, i32* null)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"http://publications.gbdirect.co.uk/c_book/thecbook.pdf\00"
@.str.2 = [14 x i8] c"/usr/bin/wget\00"
@.str.3 = [5 x i8] c"wget\00"
@str = [19 x i8] c"Downloading C Book\00"
@str.5 = [18 x i8] c"Error Downloading\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @execle(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32* null)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void uart_send_char(char c) {
  if (c == '}') {
    putchar('\0');
  } else {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<uart_send_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x7d,%eax
jne    1137 <uart_send_char+0x27>
xor    %edi,%edi
call   1030 <putchar@plt>
jmp    1140 <uart_send_char+0x30>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send_char>:
xor    %eax,%eax
cmp    $0x7d,%dil
cmove  %eax,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @uart_send_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 125
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @putchar(i8 signext 0)
br label %11
8: ; preds = %1
%9 = load i8, i8* %2
%10 = call i32 @putchar(i8 signext %9)
br label %11
11: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @uart_send_char(i8 signext %0) {
%2 = icmp eq i8 %0, 125
%3 = select i1 %2, i8 0, i8 %0
%4 = tail call i32 @putchar(i8 signext %3)
ret void
}
/* Variables and functions */
int juniper_fpga_partition_write_flag(int, int, char *, int);
int juniper_fpga_partition_start(int devNo, int partNo) {
  return juniper_fpga_partition_write_flag(devNo, partNo, "accel_start", 1);
}


x86 assembly (clang, -O0):
<juniper_fpga_partition_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdx
mov    $0x1,%ecx
call   1030 <juniper_fpga_partition_write_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<juniper_fpga_partition_start>:
lea    0xee9(%rip),%rdx
mov    $0x1,%ecx
jmp    1030 <juniper_fpga_partition_write_flag@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"accel_start\00"
define i32 @juniper_fpga_partition_start(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 @juniper_fpga_partition_write_flag(i32 %5, i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %7
}

LLVM IR (-O2):
@.str = [12 x i8] c"accel_start\00"
define i32 @juniper_fpga_partition_start(i32 %0, i32 %1) {
%3 = tail call i32 @juniper_fpga_partition_write_flag(i32 %0, i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sayHello() { printf("say hello from hello.c file\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"say hello from hello.c file\0A\00"
define void @sayHello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"say hello from hello.c file\00"
define void @sayHello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *must_calloc(int, int);
void *must_alloc(int size) { return must_calloc(1, size); }


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

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

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

LLVM IR (-O2):
define i8* @must_alloc(i32 %0) {
%2 = tail call i8* @must_calloc(i32 1, i32 %0)
ret i8* %2
}
/* Variables and functions */
int pow257(int, int);
int mkoff_b_n(int i) { return pow257(41, 255 * i); }


x86 assembly (clang, -O0):
<mkoff_b_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xff,-0x4(%rbp),%esi
mov    $0x29,%edi
call   1030 <pow257@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkoff_b_n>:
mov    %edi,%esi
shl    $0x8,%esi
sub    %edi,%esi
mov    $0x29,%edi
jmp    1030 <pow257@plt>

LLVM IR (-O0):
define i32 @mkoff_b_n(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 255, %3
%5 = call i32 @pow257(i32 41, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @mkoff_b_n(i32 %0) {
%2 = mul nsw i32 %0, 255
%3 = tail call i32 @pow257(i32 41, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_handler(int sig) { printf("Received interrupt signal\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Received interrupt signal\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Received interrupt signal\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ hd_line(int /*<<< orphan*/ *);
int /*<<< orphan*/ hd_order(int /*<<< orphan*/ *);
int hd_order_line(FILE *f) {
  hd_order(f);
  hd_line(f);
  return (0);
}


x86 assembly (clang, -O0):
<hd_order_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <hd_order@plt>
mov    -0x8(%rbp),%rdi
call   1030 <hd_line@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd_order_line>:
push   %rbx
mov    %rdi,%rbx
call   1040 <hd_order@plt>
mov    %rbx,%rdi
call   1030 <hd_line@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hd_order_line(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @hd_order(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @hd_line(i32* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @hd_order_line(i32* %0) {
%2 = tail call i32 @hd_order(i32* %0)
%3 = tail call i32 @hd_line(i32* %0)
ret i32 0
}
/* Type definitions */
struct node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct node *list_first(struct list const *);
struct node *node_next(struct node *);
int list_length(const struct list *list) {
  int len = 0;
  struct node *node = list_first(list);
  while (node) {
    len++;
    node = node_next(node);
  }
  return len;
}


x86 assembly (clang, -O0):
<list_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <list_first@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1166 <list_length+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <node_next@plt>
mov    %rax,-0x18(%rbp)
jmp    1140 <list_length+0x20>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_length>:
push   %rbx
call   1030 <list_first@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1140 <list_length+0x20>
nopl   (%rax)
add    $0x1,%ebx
mov    %rax,%rdi
call   1040 <node_next@plt>
test   %rax,%rax
jne    1130 <list_length+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.node = type { i32 }
define i32 @list_length(%struct.list* %0) {
%2 = alloca %struct.list*
%3 = alloca i32
%4 = alloca %struct.node*
store %struct.list* %0, %struct.list** %2
store i32 0, i32* %3
%5 = load %struct.list*, %struct.list** %2
%6 = call %struct.node* @list_first(%struct.list* %5)
store %struct.node* %6, %struct.node** %4
br label %7
7: ; preds = %10, %1
%8 = load %struct.node*, %struct.node** %4
%9 = icmp ne %struct.node* %8, null
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load %struct.node*, %struct.node** %4
%14 = call %struct.node* @node_next(%struct.node* %13)
store %struct.node* %14, %struct.node** %4
br label %7
15: ; preds = %7
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.node = type { i32 }
define i32 @list_length(%struct.list* %0) {
%2 = tail call %struct.node* @list_first(%struct.list* %0)
%3 = icmp eq %struct.node* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi %struct.node* [ %8, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = tail call %struct.node* @node_next(%struct.node* %5)
%9 = icmp eq %struct.node* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ lcd_print_char(char);
int /*<<< orphan*/ usleep(int);
void lcd_load_cgram(char tab[], uint8_t charnum) {
  uint8_t index;
  charnum = charnum * 8;
  for (index = 0; index < charnum; index++) {
    lcd_print_char(tab[index]);
    usleep(1 * 1000);
  }
}


x86 assembly (clang, -O0):
<lcd_load_cgram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1174 <lcd_load_cgram+0x54>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <lcd_print_char@plt>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <lcd_load_cgram+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_load_cgram>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    115d <lcd_load_cgram+0x3d>
mov    %rdi,%r14
shl    $0x3,%esi
cmp    $0x2,%esi
mov    $0x1,%r15d
cmovge %esi,%r15d
xor    %ebx,%ebx
xchg   %ax,%ax
movsbl (%r14,%rbx,1),%edi
call   1030 <lcd_print_char@plt>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <lcd_load_cgram+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @lcd_load_cgram(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = shl i32 %1, 3
%6 = call i32 @llvm.smax.i32(i32 %5, i32 1)
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @lcd_print_char(i8 signext %11)
%13 = tail call i32 @usleep(i32 1000)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %2
ret void
}
int XBitmapPad() {}


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

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

LLVM IR (-O0):
define i32 @XBitmapPad() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XBitmapPad() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ MFRC522_main();
void nfc_app_main() { MFRC522_main(); }


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

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

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

LLVM IR (-O2):
define void @nfc_app_main() {
%1 = tail call i32 (...) @MFRC522_main()
ret void
}
/* Type definitions */
typedef scalar_t__ pthread_once_t;

/* Variables and functions */
void _pthread_once_cleanup(void *o) { *(pthread_once_t *)o = 0; }


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

x86 assembly (clang, -O2):
<_pthread_once_cleanup>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @_pthread_once_cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
store i64 0, i64* %4
ret void
}

LLVM IR (-O2):
define void @_pthread_once_cleanup(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i64*
store i64 0, i64* %2
ret void
}
/* Variables and functions */
size_t st_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, size_t);
void ft_putendl(const char *str) {
  size_t str_size;
  str_size = st_strlen(str);
  write(1, str, str_size);
  write(1, "\n", (size_t)1);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <st_strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edi
lea    0xea9(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rbx
mov    %rdi,%rbx
call   1040 <st_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <write@plt>
lea    0xec0(%rip),%rsi
mov    $0x1,%edx
mov    $0x1,%edi
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = tail call i64 @st_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i64 %2)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_irq2(void) { print("IRQ 2"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"IRQ 2\00"
define void @idt_irq2() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int somaSerie(int i, int j, int k) {
  if (i > j)
    return 0;
  return i + somaSerie(i + k, j, k);
}


x86 assembly (clang, -O0):
<somaSerie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1139 <somaSerie+0x29>
movl   $0x0,-0x4(%rbp)
jmp    115a <somaSerie+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <somaSerie@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<somaSerie>:
xor    %eax,%eax
cmp    %esi,%edi
jg     1118 <somaSerie+0x18>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    %edi,%eax
add    %edx,%edi
cmp    %esi,%edi
jle    1110 <somaSerie+0x10>
ret

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

LLVM IR (-O2):
define i32 @somaSerie(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %0, %3 ]
%7 = phi i32 [ %9, %5 ], [ 0, %3 ]
%8 = add nsw i32 %6, %2
%9 = add nsw i32 %6, %7
%10 = icmp sgt i32 %8, %1
br i1 %10, label %11, label %5
11: ; preds = %5, %3
%12 = phi i32 [ 0, %3 ], [ %9, %5 ]
ret i32 %12
}
int PyDTrace_GC_DONE_ENABLED(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PyDTrace_GC_DONE_ENABLED() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int towide_dbcs(int /*<<< orphan*/ *, char const *, unsigned int);
int towide_gb2312(wchar_t *wc, const char *mb, unsigned n) {
  return (towide_dbcs(wc, mb, n));
}


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

x86 assembly (clang, -O2):
<towide_gb2312>:
jmp    1030 <towide_dbcs@plt>

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

LLVM IR (-O2):
define i32 @towide_gb2312(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @towide_dbcs(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
int main_chaine_pp(int argc, char *argv[]) {
  int a;
  char *result;
  char c[20] = {"coucou.bmp"};
  chaine_test1();
  return 1;
}


x86 assembly (clang, -O0):
<main_chaine_pp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    $0x0,%al
call   1030 <chaine_test1@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_chaine_pp>:
push   %rax
xor    %eax,%eax
call   1030 <chaine_test1@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main_chaine_pp.c = [20 x i8] c"coucou.bmp\00\00\00\00\00\00\00\00\00\00"
define i32 @main_chaine_pp(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [20 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = bitcast [20 x i8]* %7 to i8*
%9 = call i32 (...) @chaine_test1()
ret i32 1
}

LLVM IR (-O2):
define i32 @main_chaine_pp(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @chaine_test1()
ret i32 1
}
/* Variables and functions */
int get_ntime();
long long get_utime(void) { return get_ntime() / 1000; }


x86 assembly (clang, -O0):
<get_utime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_ntime@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_utime>:
push   %rax
xor    %eax,%eax
call   1030 <get_ntime@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_utime() {
%1 = call i32 (...) @get_ntime()
%2 = sdiv i32 %1, 1000
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_utime() {
%1 = tail call i32 (...) @get_ntime()
%2 = sdiv i32 %1, 1000
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *print_msg(void *thread_id) {
  int th_id;
  th_id = (intptr_t)thread_id;
  printf("Hello, World from thread %d\n", th_id);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<print_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_msg>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Hello, World from thread %d\0A\00"
define i8* @print_msg(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i32
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @pthread_exit(i32* null)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [29 x i8] c"Hello, World from thread %d\0A\00"
define noalias i8* @print_msg(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
int llib_str_toupper(int c) {
  return (((c >= 'a') && (c <= 'z')) ? c - 32 : c);
}


x86 assembly (clang, -O0):
<llib_str_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1129 <llib_str_toupper+0x29>
cmpl   $0x7a,-0x4(%rbp)
jg     1129 <llib_str_toupper+0x29>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <llib_str_toupper+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llib_str_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @llib_str_toupper(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 %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @llib_str_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage: 7zip input-file output-file kernel/loader big/little\n");
  printf("           -k(K): self-decompress in kernel\n");
  printf("           -l(L): decompress in loader\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xf38(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"Usage: 7zip input-file output-file kernel/loader big/little\0A\00"
@.str.1 = [45 x i8] c" -k(K): self-decompress in kernel\0A\00"
@.str.2 = [40 x i8] c" -l(L): decompress in loader\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [60 x i8] c"Usage: 7zip input-file output-file kernel/loader big/little\00"
@str.3 = [44 x i8] c" -k(K): self-decompress in kernel\00"
@str.4 = [39 x i8] c" -l(L): decompress in loader\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *_zero_arr_plus_char_fn(char *, int, int, char const *, unsigned int);
char *_zero_arr_inplace_plus_char_fn(char **x, int orig_i, const char *filename,
                                     unsigned lineno) {
  *x = _zero_arr_plus_char_fn(*x, 1, orig_i, filename, lineno);
  return *x;
}


x86 assembly (clang, -O0):
<_zero_arr_inplace_plus_char_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%esi
call   1030 <_zero_arr_plus_char_fn@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_inplace_plus_char_fn>:
push   %rbx
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x1,%esi
call   1030 <_zero_arr_plus_char_fn@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_zero_arr_inplace_plus_char_fn(i8** nocapture %0, i32 %1, i8* %2, i32 %3) {
%5 = load i8*, i8** %0
%6 = tail call i8* @_zero_arr_plus_char_fn(i8* %5, i32 1, i32 %1, i8* %2, i32 %3)
store i8* %6, i8** %0
ret i8* %6
}
char *token_data(char **tok_arr) {
  int i = 0;
  while (tok_arr[i])
    ++i;
  return tok_arr[i + 1];
}


x86 assembly (clang, -O0):
<token_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <token_data+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <token_data+0xf>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_data>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpq   $0x0,(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <token_data+0x10>
mov    %eax,%eax
mov    (%rdi,%rax,8),%rax
ret

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

LLVM IR (-O2):
define i8* @token_data(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = add i64 %3, 1
%10 = and i64 %9, 4294967295
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
ret i8* %12
}
unsigned long factorial(char n) {
  if (n <= 1) {
    return 1;
  } else if (n > 20) {
    return 0;
  }
  return n * factorial(n - 2);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jg     1138 <factorial+0x28>
movq   $0x1,-0x8(%rbp)
jmp    117e <factorial+0x6e>
movsbl -0x9(%rbp),%eax
cmp    $0x14,%eax
jle    1152 <factorial+0x42>
movq   $0x0,-0x8(%rbp)
jmp    117e <factorial+0x6e>
jmp    1157 <factorial+0x47>
movsbq -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
sub    $0x2,%eax
movsbl %al,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%dil
jl     113f <factorial+0x3f>
movzbl %dil,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
cmp    $0x14,%dl
ja     113b <factorial+0x3b>
imul   %rdx,%rax
add    $0xfffffffffffffffe,%rdx
lea    0x2(%rdx),%esi
cmp    $0x3,%sil
ja     1120 <factorial+0x20>
mov    $0x1,%ecx
imul   %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @factorial(i8 signext %0) {
%2 = icmp slt i8 %0, 2
br i1 %2, label %16, label %3
3: ; preds = %1, %7
%4 = phi i8 [ %9, %7 ], [ %0, %1 ]
%5 = phi i64 [ %10, %7 ], [ 1, %1 ]
%6 = icmp ugt i8 %4, 20
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = zext i8 %4 to i64
%9 = add nsw i8 %4, -2
%10 = mul i64 %5, %8
%11 = icmp ult i8 %4, 4
br i1 %11, label %12, label %3
12: ; preds = %3, %7
%13 = phi i64 [ %10, %7 ], [ %5, %3 ]
%14 = phi i64 [ 1, %7 ], [ 0, %3 ]
%15 = mul nuw nsw i64 %14, %13
br label %16
16: ; preds = %12, %1
%17 = phi i64 [ %15, %12 ], [ 1, %1 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int, int);
int main() {
  int x = 10, y = 20;
  swap(x, y);
  printf("%d %d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <swap@plt>
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @swap(i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int UINT64_C(int);
uint64_t vid_to_vmstate_oid(uint32_t vid, uint32_t idx) {
  return (UINT64_C(1) << 62) | ((uint64_t)vid << 32) | idx;
}


x86 assembly (clang, -O0):
<vid_to_vmstate_oid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    $0x3e,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vid_to_vmstate_oid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @UINT64_C(i32 1)
%6 = shl i32 %5, 62
%7 = load i32, i32* %3
%8 = shl i32 %7, 32
%9 = or i32 %6, %8
%10 = load i32, i32* %4
%11 = or i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @vid_to_vmstate_oid(i32 %0, i32 %1) {
%3 = tail call i32 @UINT64_C(i32 1)
ret i32 poison
}
int cairo_code_draw_casFMLabel_get_width() { return 145; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casFMLabel_get_width() {
ret i32 145
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casFMLabel_get_width() {
ret i32 145
}
void __malloc_unlock() {}


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

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

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

LLVM IR (-O2):
define void @__malloc_unlock() {
ret void
}