xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_set_one(uintptr_t);
void fiat_p256_set_one(uint64_t out1[4]) {
  internal_fiat_p256_set_one((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_set_one>:
jmp    1030 <internal_fiat_p256_set_one@plt>

LLVM IR (-O0):
define void @fiat_p256_set_one(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p256_set_one(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_set_one(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p256_set_one(i64 %2)
ret void
}
unsigned int d2hash(void *key) {
  unsigned int *v = key;
  return v[0] + v[1] + v[2] * 3 + v[3] * 7;
}


x86 assembly (clang, -O0):
<d2hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x10(%rbp),%rcx
imul   $0x3,0x8(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
imul   $0x7,0xc(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2hash>:
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%ecx
add    (%rdi),%eax
lea    (%rcx,%rcx,2),%ecx
add    %eax,%ecx
mov    0xc(%rdi),%edx
lea    0x0(,%rdx,8),%eax
sub    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @d2hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = add i32 %8, %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = mul i32 %15, 3
%17 = add i32 %12, %16
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = mul i32 %20, 7
%22 = add i32 %17, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @d2hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = add i32 %6, %3
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = mul i32 %10, 3
%12 = add i32 %7, %11
%13 = getelementptr inbounds i8, i8* %0, i64 12
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = mul i32 %15, 7
%17 = add i32 %12, %16
ret i32 %17
}
/* Variables and functions */
int add2(int);
int add1(int n) {
  if (n < 1)
    return 1;
  return 1 + add2(n - 1);
}


x86 assembly (clang, -O0):
<add1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1131 <add1+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1142 <add1+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <add2@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add1>:
test   %edi,%edi
jle    1125 <add1+0x15>
push   %rax
add    $0xffffffff,%edi
call   1030 <add2@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @add1(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @add2(i32 %4)
%6 = add nsw i32 %5, 1
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int unreachabl() { printf("You Win!\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"You Win!\0A\00"
define i32 @unreachabl() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [9 x i8] c"You Win!\00"
define i32 @unreachabl() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void do_print_num(num, def, name, all) unsigned num;
unsigned def;
char *name;
int all;
{
  char line[20];
  if (!all && num == def)
    return;
  sprintf(line, "%s = %u", name, num);
  output(line);
}


x86 assembly (clang, -O0):
<do_print_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1150 <do_print_num+0x30>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1150 <do_print_num+0x30>
jmp    1174 <do_print_num+0x54>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <output@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_print_num>:
mov    %edi,%eax
cmp    %esi,%edi
jne    112b <do_print_num+0xb>
test   %ecx,%ecx
jne    112b <do_print_num+0xb>
ret
push   %rbx
sub    $0x20,%rsp
lea    0xec9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <output@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s = %u\00"
define void @do_print_num(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [20 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = icmp ne i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
br label %24
17: ; preds = %12, %4
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%19 = load i8*, i8** %7
%20 = load i32, i32* %5
%21 = call i32 (i8*, i8*, ...) @sprintf(i8* %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %19, i32 %20)
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @output to i32 (i8*, ...)*)(i8* %22)
br label %24
24: ; preds = %17, %16
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s = %u\00"
define void @do_print_num(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca [20 x i8]
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = icmp eq i32 %3, 0
%8 = icmp eq i32 %0, %1
%9 = and i1 %8, %7
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %0)
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @output to i32 (i8*, ...)*)(i8* %6)
br label %13
13: ; preds = %4, %10
ret void
}
void do_next_step(int cur_x, int cur_y, int *command) { return; }


x86 assembly (clang, -O0):
<do_next_step>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_next_step(i32 %0, i32 %1, i32* nocapture %2) {
ret void
}
int test_imm_26int8_mem(signed char *val) {
  return ((*val) & (0x26 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_26int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 38
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int gib_cpu_free(void *buffers) {
  free(buffers);
  return 0;
}


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

x86 assembly (clang, -O2):
<gib_cpu_free>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gib_cpu_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
char *convert_path(const char *origpath) {
  char *newpath;
  int i;
  newpath = strdup(origpath);
  i = 0;
  while (newpath[i] != 0) {
    i++;
  }
  return newpath;
}


x86 assembly (clang, -O0):
<convert_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <convert_path+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <convert_path+0x20>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_path>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @convert_path(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ set_pwd();
int /*<<< orphan*/ sh_unsetenv(char *);
void init_pwd() {
  sh_unsetenv("OLDPWD");
  set_pwd();
}


x86 assembly (clang, -O0):
<init_pwd>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <sh_unsetenv@plt>
mov    $0x0,%al
call   1030 <set_pwd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_pwd>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <sh_unsetenv@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <set_pwd@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"OLDPWD\00"
define void @init_pwd() {
%1 = call i32 @sh_unsetenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @set_pwd()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"OLDPWD\00"
define void @init_pwd() {
%1 = tail call i32 @sh_unsetenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @set_pwd()
ret void
}
/* Variables and functions */
int spi_command_read(char, char *, int, char *);
int nrf_read_register_mb(char reg, char *readbuffer, int length,
                         char *retstatus) {
  return spi_command_read((reg | 0x00), readbuffer, length, retstatus);
}


x86 assembly (clang, -O0):
<nrf_read_register_mb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movsbl -0x1(%rbp),%eax
or     $0x0,%eax
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
movsbl %al,%edi
call   1030 <spi_command_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_read_register_mb>:
jmp    1030 <spi_command_read@plt>

LLVM IR (-O0):
define i32 @nrf_read_register_mb(i8 signext %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8 %0, i8* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = or i32 %10, 0
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = call i32 @spi_command_read(i8 signext %12, i8* %13, i32 %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @nrf_read_register_mb(i8 signext %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @spi_command_read(i8 signext %0, i8* %1, i32 %2, i8* %3)
ret i32 %5
}
void op0xDB(void) {}


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

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

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

LLVM IR (-O2):
define void @op0xDB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void showErr(int id) {
  printf("\nERRO %d:", id);
  switch (id) {
  case 0: {
    printf("\n\nEmpty! Please, insert into stack.\n\n");
    break;
  }
  case 1: {
    printf("\n\nOps! This node not exists. Retry.\n\n");
    break;
  }
  }
}


x86 assembly (clang, -O0):
<showErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1150 <showErr+0x40>
jmp    113f <showErr+0x2f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1163 <showErr+0x53>
jmp    1171 <showErr+0x61>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1171 <showErr+0x61>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showErr>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
je     1149 <showErr+0x29>
cmp    $0x1,%ebx
jne    1156 <showErr+0x36>
lea    0xec7(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xedf(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0AERRO %d:\00"
@.str.1 = [38 x i8] c"\0A\0AEmpty! Please, insert into stack.\0A\0A\00"
@.str.2 = [38 x i8] c"\0A\0AOps! This node not exists. Retry.\0A\0A\00"
define void @showErr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
switch i32 %5, label %10 [
i32 0, label %6
i32 1, label %8
]
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %1, %8, %6
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0AERRO %d:\00"
@str = [37 x i8] c"\0A\0AOps! This node not exists. Retry.\0A\00"
@str.3 = [37 x i8] c"\0A\0AEmpty! Please, insert into stack.\0A\00"
define void @showErr(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
switch i32 %0, label %7 [
i32 0, label %4
i32 1, label %3
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i8* [ getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0), %1 ]
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
br label %7
7: ; preds = %4, %1
ret void
}
int exe$release(struct _fab *fab, void *err, void *suc) {
  printk("not implemented\n");
}


x86 assembly (clang, -O0):
<exe$release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe$release>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$release"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct._fab*
%6 = alloca i8*
%7 = alloca i8*
store %struct._fab* %0, %struct._fab** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$release"(%struct._fab* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *dialogNameOnly();
scalar_t__ isTerminalRunning();
scalar_t__ strlen(char const *);
scalar_t__ terminalName();
char const *dialogName(void) {
  char const *lDialogName;
  lDialogName = dialogNameOnly();
  if (strlen(lDialogName) && (isTerminalRunning() || terminalName())) {
    return lDialogName;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<dialogName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <dialogNameOnly@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     1195 <dialogName+0x55>
mov    $0x0,%al
call   1030 <isTerminalRunning@plt>
cmp    $0x0,%rax
jne    1188 <dialogName+0x48>
mov    $0x0,%al
call   1060 <terminalName@plt>
cmp    $0x0,%rax
je     1195 <dialogName+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    119d <dialogName+0x5d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dialogName>:
push   %rbx
xor    %eax,%eax
call   1040 <dialogNameOnly@plt>
cmpb   $0x0,(%rax)
je     1158 <dialogName+0x28>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <isTerminalRunning@plt>
test   %rax,%rax
jne    115a <dialogName+0x2a>
xor    %eax,%eax
call   1050 <terminalName@plt>
test   %rax,%rax
jne    115a <dialogName+0x2a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @dialogName() {
%1 = tail call i8* (...) @dialogNameOnly()
%2 = load i8, i8* %1
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = tail call i64 (...) @isTerminalRunning()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 (...) @terminalName()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %0
br label %11
11: ; preds = %4, %7, %10
%12 = phi i8* [ null, %10 ], [ %1, %7 ], [ %1, %4 ]
ret i8* %12
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int posix_clock_init(double *res) {
  int ierr;
  struct timespec ts;
  fprintf(stderr, "TIMING: ERROR: POSIX TIMERS not available.\n");
  *res = 0.0;
  return 0;
}


x86 assembly (clang, -O0):
<posix_clock_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_clock_init>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@stderr = global i32 0
@.str = [44 x i8] c"TIMING: ERROR: POSIX TIMERS not available.\0A\00"
define i32 @posix_clock_init(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca %struct.timespec
store double* %0, double** %2
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%7 = load double*, double** %2
store double 0.000000e+00, double* %7
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"TIMING: ERROR: POSIX TIMERS not available.\0A\00"
define i32 @posix_clock_init(double* nocapture writeonly %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
store double 0.000000e+00, double* %0
ret i32 0
}
void reduce_add(void *e1, void *e2, void *result) {
  int el1 = e1 ? *((int *)e1) : 0;
  int el2 = e2 ? *((int *)e2) : 0;
  *((int *)result) = el1 + el2;
}


x86 assembly (clang, -O0):
<reduce_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <reduce_add+0x29>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1133 <reduce_add+0x33>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1133 <reduce_add+0x33>
mov    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <reduce_add+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
jmp    115c <reduce_add+0x5c>
xor    %eax,%eax
mov    %eax,-0x28(%rbp)
jmp    115c <reduce_add+0x5c>
mov    -0x28(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
add    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce_add>:
xor    %eax,%eax
mov    $0x0,%ecx
test   %rdi,%rdi
je     110e <reduce_add+0xe>
mov    (%rdi),%ecx
test   %rsi,%rsi
je     1115 <reduce_add+0x15>
mov    (%rsi),%eax
add    %ecx,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @reduce_add(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
br label %16
15: ; preds = %3
br label %16
16: ; preds = %15, %11
%17 = phi i32 [ %14, %11 ], [ 0, %15 ]
store i32 %17, i32* %7
%18 = load i8*, i8** %5
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = bitcast i8* %21 to i32*
%23 = load i32, i32* %22
br label %25
24: ; preds = %16
br label %25
25: ; preds = %24, %20
%26 = phi i32 [ %23, %20 ], [ 0, %24 ]
store i32 %26, i32* %8
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = add nsw i32 %27, %28
%30 = load i8*, i8** %6
%31 = bitcast i8* %30 to i32*
store i32 %29, i32* %31
ret void
}

LLVM IR (-O2):
define void @reduce_add(i8* %0, i8* %1, i8* nocapture writeonly %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = bitcast i8* %0 to i32*
%7 = load i32, i32* %6
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ 0, %3 ]
%10 = icmp eq i8* %1, null
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = bitcast i8* %1 to i32*
%13 = load i32, i32* %12
br label %14
14: ; preds = %8, %11
%15 = phi i32 [ %13, %11 ], [ 0, %8 ]
%16 = add nsw i32 %15, %9
%17 = bitcast i8* %2 to i32*
store i32 %16, i32* %17
ret void
}
/* Type definitions */
struct ipv6hdr {
  int dummy;
};
typedef int __u8;
typedef int __u16;
typedef int /*<<< orphan*/ __be16;

/* Variables and functions */
int /*<<< orphan*/ htons(int);
int ntohs(int /*<<< orphan*/);
void ipv6_change_dsfield(struct ipv6hdr *ipv6h, __u8 mask, __u8 value) {
  __u16 tmp;
  tmp = ntohs(*(__be16 *)ipv6h);
  tmp = (tmp & ((mask << 4) | 0xf00f)) | (value << 4);
  *(__be16 *)ipv6h = htons(tmp);
}


x86 assembly (clang, -O0):
<ipv6_change_dsfield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <ntohs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x4,%ecx
or     $0xf00f,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_change_dsfield>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    (%rdi),%edi
call   1040 <ntohs@plt>
shl    $0x4,%ebp
or     $0xf00f,%ebp
and    %eax,%ebp
shl    $0x4,%ebx
or     %ebp,%ebx
mov    %ebx,%edi
call   1030 <htons@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.ipv6hdr = type { i32 }
define void @ipv6_change_dsfield(%struct.ipv6hdr* %0, i32 %1, i32 %2) {
%4 = alloca %struct.ipv6hdr*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.ipv6hdr* %0, %struct.ipv6hdr** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.ipv6hdr*, %struct.ipv6hdr** %4
%9 = bitcast %struct.ipv6hdr* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 @ntohs(i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = shl i32 %13, 4
%15 = or i32 %14, 61455
%16 = and i32 %12, %15
%17 = load i32, i32* %6
%18 = shl i32 %17, 4
%19 = or i32 %16, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = call i32 @htons(i32 %20)
%22 = load %struct.ipv6hdr*, %struct.ipv6hdr** %4
%23 = bitcast %struct.ipv6hdr* %22 to i32*
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
%struct.ipv6hdr = type { i32 }
define void @ipv6_change_dsfield(%struct.ipv6hdr* nocapture %0, i32 %1, i32 %2) {
%4 = getelementptr %struct.ipv6hdr, %struct.ipv6hdr* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @ntohs(i32 %5)
%7 = shl i32 %1, 4
%8 = or i32 %7, 61455
%9 = and i32 %6, %8
%10 = shl i32 %2, 4
%11 = or i32 %9, %10
%12 = tail call i32 @htons(i32 %11)
store i32 %12, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int qtdPrimo(int);
main() {
  printf("A quantidade de numeros primos abaixo de 33 eh: %d\n", qtdPrimo(115));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"A quantidade de numeros primos abaixo de 33 eh: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @qtdPrimo(i32 115)
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"A quantidade de numeros primos abaixo de 33 eh: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @qtdPrimo(i32 115)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, char const *, int);
int cmd_debug_common(const char *txt, int *val, int argc, char **argv) {
  int r;
  if (argc == 1) {
    printf("%s debug is 0x%x\n", txt, *val);
  } else {
    r = htoi(argv[1]);
    *val = r;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmd_debug_common>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    115c <cmd_debug_common+0x3c>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    1175 <cmd_debug_common+0x55>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <htoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_debug_common>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x1,%edx
jne    113c <cmd_debug_common+0x1c>
mov    %rdi,%rsi
mov    (%rbx),%edx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    1147 <cmd_debug_common+0x27>
mov    0x8(%rcx),%rdi
call   1040 <htoi@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%s debug is 0x%x\0A\00"
define i32 @cmd_debug_common(i8* %0, i32* %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%10 = load i32, i32* %7
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %15)
br label %24
17: ; preds = %4
%18 = load i8**, i8*** %8
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @htoi(i8* %20)
store i32 %21, i32* %9
%22 = load i32, i32* %9
%23 = load i32*, i32** %6
store i32 %22, i32* %23
br label %24
24: ; preds = %17, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s debug is 0x%x\0A\00"
define i32 @cmd_debug_common(i8* %0, i32* nocapture %1, i32 %2, i8** nocapture %3) {
%5 = icmp eq i32 %2, 1
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = load i32, i32* %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %7)
br label %13
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %3, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @htoi(i8* %11)
store i32 %12, i32* %1
br label %13
13: ; preds = %9, %6
ret i32 0
}
/* Variables and functions */
size_t strlen(char *);
size_t my_strlen(char *s) { return (strlen(s)); }


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

x86 assembly (clang, -O2):
<my_strlen>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @my_strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @my_strlen(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *blake224_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_blake224(unsigned char *out, FILE *fp) {
  return blake224_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_blake224>:
jmp    1030 <blake224_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_blake224(i8* %0, i32* %1) {
%3 = tail call i8* @blake224_file(i8* %0, i32* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sort_r_swap(char *, char *, size_t);
void sort_r_swap_blocks(char *ptr, size_t na, size_t nb) {
  if (na > 0 && nb > 0) {
    if (na > nb) {
      sort_r_swap(ptr, ptr + na, nb);
    } else {
      sort_r_swap(ptr, ptr + nb, na);
    }
  }
}


x86 assembly (clang, -O0):
<sort_r_swap_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    117c <sort_r_swap_blocks+0x6c>
cmpq   $0x0,-0x18(%rbp)
jbe    117c <sort_r_swap_blocks+0x6c>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1162 <sort_r_swap_blocks+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sort_r_swap@plt>
jmp    1177 <sort_r_swap_blocks+0x67>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <sort_r_swap@plt>
jmp    117c <sort_r_swap_blocks+0x6c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_r_swap_blocks>:
test   %rsi,%rsi
je     1136 <sort_r_swap_blocks+0x26>
test   %rdx,%rdx
je     1136 <sort_r_swap_blocks+0x26>
mov    %rsi,%rax
cmp    %rdx,%rsi
mov    %rdx,%rsi
cmova  %rax,%rsi
cmova  %rdx,%rax
add    %rdi,%rsi
mov    %rax,%rdx
jmp    1030 <sort_r_swap@plt>
ret

LLVM IR (-O0):
define void @sort_r_swap_blocks(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = icmp ugt i64 %7, 0
br i1 %8, label %9, label %31
9: ; preds = %3
%10 = load i64, i64* %6
%11 = icmp ugt i64 %10, 0
br i1 %11, label %12, label %31
12: ; preds = %9
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp ugt i64 %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i8*, i8** %4
%18 = load i8*, i8** %4
%19 = load i64, i64* %5
%20 = getelementptr inbounds i8, i8* %18, i64 %19
%21 = load i64, i64* %6
%22 = call i32 @sort_r_swap(i8* %17, i8* %20, i64 %21)
br label %30
23: ; preds = %12
%24 = load i8*, i8** %4
%25 = load i8*, i8** %4
%26 = load i64, i64* %6
%27 = getelementptr inbounds i8, i8* %25, i64 %26
%28 = load i64, i64* %5
%29 = call i32 @sort_r_swap(i8* %24, i8* %27, i64 %28)
br label %30
30: ; preds = %23, %16
br label %31
31: ; preds = %30, %9, %3
ret void
}

LLVM IR (-O2):
define void @sort_r_swap_blocks(i8* %0, i64 %1, i64 %2) {
%4 = icmp ne i64 %1, 0
%5 = icmp ne i64 %2, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = icmp ugt i64 %1, %2
%9 = select i1 %8, i64 %1, i64 %2
%10 = select i1 %8, i64 %2, i64 %1
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = tail call i32 @sort_r_swap(i8* %0, i8* %11, i64 %10)
br label %13
13: ; preds = %7, %3
ret void
}
void gdk_drag_drop() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drag_drop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interrupt(int, int, char *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void deleteCommand(char *args[]) {
  interrupt(0x21, 0x7, args[1], 0, 0);
  return;
}


x86 assembly (clang, -O0):
<deleteCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x21,%edi
mov    $0x7,%esi
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <interrupt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteCommand>:
mov    0x8(%rdi),%rdx
mov    $0x21,%edi
mov    $0x7,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <interrupt@plt>

LLVM IR (-O0):
define void @deleteCommand(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
%6 = call i32 @interrupt(i32 33, i32 7, i8* %5, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @deleteCommand(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32 @interrupt(i32 33, i32 7, i8* %3, i32 0, i32 0)
ret void
}
/* Variables and functions */
int bad6(int);
int opt1(void) { return bad6(1); }


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

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

LLVM IR (-O0):
define i32 @opt1() {
%1 = call i32 @bad6(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @opt1() {
%1 = tail call i32 @bad6(i32 1)
ret i32 %1
}
/* Variables and functions */
bool nrf51_errata_16(void) { return false; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ cfg_set_regions(int /*<<< orphan*/ const *);
void app_config(void) { cfg_set_regions(((const uint8_t *)0x48000000)); }


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

x86 assembly (clang, -O2):
<app_config>:
mov    $0x48000000,%edi
jmp    1030 <cfg_set_regions@plt>

LLVM IR (-O0):
define void @app_config() {
%1 = call i32 @cfg_set_regions(i32* inttoptr (i64 1207959552 to i32*))
ret void
}

LLVM IR (-O2):
define void @app_config() {
%1 = tail call i32 @cfg_set_regions(i32* inttoptr (i64 1207959552 to i32*))
ret void
}
/* Variables and functions */
int helperPrimitiveBlockClosure_ValueWithArguments(int, int *, int);
int primitiveBlockClosure_Value_Value_(int receiver, int *arguments) {
  return helperPrimitiveBlockClosure_ValueWithArguments(receiver, arguments, 2);
}


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

x86 assembly (clang, -O2):
<primitiveBlockClosure_Value_Value_>:
mov    $0x2,%edx
jmp    1030 <helperPrimitiveBlockClosure_ValueWithArguments@plt>

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

LLVM IR (-O2):
define i32 @primitiveBlockClosure_Value_Value_(i32 %0, i32* %1) {
%3 = tail call i32 @helperPrimitiveBlockClosure_ValueWithArguments(i32 %0, i32* %1, i32 2)
ret i32 %3
}
/* Type definitions */
struct libalias {
  int dummy;
};

/* Variables and functions */
int LibAliasOutLocked(struct libalias *, char *, int, int);
int /*<<< orphan*/ NOREF(struct libalias *);
int LibAliasOut(struct libalias *la, char *ptr, int maxpacketsize) {
  int res;
  NOREF((la));
  ;
  res = LibAliasOutLocked(la, ptr, maxpacketsize, 1);
  NOREF((la));
  return (res);
}


x86 assembly (clang, -O0):
<LibAliasOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <NOREF@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <LibAliasOutLocked@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <NOREF@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LibAliasOut>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <NOREF@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
mov    $0x1,%ecx
call   1030 <LibAliasOutLocked@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1040 <NOREF@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.libalias = type { i32 }
define i32 @LibAliasOut(%struct.libalias* %0, i8* %1, i32 %2) {
%4 = alloca %struct.libalias*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.libalias* %0, %struct.libalias** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.libalias*, %struct.libalias** %4
%9 = call i32 @NOREF(%struct.libalias* %8)
%10 = load %struct.libalias*, %struct.libalias** %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @LibAliasOutLocked(%struct.libalias* %10, i8* %11, i32 %12, i32 1)
store i32 %13, i32* %7
%14 = load %struct.libalias*, %struct.libalias** %4
%15 = call i32 @NOREF(%struct.libalias* %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
%struct.libalias = type { i32 }
define i32 @LibAliasOut(%struct.libalias* %0, i8* %1, i32 %2) {
%4 = tail call i32 @NOREF(%struct.libalias* %0)
%5 = tail call i32 @LibAliasOutLocked(%struct.libalias* %0, i8* %1, i32 %2, i32 1)
%6 = tail call i32 @NOREF(%struct.libalias* %0)
ret i32 %5
}
/* Type definitions */
struct winsize {
  scalar_t__ ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int ioctl(int /*<<< orphan*/, int /*<<< orphan*/, struct winsize *);
unsigned int get_column_width_from_term() {
  struct winsize winsz;
  int err = ioctl(STDOUT_FILENO, TIOCGWINSZ, &winsz);
  if (err) {
    ;
    return 80;
  }
  return (unsigned int)winsz.ws_col;
}


x86 assembly (clang, -O0):
<get_column_width_from_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114c <get_column_width_from_term+0x3c>
movl   $0x50,-0x4(%rbp)
jmp    1153 <get_column_width_from_term+0x43>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_column_width_from_term>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    %eax,%ecx
mov    $0x50,%eax
test   %ecx,%ecx
jne    1139 <get_column_width_from_term+0x29>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i64 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_column_width_from_term() {
%1 = alloca i32
%2 = alloca %struct.winsize
%3 = alloca i32
%4 = load i32, i32* @STDOUT_FILENO
%5 = load i32, i32* @TIOCGWINSZ
%6 = call i32 @ioctl(i32 %4, i32 %5, %struct.winsize* %2)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 80, i32* %1
br label %14
10: ; preds = %0
%11 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
%struct.winsize = type { i64 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_column_width_from_term() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = select i1 %6, i32 %9, i32 80
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int pipe_open(char const *, char const *, int /*<<< orphan*/,
              int /*<<< orphan*/ *);
int pipe_output_command(const char *command, const char *output_filename,
                        pid_t *child_pid) {
  return pipe_open(command, output_filename, 0, child_pid);
}


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

x86 assembly (clang, -O2):
<pipe_output_command>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <pipe_open@plt>

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

LLVM IR (-O2):
define i32 @pipe_output_command(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @pipe_open(i8* %0, i8* %1, i32 0, i32* %2)
ret i32 %4
}
int msm_routing_put_dolby_dap_endpoint_control(
    struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.snd_kcontrol = type opaque
%struct.snd_ctl_elem_value = type opaque
define i32 @msm_routing_put_dolby_dap_endpoint_control(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_value* %1) {
%3 = alloca %struct.snd_kcontrol*
%4 = alloca %struct.snd_ctl_elem_value*
store %struct.snd_kcontrol* %0, %struct.snd_kcontrol** %3
store %struct.snd_ctl_elem_value* %1, %struct.snd_ctl_elem_value** %4
ret i32 0
}

LLVM IR (-O2):
%struct.snd_kcontrol = type opaque
%struct.snd_ctl_elem_value = type opaque
define i32 @msm_routing_put_dolby_dap_endpoint_control(%struct.snd_kcontrol* nocapture readnone %0, %struct.snd_ctl_elem_value* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *zrpc_util_mac2str(char *);
char *zrpc_util_ecom_mac2str(char *ecom_mac) {
  char *en;
  en = ecom_mac;
  en += 2;
  return zrpc_util_mac2str(en);
}


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

x86 assembly (clang, -O2):
<zrpc_util_ecom_mac2str>:
add    $0x2,%rdi
jmp    1030 <zrpc_util_mac2str@plt>

LLVM IR (-O0):
define i8* @zrpc_util_ecom_mac2str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 2
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @zrpc_util_mac2str(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @zrpc_util_ecom_mac2str(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = tail call i8* @zrpc_util_mac2str(i8* %2)
ret i8* %3
}