xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x1c() {
  Assert_real((isupper(28) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              145, ("isupper should be 0 for 0x1c"));
}


x86 assembly (clang, -O0):
<t_isupper_0x1c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x91,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x1c>:
push   %rax
mov    $0x1c,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x91,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x1c\00"
define void @t_isupper_0x1c() {
%1 = call i64 @isupper(i32 28)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x1c\00"
define void @t_isupper_0x1c() {
%1 = tail call i64 @isupper(i32 28)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int rand_beebs() {
  static long int seed = 0;
  seed = (seed * 1103515245L + 12345) & ((1UL << 31) - 1);
  return (int)(seed >> 16);
}


x86 assembly (clang, -O0):
<rand_beebs>:
push   %rbp
mov    %rsp,%rbp
imul   $0x41c64e6d,0x2f19(%rip),%rax
6d 4e c6 41
add    $0x3039,%rax
and    $0x7fffffff,%rax
mov    %rax,0x2f06(%rip)
mov    0x2eff(%rip),%rax
sar    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_beebs>:
imul   $0x41c64e6d,0x2f1e(%rip),%eax
4e c6 41
add    $0x3039,%eax
and    $0x7fffffff,%eax
mov    %rax,0x2f0d(%rip)
shr    $0x10,%rax
ret

LLVM IR (-O0):
@rand_beebs.seed = internal global i64 0
define i32 @rand_beebs() {
%1 = load i64, i64* @rand_beebs.seed
%2 = mul nsw i64 %1, 1103515245
%3 = add nsw i64 %2, 12345
%4 = and i64 %3, 2147483647
store i64 %4, i64* @rand_beebs.seed
%5 = load i64, i64* @rand_beebs.seed
%6 = ashr i64 %5, 16
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@rand_beebs.seed = internal unnamed_addr global i64 0
define i32 @rand_beebs() {
%1 = load i64, i64* @rand_beebs.seed
%2 = mul nsw i64 %1, 1103515245
%3 = add nsw i64 %2, 12345
%4 = and i64 %3, 2147483647
store i64 %4, i64* @rand_beebs.seed
%5 = lshr i64 %4, 16
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int signatures_ok(uint8_t *store_hash) {
  (void)store_hash;
  return false;
}


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

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

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

LLVM IR (-O2):
define i32 @signatures_ok(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int sha1_self_test() {
  printf("SHA-1 self-test not available\n\n");
  return (1);
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"SHA-1 self-test not available\0A\0A\00"
define i32 @sha1_self_test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [31 x i8] c"SHA-1 self-test not available\0A\00"
define i32 @sha1_self_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int Cyc_block_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_block(struct Cyc_Lexing_lexbuf *lexbuf) {
  int _T0;
  _T0 = Cyc_block_rec(lexbuf, 16);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_block>:
mov    $0x10,%esi
jmp    1030 <Cyc_block_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_block(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_block_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 16)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_block(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_block_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 16)
ret i32 %2
}
int main(void) {
  int i = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int age(char *);
int /*<<< orphan*/ get_parameter(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int function_age(char *age_str, char *line) {
  char birth_date[128];
  get_parameter(birth_date, line, 0);
  sprintf(age_str, "%d", age(birth_date));
  return 1;
}


x86 assembly (clang, -O0):
<function_age>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <get_parameter@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
call   1040 <age@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%edx
lea    0xe84(%rip),%rsi
call   1050 <sprintf@plt>
mov    $0x1,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_age>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %edx,%edx
call   1030 <get_parameter@plt>
mov    %r14,%rdi
call   1040 <age@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    $0x1,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @function_age(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @get_parameter(i8* %6, i8* %7, i32 0)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i32 @age(i8* %10)
%12 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 1
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @function_age(i8* nocapture writeonly %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @get_parameter(i8* %4, i8* %1, i32 0)
%6 = call i32 @age(i8* %4)
%7 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 1
}
void CcsScanner_AddDestruct(void *additional) {}


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

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

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

LLVM IR (-O2):
define void @CcsScanner_AddDestruct(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int index2bb(int);
char getEpSquare(int leaving) {
  if (index2bb(leaving) & (0x000000000000FF00))
    return leaving + 8;
  if (index2bb(leaving) & (0x00FF000000000000))
    return leaving - 8;
  return -1;
}


x86 assembly (clang, -O0):
<getEpSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <index2bb@plt>
and    $0xff00,%eax
cmp    $0x0,%eax
je     113f <getEpSquare+0x2f>
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    %al,-0x1(%rbp)
jmp    1172 <getEpSquare+0x62>
mov    -0x8(%rbp),%edi
call   1030 <index2bb@plt>
cltq
movabs $0xff000000000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     116e <getEpSquare+0x5e>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
mov    %al,-0x1(%rbp)
jmp    1172 <getEpSquare+0x62>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEpSquare>:
push   %rbx
mov    %edi,%ebx
call   1030 <index2bb@plt>
test   $0xff00,%eax
je     1124 <getEpSquare+0x14>
add    $0x8,%bl
jmp    1143 <getEpSquare+0x33>
mov    %ebx,%edi
call   1030 <index2bb@plt>
cltq
movabs $0xff000000000000,%rcx
test   %rcx,%rax
je     1141 <getEpSquare+0x31>
add    $0xf8,%bl
jmp    1143 <getEpSquare+0x33>
mov    $0xff,%bl
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @getEpSquare(i32 %0) {
%2 = tail call i32 @index2bb(i32 %0)
%3 = and i32 %2, 65280
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = trunc i32 %0 to i8
%7 = add i8 %6, 8
br label %16
8: ; preds = %1
%9 = tail call i32 @index2bb(i32 %0)
%10 = sext i32 %9 to i64
%11 = and i64 %10, 71776119061217280
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = trunc i32 %0 to i8
%15 = add i8 %14, -8
br label %16
16: ; preds = %8, %13, %5
%17 = phi i8 [ %7, %5 ], [ %15, %13 ], [ -1, %8 ]
ret i8 %17
}
__attribute__((used)) int raise(int sig_no __attribute__((unused))) {
  do {
    libc_fatal(
        "Code is unreachable",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/qdk0901/iotjs-openwrt/refs/heads/master/"
        "deps/jerry/jerry-libc/target/darwin/jerry-libc-target.c",
        __func__, 34);
  } while (0);
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xf9e(%rip),%rdx
mov    $0x22,%ecx
mov    $0x0,%al
call   1030 <libc_fatal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
lea    0xee9(%rip),%rdi
lea    0xef6(%rip),%rsi
lea    0xfa9(%rip),%rdx
mov    $0x22,%ecx
xor    %eax,%eax
jmp    1030 <libc_fatal@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Code is unreachable\00"
@.str.1 = [186 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/qdk0901/iotjs-openwrt/refs/heads/master/deps/jerry/jerry-libc/target/darwin/jerry-libc-target.c\00"
@__func__.raise = [6 x i8] c"raise\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @raise to i8*)], section "llvm.metadata"
define i32 @raise(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %1
%5 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @libc_fatal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.raise, i64 0, i64 0), i32 34)
br label %6
6: ; preds = %4
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [20 x i8] c"Code is unreachable\00"
@.str.1 = [186 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/qdk0901/iotjs-openwrt/refs/heads/master/deps/jerry/jerry-libc/target/darwin/jerry-libc-target.c\00"
@__func__.raise = [6 x i8] c"raise\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @raise to i8*)], section "llvm.metadata"
define i32 @raise(i32 %0) {
%2 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @libc_fatal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.raise, i64 0, i64 0), i32 34)
ret i32 undef
}
int ordering_err_2(void) {
  return ((int)-(((int)0x37EE)
                 << (8 *
                     (((!!(((!!(sizeof(int))) * ((sizeof(int)) - 1)))) *
                       ((((!!(sizeof(int))) * ((sizeof(int)) - 1))) - 1))))));
}


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

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

LLVM IR (-O0):
define i32 @ordering_err_2() {
ret i32 -938344448
}

LLVM IR (-O2):
define i32 @ordering_err_2() {
ret i32 -938344448
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char name[30];
  printf("Enter name: ");
  gets(name);
  printf("Name: ");
  puts(name);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Enter name: \00"
@.str.1 = [7 x i8] c"Name: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Enter name: \00"
@.str.1 = [7 x i8] c"Name: \00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int somaElementos(int *, int);
int main() {
  int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  printf("A soma dos elementos do vetor eh: %d", somaElementos(arr, 9));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1050 <somaElementos@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <somaElementos@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [37 x i8] c"A soma dos elementos do vetor eh: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @somaElementos(i32* %4, i32 9)
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [37 x i8] c"A soma dos elementos do vetor eh: %d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @somaElementos(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int intmax_t;

/* Variables and functions */
int countDigits(intmax_t input) {
  int result = 0;
  while (input > 0) {
    input /= 10;
    result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<countDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <countDigits+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 <countDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <countDigits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <countDigits+0x10>
ret

LLVM IR (-O0):
define i32 @countDigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt 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 @countDigits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
                             void *data) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.notifier_block = type opaque
define i32 @kprobe_exceptions_notify(%struct.notifier_block* %0, i64 %1, i8* %2) {
%4 = alloca %struct.notifier_block*
%5 = alloca i64
%6 = alloca i8*
store %struct.notifier_block* %0, %struct.notifier_block** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @kprobe_exceptions_notify(%struct.notifier_block* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int ope_init();
int bcm_init(void) { return ope_init(); }


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

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

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

LLVM IR (-O2):
define i32 @bcm_init() {
%1 = tail call i32 (...) @ope_init()
ret i32 %1
}
void account_system_time_scaled(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<account_system_time_scaled>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<account_system_time_scaled>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.account_system_time_scaled = [27 x i8] c"account_system_time_scaled\00"
define void @account_system_time_scaled() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.account_system_time_scaled, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.account_system_time_scaled = [27 x i8] c"account_system_time_scaled\00"
define void @account_system_time_scaled() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.account_system_time_scaled, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
f() { puts("hello world!"); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world!\00"
define i32 @f() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
define i32 @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef char *uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint64_t rdmsr(uint32_t msr) {
  uint64_t rv;
  __asm__ __volatile__("rdmsr" : "=A"(rv) : "c"(msr));
  return (rv);
}


x86 assembly (clang, -O0):
<rdmsr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
rdmsr
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdmsr>:
mov    %edi,%ecx
rdmsr
ret

LLVM IR (-O0):
define i8* @rdmsr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @rdmsr(i32 %0) {
%2 = tail call i8* asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash_int32(uint32_t a) {
  a = a ^ (a >> 4);
  a = (a ^ 0xdeadbeef) + (a << 5);
  a = a ^ (a >> 11);
  return a;
}


x86 assembly (clang, -O0):
<hash_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xdeadbeef,%eax
mov    -0x4(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xb,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_int32>:
mov    %edi,%ecx
sar    $0x4,%ecx
xor    %edi,%ecx
mov    %ecx,%eax
xor    $0xdeadbeef,%eax
shl    $0x5,%ecx
add    %eax,%ecx
mov    %ecx,%eax
sar    $0xb,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash_int32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 4
%6 = xor i32 %3, %5
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = xor i32 %7, -559038737
%9 = load i32, i32* %2
%10 = shl i32 %9, 5
%11 = add i32 %8, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 11
%15 = xor i32 %12, %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @hash_int32(i32 %0) {
%2 = ashr i32 %0, 4
%3 = xor i32 %2, %0
%4 = xor i32 %3, -559038737
%5 = shl i32 %3, 5
%6 = add i32 %4, %5
%7 = ashr i32 %6, 11
%8 = xor i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void realloc() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @realloc() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function();
int /*<<< orphan*/ function2();
int main(int argc, char *argv[]) {
  function();
  function2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <function@plt>
mov    $0x0,%al
call   1030 <function2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <function@plt>
xor    %eax,%eax
call   1030 <function2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @function()
%4 = tail call i32 (...) @function2()
ret i32 0
}
float Function2Float(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<Function2Float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Function2Float>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Function2Float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @Function2Float(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int rc) {
  printf("usage: setmac [-hs?] [OPTION]...\n"
         "\t-b <base-mac>\n"
         "\t-s\n"
         "\t-f <flash-device>\n"
         "\t-m <mtd-name>\n"
         "\t-n <num-eth-interfaces>\n"
         "\t-o <offset>\n"
         "\t-p\n"
         "\t-u\n"
         "\t-i interface[,interface[,interface[,...]]]\n"
         "\t-r <redboot-config-name>\n");
  exit(rc);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [203 x i8] c"usage: setmac [-hs?] [OPTION]...\0A\09-b <base-mac>\0A\09-s\0A\09-f <flash-device>\0A\09-m <mtd-name>\0A\09-n <num-eth-interfaces>\0A\09-o <offset>\0A\09-p\0A\09-u\0A\09-i interface[,interface[,interface[,...]]]\0A\09-r <redboot-config-name>\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([203 x i8], [203 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [202 x i8] c"usage: setmac [-hs?] [OPTION]...\0A\09-b <base-mac>\0A\09-s\0A\09-f <flash-device>\0A\09-m <mtd-name>\0A\09-n <num-eth-interfaces>\0A\09-o <offset>\0A\09-p\0A\09-u\0A\09-i interface[,interface[,interface[,...]]]\0A\09-r <redboot-config-name>\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([202 x i8], [202 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cgand();
int /*<<< orphan*/ cgpop2();
int /*<<< orphan*/ gentext();
void genand(void) {
  gentext();
  cgpop2();
  cgand();
}


x86 assembly (clang, -O0):
<genand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <gentext@plt>
mov    $0x0,%al
call   1030 <cgpop2@plt>
mov    $0x0,%al
call   1040 <cgand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genand>:
push   %rax
xor    %eax,%eax
call   1050 <gentext@plt>
xor    %eax,%eax
call   1030 <cgpop2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cgand@plt>

LLVM IR (-O0):
define void @genand() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @cgpop2()
%3 = call i32 (...) @cgand()
ret void
}

LLVM IR (-O2):
define void @genand() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @cgpop2()
%3 = tail call i32 (...) @cgand()
ret void
}
float fahrenheit2celsius(float fahrenheit) {
  return (fahrenheit - 32) * (5.0f / 9.0f);
}


x86 assembly (clang, -O0):
<fahrenheit2celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xede(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit2celsius>:
addss  0xef8(%rip),%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fahrenheit2celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 3.200000e+01
%5 = fmul float %4, 0x3FE1C71C80000000
ret float %5
}

LLVM IR (-O2):
define float @fahrenheit2celsius(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fmul float %2, 0x3FE1C71C80000000
ret float %3
}
unsigned int fmt_2digits(char *dest, int i) {
  dest[0] = (i / 10) + '0';
  dest[1] = (i % 10) + '0';
  return 2;
}


x86 assembly (clang, -O0):
<fmt_2digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_2digits>:
movslq %esi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    0x30(%rcx),%edx
mov    %dl,(%rdi)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,0x1(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @fmt_2digits(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 10
%7 = add nsw i32 %6, 48
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = srem i32 %11, 10
%13 = add nsw i32 %12, 48
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret i32 2
}

LLVM IR (-O2):
define i32 @fmt_2digits(i8* nocapture writeonly %0, i32 %1) {
%3 = sdiv i32 %1, 10
%4 = trunc i32 %3 to i8
%5 = add i8 %4, 48
store i8 %5, i8* %0
%6 = srem i32 %1, 10
%7 = trunc i32 %6 to i8
%8 = add nsw i8 %7, 48
%9 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %8, i8* %9
ret i32 2
}
/* Variables and functions */
int read_console();
int mygetchar() {
  int ret;
  do
    ret = read_console();
  while (ret == 0);
  return ret;
}


x86 assembly (clang, -O0):
<mygetchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <read_console@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1118 <mygetchar+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mygetchar>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_console@plt>
test   %eax,%eax
je     1120 <mygetchar+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mygetchar() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @read_console()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret i32 %2
}
void pramcache_load_page_cache(struct super_block *sb) {}


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define void @pramcache_load_page_cache(%struct.super_block* nocapture %0) {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  char *s = "123";
  int n = atoi(s);
  printf("%d\n", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 123)
ret i32 0
}
/* Type definitions */
typedef unsigned char u_int8_t;

/* Variables and functions */
u_int8_t get_r_opcode(unsigned char *pkt_buf) { return pkt_buf[1]; }


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

x86 assembly (clang, -O2):
<get_r_opcode>:
mov    0x1(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @get_r_opcode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @get_r_opcode(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  double i;
  for (i = 0; i != 10; i += 0.1) {
    printf("%.1f\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1150 <main+0x40>
jp     1150 <main+0x40>
jmp    1178 <main+0x68>
movsd  -0x18(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe9f(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    112e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xorpd  %xmm0,%xmm0
lea    0xef0(%rip),%rbx
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xebe(%rip),%xmm0
ucomisd 0xebe(%rip),%xmm0
jne    1120 <main+0x10>
jp     1120 <main+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.1f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %6
br label %7
7: ; preds = %13, %2
%8 = load double, double* %6
%9 = fcmp une double %8, 1.000000e+01
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load double, double* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
br label %13
13: ; preds = %10
%14 = load double, double* %6
%15 = fadd double %14, 1.000000e-01
store double %15, double* %6
br label %7
16: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.1f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi double [ 0.000000e+00, %2 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %4)
%6 = fadd double %4, 1.000000e-01
%7 = fcmp une double %6, 1.000000e+01
br i1 %7, label %3, label %8
8: ; preds = %3
ret i32 0
}
/* Type definitions */
struct usergetkey_args_info {
  int dummy;
};

/* Variables and functions */
int usergetkey_cmdline_parser2(int, char **, struct usergetkey_args_info *,
                               int /*<<< orphan*/, int, int);
int usergetkey_cmdline_parser(int argc, char **argv,
                              struct usergetkey_args_info *args_info) {
  return usergetkey_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<usergetkey_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <usergetkey_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usergetkey_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <usergetkey_cmdline_parser2@plt>

LLVM IR (-O0):
%struct.usergetkey_args_info = type { i32 }
define i32 @usergetkey_cmdline_parser(i32 %0, i8** %1, %struct.usergetkey_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.usergetkey_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.usergetkey_args_info* %2, %struct.usergetkey_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.usergetkey_args_info*, %struct.usergetkey_args_info** %6
%10 = call i32 @usergetkey_cmdline_parser2(i32 %7, i8** %8, %struct.usergetkey_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.usergetkey_args_info = type { i32 }
define i32 @usergetkey_cmdline_parser(i32 %0, i8** %1, %struct.usergetkey_args_info* %2) {
%4 = tail call i32 @usergetkey_cmdline_parser2(i32 %0, i8** %1, %struct.usergetkey_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
void lgtd_lifx_wire_enosys_packet_handler(
    struct lgtd_lifx_gateway *gw, const struct lgtd_lifx_packet_header *hdr,
    const void *pkt) {
  (void)gw;
  (void)hdr;
  (void)pkt;
}


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

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

LLVM IR (-O0):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
define void @lgtd_lifx_wire_enosys_packet_handler(%struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_packet_header* %1, i8* %2) {
%4 = alloca %struct.lgtd_lifx_gateway*
%5 = alloca %struct.lgtd_lifx_packet_header*
%6 = alloca i8*
store %struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_gateway** %4
store %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_header** %5
store i8* %2, i8** %6
%7 = load %struct.lgtd_lifx_gateway*, %struct.lgtd_lifx_gateway** %4
%8 = load %struct.lgtd_lifx_packet_header*, %struct.lgtd_lifx_packet_header** %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
define void @lgtd_lifx_wire_enosys_packet_handler(%struct.lgtd_lifx_gateway* nocapture %0, %struct.lgtd_lifx_packet_header* nocapture %1, i8* nocapture %2) {
ret void
}
int fn1() {
  int ABC = 5;
  return ABC + 5;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn1() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 5
ret i32 %3
}

LLVM IR (-O2):
define i32 @fn1() {
ret i32 10
}
void gtk_tree_selection_unselect_all() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_selection_unselect_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo(int);
void process_connfd(int connfd) { echo(connfd); }


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

x86 assembly (clang, -O2):
<process_connfd>:
jmp    1030 <echo@plt>

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

LLVM IR (-O2):
define void @process_connfd(i32 %0) {
%2 = tail call i32 @echo(i32 %0)
ret void
}
/* Variables and functions */
float sqrt(float);
float hip(float a, float b) {
  float h;
  h = ((a * a) + (b * b));
  return sqrt(h);
}


x86 assembly (clang, -O0):
<hip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hip>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <hip+0x19>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @hip(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %3
%8 = load float, float* %4
%9 = load float, float* %4
%10 = fmul float %8, %9
%11 = call float @llvm.fmuladd.f32(float %6, float %7, float %10)
store float %11, float* %5
%12 = load float, float* %5
%13 = call float @sqrt(float %12)
ret float %13
}

LLVM IR (-O2):
define float @hip(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call float @sqrt(float %4)
ret float %5
}
/* Variables and functions */
double sqrt(int);
double h(double x) { return sqrt(4 - x * x); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mulsd  %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @h(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 4.000000e+00)
%7 = fptosi double %6 to i32
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @h(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 4.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(i32 %4)
ret double %5
}