xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
__attribute__((malloc, nonnull(1))) char *cn_strdup(const char *str) {
  size_t strsize;
  char *ret;
  strsize = strlen(str) + 1;
  ret = (char *)malloc(strsize);
  if (ret != NULL)
    memcpy(ret, str, strsize);
  return (ret);
}


x86 assembly (clang, -O0):
<cn_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <cn_strdup+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cn_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <cn_strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @cn_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %8, %1
ret i8* %6
}
int sumByReference(int *pa, int *pb) { return (*pa + *pb); }


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

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

LLVM IR (-O0):
define i32 @sumByReference(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @sumByReference(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
struct task_io_accounting {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ task_blk_io_accounting_add(struct task_io_accounting *,
                                              struct task_io_accounting *);
int /*<<< orphan*/ task_chr_io_accounting_add(struct task_io_accounting *,
                                              struct task_io_accounting *);
void task_io_accounting_add(struct task_io_accounting *dst,
                            struct task_io_accounting *src) {
  task_chr_io_accounting_add(dst, src);
  task_blk_io_accounting_add(dst, src);
}


x86 assembly (clang, -O0):
<task_io_accounting_add>:
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 <task_chr_io_accounting_add@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <task_blk_io_accounting_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_io_accounting_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <task_chr_io_accounting_add@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <task_blk_io_accounting_add@plt>

LLVM IR (-O0):
%struct.task_io_accounting = type { i32 }
define void @task_io_accounting_add(%struct.task_io_accounting* %0, %struct.task_io_accounting* %1) {
%3 = alloca %struct.task_io_accounting*
%4 = alloca %struct.task_io_accounting*
store %struct.task_io_accounting* %0, %struct.task_io_accounting** %3
store %struct.task_io_accounting* %1, %struct.task_io_accounting** %4
%5 = load %struct.task_io_accounting*, %struct.task_io_accounting** %3
%6 = load %struct.task_io_accounting*, %struct.task_io_accounting** %4
%7 = call i32 @task_chr_io_accounting_add(%struct.task_io_accounting* %5, %struct.task_io_accounting* %6)
%8 = load %struct.task_io_accounting*, %struct.task_io_accounting** %3
%9 = load %struct.task_io_accounting*, %struct.task_io_accounting** %4
%10 = call i32 @task_blk_io_accounting_add(%struct.task_io_accounting* %8, %struct.task_io_accounting* %9)
ret void
}

LLVM IR (-O2):
%struct.task_io_accounting = type { i32 }
define void @task_io_accounting_add(%struct.task_io_accounting* %0, %struct.task_io_accounting* %1) {
%3 = tail call i32 @task_chr_io_accounting_add(%struct.task_io_accounting* %0, %struct.task_io_accounting* %1)
%4 = tail call i32 @task_blk_io_accounting_add(%struct.task_io_accounting* %0, %struct.task_io_accounting* %1)
ret void
}
unsigned long b_disk_write(void *mem, unsigned long start, unsigned long num,
                           unsigned long disknum) {
  unsigned long tlong = 0;
  asm volatile("call *0x00100068"
               : "=c"(tlong)
               : "a"(start), "c"(num), "d"(disknum), "S"(mem));
  return tlong;
}


x86 assembly (clang, -O0):
<b_disk_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rsi
call   *0x100068
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_disk_write>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %r8,%rdx
mov    %rdi,%rsi
call   *0x100068
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_disk_write(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
store i64 0, i64* %9
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = load i8*, i8** %5
%14 = call i64 asm sideeffect "call *0x00100068", "={cx},{ax},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11, i64 %12, i8* %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @b_disk_write(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm sideeffect "call *0x00100068", "={cx},{ax},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i64 %1, i64 %2, i64 %3, i8* %0)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getstr(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printstr(char *);
int main() {
  char *string;
  string = getstr(string);
  printf("------------\n");
  printstr(string);
  free(string);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1050 <getstr@plt>
mov    %rax,%rbx
lea    0xeb0(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <printstr@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [13 x i8] c"------------\00"
define i32 @main() {
%1 = tail call i8* @getstr(i8* undef)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printstr(i8* %1)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
void msg_convert_response_head(struct msg_response_head *response_head) {}


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

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

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

LLVM IR (-O2):
%struct.msg_response_head = type opaque
define void @msg_convert_response_head(%struct.msg_response_head* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int str_util_cpy(char *dest, const char *from) {
  if (from == NULL || dest == NULL) {
    return 0;
  }
  strcpy(dest, from);
  return 0;
}


x86 assembly (clang, -O0):
<str_util_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1136 <str_util_cpy+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    1142 <str_util_cpy+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1156 <str_util_cpy+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_util_cpy>:
test   %rdi,%rdi
je     1124 <str_util_cpy+0x14>
test   %rsi,%rsi
je     1124 <str_util_cpy+0x14>
push   %rax
call   1030 <strcpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_util_cpy(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = icmp eq i8* %0, null
%5 = or i1 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
ret i32 0
}
/* Variables and functions */
size_t FSE_count_parallel(unsigned int *, unsigned int *, void const *, size_t,
                          int /*<<< orphan*/);
size_t FSE_count_simple(unsigned int *, unsigned int *, void const *, size_t);
size_t FSE_countFast(unsigned *count, unsigned *maxSymbolValuePtr,
                     const void *source, size_t sourceSize) {
  if (sourceSize < 1500)
    return FSE_count_simple(count, maxSymbolValuePtr, source, sourceSize);
  return FSE_count_parallel(count, maxSymbolValuePtr, source, sourceSize, 0);
}


x86 assembly (clang, -O0):
<FSE_countFast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x5dc,-0x28(%rbp)
jae    1164 <FSE_countFast+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <FSE_count_simple@plt>
mov    %rax,-0x8(%rbp)
jmp    1180 <FSE_countFast+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <FSE_count_parallel@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FSE_countFast>:
cmp    $0x5db,%rcx
ja     112e <FSE_countFast+0xe>
jmp    1040 <FSE_count_simple@plt>
xor    %r8d,%r8d
jmp    1030 <FSE_count_parallel@plt>

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

LLVM IR (-O2):
define i64 @FSE_countFast(i32* %0, i32* %1, i8* %2, i64 %3) {
%5 = icmp ult i64 %3, 1500
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i64 @FSE_count_simple(i32* %0, i32* %1, i8* %2, i64 %3)
br label %10
8: ; preds = %4
%9 = tail call i64 @FSE_count_parallel(i32* %0, i32* %1, i8* %2, i64 %3, i32 0)
br label %10
10: ; preds = %8, %6
%11 = phi i64 [ %7, %6 ], [ %9, %8 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0Toggle();
void BlinkC__Leds__led0Toggle(void) { LedsP__Leds__led0Toggle(); }


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

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

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

LLVM IR (-O2):
define void @BlinkC__Leds__led0Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led0Toggle()
ret void
}
OP(dd, dc) { op_dc(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_dc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_dc()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lcd_task() { printf("lcd_task\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"lcd_task\00"
define void @lcd_task() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
void ext2_set_bit(void *addr, unsigned int i) {
  unsigned char *v = addr;
  v += i >> 3;
  *v |= 1 << (7 - (i % 8));
}


x86 assembly (clang, -O0):
<ext2_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
mov    $0x7,%ecx
sub    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2_set_bit>:
mov    %esi,%ecx
mov    %esi,%eax
not    %cl
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
shr    $0x3,%rax
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @ext2_set_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
%9 = load i8*, i8** %5
%10 = zext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %5
%12 = load i32, i32* %4
%13 = urem i32 %12, 8
%14 = sub i32 7, %13
%15 = shl i32 1, %14
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, %15
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @ext2_set_bit(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = and i32 %1, 7
%7 = xor i32 %6, 7
%8 = shl nuw i32 1, %7
%9 = load i8, i8* %5
%10 = trunc i32 %8 to i8
%11 = or i8 %9, %10
store i8 %11, i8* %5
ret void
}
void set_block_unused(unsigned char *block_bitmap, int blocknum) {
  unsigned char bm;
  bm = block_bitmap[blocknum / 8];
  bm |= (0x80 >> (blocknum % 8));
  bm ^= (0x80 >> (blocknum % 8));
  block_bitmap[blocknum / 8] = bm;
}


x86 assembly (clang, -O0):
<set_block_unused>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x80,%eax
sar    %cl,%eax
mov    %eax,%ecx
movzbl -0xd(%rbp),%eax
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x80,%eax
sar    %cl,%eax
mov    %eax,%ecx
movzbl -0xd(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x19(%rbp),%dl
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_block_unused>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
and    $0x7,%cl
mov    $0x80,%edx
shr    %cl,%edx
not    %dl
and    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @set_block_unused(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = ashr i32 128, %13
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = or i32 %16, %14
%18 = trunc i32 %17 to i8
store i8 %18, i8* %5
%19 = load i32, i32* %4
%20 = srem i32 %19, 8
%21 = ashr i32 128, %20
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = xor i32 %23, %21
%25 = trunc i32 %24 to i8
store i8 %25, i8* %5
%26 = load i8, i8* %5
%27 = load i8*, i8** %3
%28 = load i32, i32* %4
%29 = sdiv i32 %28, 8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %27, i64 %30
store i8 %26, i8* %31
ret void
}

LLVM IR (-O2):
define void @set_block_unused(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = and i32 %1, 7
%8 = lshr i32 128, %7
%9 = trunc i32 %8 to i8
%10 = xor i8 %9, -1
%11 = and i8 %6, %10
store i8 %11, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fdmi_err(char *, char *, char *, int);
void fdmi_test(void *ptr, char *file, char *func, int line) {
  if (ptr == NULL) {
    fdmi_err("NULL POINTER EXCEPTION (%s:%s:%d)", file, func, line);
  }
}


x86 assembly (clang, -O0):
<fdmi_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1149 <fdmi_test+0x39>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xebc(%rip),%rdi
call   1030 <fdmi_err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdmi_test>:
test   %rdi,%rdi
je     1116 <fdmi_test+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <fdmi_err@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"NULL POINTER EXCEPTION (%s:%s:%d)\00"
define void @fdmi_test(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @fdmi_err(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i32 %14)
br label %16
16: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"NULL POINTER EXCEPTION (%s:%s:%d)\00"
define void @fdmi_test(i8* readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @fdmi_err(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i32 %3)
br label %8
8: ; preds = %6, %4
ret void
}
int gcd(int a, int b) {
  int l, h;
  int tmp;
  h = a > b ? a : b;
  l = a < b ? a : b;
  while (h % l > 0) {
    tmp = l;
    l = h % l;
    h = tmp;
  }
  return l;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <gcd+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1127 <gcd+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1144 <gcd+0x44>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    114a <gcd+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jle    117b <gcd+0x7b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1150 <gcd+0x50>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
cmp    %esi,%edi
mov    %esi,%eax
cmovg  %edi,%eax
cmovl  %edi,%edx
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = icmp slt i32 %0, %1
%6 = select i1 %5, i32 %0, i32 %1
br label %7
7: ; preds = %7, %2
%8 = phi i32 [ %4, %2 ], [ %9, %7 ]
%9 = phi i32 [ %6, %2 ], [ %10, %7 ]
%10 = srem i32 %8, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7
ret i32 %9
}
/* Variables and functions */
int move(char const *, char const *);
int rename(const char *old, const char *new) { return move(old, new); }


x86 assembly (clang, -O0):
<rename>:
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 <move@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
jmp    1030 <move@plt>

LLVM IR (-O0):
define i32 @rename(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 @move(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rename(i8* %0, i8* %1) {
%3 = tail call i32 @move(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *appli) {
  printf("%s have to be started with the port number to listen to\n", appli);
  printf("example: %s 10000 (debug_level)   will start a server that listen on "
         "the port 10000 with the debug level in option\n",
         appli);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"%s have to be started with the port number to listen to\0A\00"
@.str.1 = [116 x i8] c"example: %s 10000 (debug_level) will start a server that listen on the port 10000 with the debug level in option\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [57 x i8] c"%s have to be started with the port number to listen to\0A\00"
@.str.1 = [116 x i8] c"example: %s 10000 (debug_level) will start a server that listen on the port 10000 with the debug level in option\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
extern float singlesum12(float x1, float x2, float x3, float x4, float x5,
                         float x6, float x7, float x8, float x9, float x10,
                         float x11, float x12) {
  return x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12;
}


x86 assembly (clang, -O0):
<singlesum12>:
push   %rbp
mov    %rsp,%rbp
movss  0x28(%rbp),%xmm8
movss  0x20(%rbp),%xmm8
movss  0x18(%rbp),%xmm8
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
addss  0x10(%rbp),%xmm0
addss  0x18(%rbp),%xmm0
addss  0x20(%rbp),%xmm0
addss  0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<singlesum12>:
addss  %xmm1,%xmm0
addss  %xmm2,%xmm0
addss  %xmm3,%xmm0
addss  %xmm4,%xmm0
addss  %xmm5,%xmm0
addss  %xmm6,%xmm0
addss  %xmm7,%xmm0
addss  0x8(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
addss  0x18(%rsp),%xmm0
addss  0x20(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @singlesum12(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11) {
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
store float %0, float* %13
store float %1, float* %14
store float %2, float* %15
store float %3, float* %16
store float %4, float* %17
store float %5, float* %18
store float %6, float* %19
store float %7, float* %20
store float %8, float* %21
store float %9, float* %22
store float %10, float* %23
store float %11, float* %24
%25 = load float, float* %13
%26 = load float, float* %14
%27 = fadd float %25, %26
%28 = load float, float* %15
%29 = fadd float %27, %28
%30 = load float, float* %16
%31 = fadd float %29, %30
%32 = load float, float* %17
%33 = fadd float %31, %32
%34 = load float, float* %18
%35 = fadd float %33, %34
%36 = load float, float* %19
%37 = fadd float %35, %36
%38 = load float, float* %20
%39 = fadd float %37, %38
%40 = load float, float* %21
%41 = fadd float %39, %40
%42 = load float, float* %22
%43 = fadd float %41, %42
%44 = load float, float* %23
%45 = fadd float %43, %44
%46 = load float, float* %24
%47 = fadd float %45, %46
ret float %47
}

LLVM IR (-O2):
define float @singlesum12(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11) {
%13 = fadd float %0, %1
%14 = fadd float %13, %2
%15 = fadd float %14, %3
%16 = fadd float %15, %4
%17 = fadd float %16, %5
%18 = fadd float %17, %6
%19 = fadd float %18, %7
%20 = fadd float %19, %8
%21 = fadd float %20, %9
%22 = fadd float %21, %10
%23 = fadd float %22, %11
ret float %23
}
float absoluteValue(float x) {
  if (x < 0)
    x = -x;
  return x;
}


x86 assembly (clang, -O0):
<absoluteValue>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <absoluteValue+0x2d>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absoluteValue>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @absoluteValue(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
store float %7, float* %2
br label %8
8: ; preds = %5, %1
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @absoluteValue(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
void expand(str) char *str;
{
  static char a[(4096)];
  static char b[(4096)];
  char *p = str;
  int len = (4096) - 1;
  strcpy(a, str);
  doexp(&p, a, &len, b);
}


x86 assembly (clang, -O0):
<expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0xfff,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2efa(%rip),%rdi
call   1030 <strcpy@plt>
lea    -0x10(%rbp),%rdi
lea    0x2eea(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    0x3edf(%rip),%rcx
mov    $0x0,%al
call   1040 <doexp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
mov    %rdi,0x8(%rsp)
movl   $0xfff,0x4(%rsp)
lea    0x2f04(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0x3ef5(%rip),%rcx
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <doexp@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@expand.a = internal global [4096 x i8] zeroinitializer
@expand.b = internal global [4096 x i8] zeroinitializer
define void @expand(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
store i32 4095, i32* %4
%6 = load i8*, i8** %2
%7 = call i8* @strcpy(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @expand.a, i64 0, i64 0), i8* %6)
%8 = call i32 (i8**, i8*, i32*, i8*, ...) bitcast (i32 (...)* @doexp to i32 (i8**, i8*, i32*, i8*, ...)*)(i8** %3, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @expand.a, i64 0, i64 0), i32* %4, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @expand.b, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@expand.a = internal global [4096 x i8] zeroinitializer
@expand.b = internal global [4096 x i8] zeroinitializer
define void @expand(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%5 = bitcast i32* %3 to i8*
store i32 4095, i32* %3
%6 = tail call i8* @strcpy(i8* dereferenceable(1) getelementptr inbounds ([4096 x i8], [4096 x i8]* @expand.a, i64 0, i64 0), i8* dereferenceable(1) %0)
%7 = call i32 (i8**, i8*, i32*, i8*, ...) bitcast (i32 (...)* @doexp to i32 (i8**, i8*, i32*, i8*, ...)*)(i8** %2, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @expand.a, i64 0, i64 0), i32* %3, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @expand.b, i64 0, i64 0))
ret void
}
void msm_jtag_restore_state(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_jtag_restore_state() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *Value(int n) {
  static char buf[512];
  snprintf(buf, 512, "%d", n);
  return buf;
}


x86 assembly (clang, -O0):
<Value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x200,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Value>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@Value.buf = internal global [512 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @Value(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @Value.buf, i64 0, i64 0), i32 512, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @Value.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@Value.buf = internal global [512 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @Value(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @Value.buf, i64 0, i64 0), i32 512, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @Value.buf, i64 0, i64 0)
}
int test_imm_14int32_reg(int val) { return ((val) & (0x14 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_14int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x14,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_14int32_reg(i32 %0) {
%2 = and i32 %0, 20
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dsfmt_gv_fill_array_close_open(double *, long);
void fill_array_close_open(double array[], long size) {
  dsfmt_gv_fill_array_close_open(array, size);
}


x86 assembly (clang, -O0):
<fill_array_close_open>:
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 <dsfmt_gv_fill_array_close_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_array_close_open>:
jmp    1030 <dsfmt_gv_fill_array_close_open@plt>

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

LLVM IR (-O2):
define void @fill_array_close_open(double* %0, i64 %1) {
%3 = tail call i32 @dsfmt_gv_fill_array_close_open(double* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
unsigned char CheckId_SP80818(void) {
  unsigned char temp1;
  unsigned char temp2;
  VIM_SIF_I2cReadByte(0x02, &temp1);
  VIM_SIF_I2cReadByte(0x02, &temp2);
  if ((temp1 == 0x24) && (temp2 == 0x24)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<CheckId_SP80818>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    $0x2,%edi
lea    -0x3(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x24,%eax
jne    1157 <CheckId_SP80818+0x47>
movzbl -0x3(%rbp),%eax
cmp    $0x24,%eax
jne    1157 <CheckId_SP80818+0x47>
movb   $0x1,-0x1(%rbp)
jmp    115b <CheckId_SP80818+0x4b>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckId_SP80818>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x2,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
lea    0x6(%rsp),%rsi
mov    $0x2,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0x7(%rsp),%al
xor    $0x24,%al
mov    0x6(%rsp),%cl
xor    $0x24,%cl
or     %al,%cl
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i8 @CheckId_SP80818() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 2, i8* %1)
%4 = call i32 @VIM_SIF_I2cReadByte(i32 2, i8* %2)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 36
%7 = load i8, i8* %2
%8 = icmp eq i8 %7, 36
%9 = select i1 %6, i1 %8, i1 false
%10 = zext i1 %9 to i8
ret i8 %10
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ testBit(unsigned long long, int);
void setBit(uint64_t *bb, int i) {
  assert(!testBit(*bb, i));
  *bb ^= 1ull << i;
}


x86 assembly (clang, -O0):
<setBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%esi
call   1040 <testBit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1040 <testBit@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%rax
xor    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @setBit(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i32, i32* %4
%8 = call i32 @testBit(i64 %6, i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %4
%14 = zext i32 %13 to i64
%15 = shl i64 1, %14
%16 = load i64*, i64** %3
%17 = load i64, i64* %16
%18 = xor i64 %17, %15
store i64 %18, i64* %16
ret void
}

LLVM IR (-O2):
define void @setBit(i64* nocapture %0, i32 %1) {
%3 = load i64, i64* %0
%4 = tail call i32 @testBit(i64 %3, i32 %1)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = zext i32 %1 to i64
%9 = shl nuw i64 1, %8
%10 = load i64, i64* %0
%11 = xor i64 %10, %9
store i64 %11, i64* %0
ret void
}
/* Variables and functions */
double trunc(double);
double intr_wrap_328(double p1) { return trunc(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_328>:
jmp    1030 <trunc@plt>

LLVM IR (-O0):
define double @intr_wrap_328(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.trunc.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @intr_wrap_328(double %0) {
%2 = tail call double @llvm.trunc.f64(double %0)
ret double %2
}
float getPercentage(unsigned int concept, unsigned int totalValue) {
  return ((float)concept / totalValue) * 100;
}


x86 assembly (clang, -O0):
<getPercentage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
movss  0xeda(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPercentage>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mov    %esi,%eax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
mulss  0xee6(%rip),%xmm0
ret

LLVM IR (-O0):
define float @getPercentage(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 = uitofp i32 %5 to float
%7 = load i32, i32* %4
%8 = uitofp i32 %7 to float
%9 = fdiv float %6, %8
%10 = fmul float %9, 1.000000e+02
ret float %10
}

LLVM IR (-O2):
define float @getPercentage(i32 %0, i32 %1) {
%3 = uitofp i32 %0 to float
%4 = uitofp i32 %1 to float
%5 = fdiv float %3, %4
%6 = fmul float %5, 1.000000e+02
ret float %6
}
void writeA(double *a) {}


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

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

LLVM IR (-O0):
define void @writeA(double* %0) {
%2 = alloca double*
store double* %0, double** %2
ret void
}

LLVM IR (-O2):
define void @writeA(double* nocapture %0) {
ret void
}
void init_hitcache(void) {}


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

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

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

LLVM IR (-O2):
define void @init_hitcache() {
ret void
}
/* Variables and functions */
int reverseNum(int);
int isPalin(int num) {
  if (num == reverseNum(num)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isPalin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <reverseNum@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jne    1142 <isPalin+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <isPalin+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalin>:
push   %rbx
mov    %edi,%ebx
call   1030 <reverseNum@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isPalin(i32 %0) {
%2 = tail call i32 @reverseNum(i32 %0)
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct dynamic_array {
  int dummy;
};

/* Variables and functions */
int da_precise_create(struct dynamic_array *, int, int);
int da_create(struct dynamic_array *ar) { return da_precise_create(ar, 8, 2); }


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

x86 assembly (clang, -O2):
<da_create>:
mov    $0x8,%esi
mov    $0x2,%edx
jmp    1030 <da_precise_create@plt>

LLVM IR (-O0):
%struct.dynamic_array = type { i32 }
define i32 @da_create(%struct.dynamic_array* %0) {
%2 = alloca %struct.dynamic_array*
store %struct.dynamic_array* %0, %struct.dynamic_array** %2
%3 = load %struct.dynamic_array*, %struct.dynamic_array** %2
%4 = call i32 @da_precise_create(%struct.dynamic_array* %3, i32 8, i32 2)
ret i32 %4
}

LLVM IR (-O2):
%struct.dynamic_array = type { i32 }
define i32 @da_create(%struct.dynamic_array* %0) {
%2 = tail call i32 @da_precise_create(%struct.dynamic_array* %0, i32 8, i32 2)
ret i32 %2
}
int int_digits(int n) {
  int d = 1;
  while (n) {
    n /= 10;
    d++;
  }
  return d;
}


x86 assembly (clang, -O0):
<int_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <int_digits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <int_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_digits>:
mov    $0x1,%eax
test   %edi,%edi
je     1132 <int_digits+0x32>
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <int_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %11
}