xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char const);
void printd(const unsigned char *data, int cnt) {
  if (cnt > 16)
    cnt = 16;
  while (cnt-- > 0) {
    printf(" %02x", *data);
    ++data;
  }
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jle    1130 <printd+0x20>
movl   $0x10,-0xc(%rbp)
jmp    1135 <printd+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    116d <printd+0x5d>
mov    -0x8(%rbp),%rax
lea    0xeac(%rip),%rdi
movzbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1135 <printd+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <printd+0x37>
mov    %rdi,%rbx
cmp    $0x10,%esi
mov    $0x10,%ebp
cmovb  %esi,%ebp
add    $0x1,%ebp
lea    0xed0(%rip),%r14
movzbl (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <printd+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c" %02x\00"
define void @printd(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 = icmp sgt i32 %5, 16
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 16, i32* %4
br label %8
8: ; preds = %7, %2
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %10, -1
store i32 %11, i32* %4
%12 = icmp sgt i32 %10, 0
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %02x\00"
define void @printd(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = icmp ult i32 %1, 16
%6 = select i1 %5, i32 %1, i32 16
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ %6, %4 ]
%9 = phi i8* [ %13, %7 ], [ %0, %4 ]
%10 = add nsw i32 %8, -1
%11 = load i8, i8* %9
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %11)
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = icmp ugt i32 %8, 1
br i1 %14, label %7, label %15
15: ; preds = %7, %2
ret void
}
int get_maxxgrid(void) { return 1e7; }


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

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

LLVM IR (-O0):
define i32 @get_maxxgrid() {
ret i32 10000000
}

LLVM IR (-O2):
define i32 @get_maxxgrid() {
ret i32 10000000
}
/* Variables and functions */
int /*<<< orphan*/ throw_message(char *, char const *, char const *);
void throw_warning(char const *control_string, char const *parameter_string) {
  throw_message("WARNING: ", control_string, parameter_string);
}


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

x86 assembly (clang, -O2):
<throw_warning>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <throw_message@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"WARNING: \00"
define void @throw_warning(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @throw_message(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"WARNING: \00"
define void @throw_warning(i8* %0, i8* %1) {
%3 = tail call i32 @throw_message(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int map_hash(char *key) {
  int i;
  int sum = 0;
  for (i = 0; key[i] != '\0'; sum += key[i++])
    ;
  return sum;
}


x86 assembly (clang, -O0):
<map_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <map_hash+0x51>
jmp    1130 <map_hash+0x30>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <map_hash+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <map_hash+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <map_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @map_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nuw nsw i64 %5, 1
%10 = add nsw i32 %7, %8
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
void App_BusFault_ISR(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<App_BusFault_ISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <App_BusFault_ISR+0x9>
jmp    1109 <App_BusFault_ISR+0x9>

x86 assembly (clang, -O2):
<App_BusFault_ISR>:
jmp    1100 <App_BusFault_ISR>

LLVM IR (-O0):
define void @App_BusFault_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @App_BusFault_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_INT2_PIN() { clear_io_bit(0x43, 2); }


x86 assembly (clang, -O0):
<TOSH_CLR_INT2_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x2,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_INT2_PIN>:
mov    $0x43,%edi
mov    $0x2,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_INT2_PIN() {
%1 = call i32 @clear_io_bit(i32 67, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_INT2_PIN() {
%1 = tail call i32 @clear_io_bit(i32 67, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_I2C_BUS1_SDA_OUTPUT() { set_io_bit(0x36, 5); }


x86 assembly (clang, -O0):
<TOSH_MAKE_I2C_BUS1_SDA_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
mov    $0x5,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_I2C_BUS1_SDA_OUTPUT>:
mov    $0x36,%edi
mov    $0x5,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_I2C_BUS1_SDA_OUTPUT() {
%1 = call i32 @set_io_bit(i32 54, i32 5)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_I2C_BUS1_SDA_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 54, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int ano;
  printf("Insira um ano: \n");
  scanf("%i", &ano);
  if (ano % 4 == 0) {
    printf("Ano bissexto\n");
  } else {
    printf("Não é bissexto\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1170 <main+0x50>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x3,0x4(%rsp)
lea    0xeda(%rip),%rax
lea    0xec2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Insira um ano: \0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [14 x i8] c"Ano bissexto\0A\00"
@.str.3 = [18 x i8] c"N\C3\A3o \C3\A9 bissexto\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@str = [16 x i8] c"Insira um ano: \00"
@str.4 = [17 x i8] c"N\C3\A3o \C3\A9 bissexto\00"
@str.5 = [13 x i8] c"Ano bissexto\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 3
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
void evdns_shutdown(int fail_requests) {}


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

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

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

LLVM IR (-O2):
define void @evdns_shutdown(i32 %0) {
ret void
}
void abcd6efghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcd6efghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t);
void *xzalloc(size_t size) {
  void *ptr;
  ptr = xmalloc(size);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<xzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xzalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xzalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @xmalloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @xzalloc(i64 %0) {
%2 = tail call i8* @xmalloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Type definitions */
struct Forest {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *toString(struct Forest *);
void PrintFor(struct Forest *forest) {
  char *txt = toString(forest);
  printf("%s\n", txt);
  free(txt);
}


x86 assembly (clang, -O0):
<PrintFor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <toString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintFor>:
push   %rbx
call   1040 <toString@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Forest = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define void @PrintFor(%struct.Forest* %0) {
%2 = alloca %struct.Forest*
%3 = alloca i8*
store %struct.Forest* %0, %struct.Forest** %2
%4 = load %struct.Forest*, %struct.Forest** %2
%5 = call i8* @toString(%struct.Forest* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
%struct.Forest = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define void @PrintFor(%struct.Forest* %0) {
%2 = tail call i8* @toString(%struct.Forest* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvwins_wstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvwins_wstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvwins_wstr+0x2a>
jmp    1170 <cmd_mvwins_wstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvwins_wstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvwins_wstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwins_wstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
float circle(float dd, float rr) { return dd < rr ? 1.f : 0.f; }


x86 assembly (clang, -O0):
<circle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xee0(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle>:
cmpltss %xmm1,%xmm0
movss  0xef3(%rip),%xmm1
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @circle(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 = fcmp olt float %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, float 1.000000e+00, float 0.000000e+00
ret float %9
}

LLVM IR (-O2):
define float @circle(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float 1.000000e+00, float 0.000000e+00
ret float %4
}
void g_arith_sqrt_s64_f(void *s, void *d, void *o) {}


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

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

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

LLVM IR (-O2):
define void @g_arith_sqrt_s64_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
void rc_cpt_unlock(void) { return; }


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

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

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

LLVM IR (-O2):
define void @rc_cpt_unlock() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
void skip_spaces(const char **str) {
  while (isspace(**str))
    (*str)++;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1148 <skip_spaces+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <skip_spaces+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     113a <skip_spaces+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <skip_spaces+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @skip_spaces(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %9, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = call i64 @isspace(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @skip_spaces(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i64 @isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ umask(int /*<<< orphan*/);
mode_t get_umask(void) {
  mode_t old = umask(0);
  umask(old);
  return old;
}


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

x86 assembly (clang, -O2):
<get_umask>:
push   %rbx
xor    %edi,%edi
call   1030 <umask@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <umask@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_umask() {
%1 = tail call i32 @umask(i32 0)
%2 = tail call i32 @umask(i32 %1)
ret i32 %1
}
/* Variables and functions */
scalar_t__ toupper(char);
int casecmp(char a, char b) { return toupper(a) == toupper(b); }


x86 assembly (clang, -O0):
<casecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <toupper@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<casecmp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <toupper@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <toupper@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @casecmp(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i64 @toupper(i8 signext %5)
%7 = load i8, i8* %4
%8 = call i64 @toupper(i8 signext %7)
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @casecmp(i8 signext %0, i8 signext %1) {
%3 = tail call i64 @toupper(i8 signext %0)
%4 = tail call i64 @toupper(i8 signext %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef unsigned char __u32;

/* Variables and functions */
__u32 __cpu_to_le32(__u32 x) {
  register unsigned char *p = (unsigned char *)&x;
  return (p[3] << 24) + (p[2] << 16) + (p[1] << 8) + p[0];
}


x86 assembly (clang, -O0):
<__cpu_to_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @__cpu_to_le32(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
store i8* %2, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 24
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = add nsw i32 %8, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = add nsw i32 %14, %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = add nsw i32 %20, %24
%26 = trunc i32 %25 to i8
ret i8 %26
}

LLVM IR (-O2):
define zeroext i8 @__cpu_to_le32(i8 zeroext %0) {
ret i8 poison
}
/* Variables and functions */
double M_PI;
double rad2deg(double rad) { return (rad * 180 / M_PI); }


x86 assembly (clang, -O0):
<rad2deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad2deg>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @rad2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @rad2deg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
int binarysearch(int array[], int to_find, int start, int end) { return -1; }


x86 assembly (clang, -O0):
<binarysearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @binarysearch(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @binarysearch(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i32 -1
}
int st_max(int x, int y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<st_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <st_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <st_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @st_max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @st_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ ofl_action_type_print(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ *open_memstream(char **, size_t *);
char *ofl_action_type_to_string(uint16_t type) {
  char *str;
  size_t str_size;
  FILE *stream = open_memstream(&str, &str_size);
  ofl_action_type_print(stream, type);
  fclose(stream);
  return str;
}


x86 assembly (clang, -O0):
<ofl_action_type_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <open_memstream@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <ofl_action_type_print@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofl_action_type_to_string>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <open_memstream@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <ofl_action_type_print@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ofl_action_type_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %2
%6 = call i32* @open_memstream(i8** %3, i64* %4)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %2
%9 = call i32 @ofl_action_type_print(i32* %7, i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ofl_action_type_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32* @open_memstream(i8** %2, i64* %3)
%7 = call i32 @ofl_action_type_print(i32* %6, i32 %0)
%8 = call i32 @fclose(i32* %6)
%9 = load i8*, i8** %2
ret i8* %9
}
/* Variables and functions */
size_t backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, size_t, int);
void print_trace(void) {
  void *array[16];
  size_t size;
  size = backtrace(array, 16);
  backtrace_symbols_fd(array, size, 2);
}


x86 assembly (clang, -O0):
<print_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rdi
mov    $0x10,%esi
call   1040 <backtrace@plt>
mov    %rax,-0x88(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_trace>:
push   %rbx
sub    $0x80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <backtrace@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @print_trace() {
%1 = alloca [16 x i8*]
%2 = alloca i64
%3 = getelementptr inbounds [16 x i8*], [16 x i8*]* %1, i64 0, i64 0
%4 = call i64 @backtrace(i8** %3, i32 16)
store i64 %4, i64* %2
%5 = getelementptr inbounds [16 x i8*], [16 x i8*]* %1, i64 0, i64 0
%6 = load i64, i64* %2
%7 = call i32 @backtrace_symbols_fd(i8** %5, i64 %6, i32 2)
ret void
}

LLVM IR (-O2):
define void @print_trace() {
%1 = alloca [16 x i8*]
%2 = bitcast [16 x i8*]* %1 to i8*
%3 = getelementptr inbounds [16 x i8*], [16 x i8*]* %1, i64 0, i64 0
%4 = call i64 @backtrace(i8** %3, i32 16)
%5 = call i32 @backtrace_symbols_fd(i8** %3, i64 %4, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int fatfs_mkdir(char const *, int /*<<< orphan*/);
int mkdir(const char *path, mode_t mode) { return fatfs_mkdir(path, mode); }


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

x86 assembly (clang, -O2):
<mkdir>:
jmp    1030 <fatfs_mkdir@plt>

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

LLVM IR (-O2):
define i32 @mkdir(i8* %0, i32 %1) {
%3 = tail call i32 @fatfs_mkdir(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "Usage: avrocat <avro data file>\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: avrocat <avro data file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: avrocat <avro data file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
double(tanh)(double x) { return 0.0; }


x86 assembly (clang, -O0):
<tanh>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanh>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @tanh(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int var;
  printf("Enter an int: ");
  scanf("%d", &var);
  if (var)
    printf("IF\n");
  else
    printf("ELSE\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1166 <main+0x46>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <main+0x52>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xeb8(%rip),%rax
lea    0xeb6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter an int: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"IF\0A\00"
@.str.3 = [6 x i8] c"ELSE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter an int: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [5 x i8] c"ELSE\00"
@str.4 = [3 x i8] c"IF\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add_edc(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ add_header(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ add_xa_subheader(int /*<<< orphan*/ *);
void convert_track_xa_form_2_2324(uint8_t *sector, uint32_t adr) {
  add_header(sector, adr, 2);
  add_xa_subheader(sector);
  add_edc(sector + 16, 8 + 2324, sector + 2348);
}


x86 assembly (clang, -O0):
<convert_track_xa_form_2_2324>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x2,%edx
call   1050 <add_header@plt>
mov    -0x8(%rbp),%rdi
call   1030 <add_xa_subheader@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rdx
add    $0x24b0,%rdx
mov    $0x91c,%esi
call   1040 <add_edc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_track_xa_form_2_2324>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edx
call   1050 <add_header@plt>
mov    %rbx,%rdi
call   1030 <add_xa_subheader@plt>
lea    0x40(%rbx),%rdi
add    $0x24b0,%rbx
mov    $0x91c,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <add_edc@plt>

LLVM IR (-O0):
define void @convert_track_xa_form_2_2324(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 @add_header(i32* %5, i32 %6, i32 2)
%8 = load i32*, i32** %3
%9 = call i32 @add_xa_subheader(i32* %8)
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 16
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 2348
%14 = call i32 @add_edc(i32* %11, i32 2332, i32* %13)
ret void
}

LLVM IR (-O2):
define void @convert_track_xa_form_2_2324(i32* %0, i32 %1) {
%3 = tail call i32 @add_header(i32* %0, i32 %1, i32 2)
%4 = tail call i32 @add_xa_subheader(i32* %0)
%5 = getelementptr inbounds i32, i32* %0, i64 16
%6 = getelementptr inbounds i32, i32* %0, i64 2348
%7 = tail call i32 @add_edc(i32* %5, i32 2332, i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_write(int, unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(unsigned char *);
void print_com(int fd, unsigned char *buf) { io_write(fd, buf, strlen(buf)); }


x86 assembly (clang, -O0):
<print_com>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <io_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_com(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @io_write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @print_com(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @io_write(i32 %0, i8* %1, i32 %3)
ret void
}
int lcdl_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lcdl_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("\nusage: cat (/path/to/FILE)\n\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"\0Ausage: cat (/path/to/FILE)\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"\0Ausage: cat (/path/to/FILE)\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
int f2(int a) { return a; }


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

x86 assembly (clang, -O2):
<f2>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
float M_PI;
float kinematicsRadToDeg(float rad) { return rad * 180. / M_PI; }


x86 assembly (clang, -O0):
<kinematicsRadToDeg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x2ec3(%rip),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kinematicsRadToDeg>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
mov    0x2ed5(%rip),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @kinematicsRadToDeg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 1.800000e+02
%6 = load float, float* @M_PI
%7 = fpext float %6 to double
%8 = fdiv double %5, %7
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @kinematicsRadToDeg(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 1.800000e+02
%4 = load float, float* @M_PI
%5 = fpext float %4 to double
%6 = fdiv double %3, %5
%7 = fptrunc double %6 to float
ret float %7
}
void SDoff(void) {
  (*(volatile unsigned long *)(0xE0028000 + 0x08)) &= ~(1 << 7);
  (*(volatile unsigned long *)(0xE002C000 + 0x00)) &= ~(0x1500);
}


x86 assembly (clang, -O0):
<SDoff>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0028008,%eax
mov    (%rax),%rcx
and    $0xffffffffffffff7f,%rcx
mov    $0xe0028008,%eax
mov    %rcx,(%rax)
mov    $0xe002c000,%eax
mov    (%rax),%rcx
and    $0xffffffffffffeaff,%rcx
mov    $0xe002c000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDoff>:
mov    $0xe0028008,%eax
andq   $0xffffffffffffff7f,(%rax)
andq   $0xffffffffffffeaff,0x3ff8(%rax)
ff ea ff ff
ret

LLVM IR (-O0):
define void @SDoff() {
%1 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%2 = and i64 %1, -129
store volatile i64 %2, i64* inttoptr (i64 3758260232 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 3758276608 to i64*)
%4 = and i64 %3, -5377
store volatile i64 %4, i64* inttoptr (i64 3758276608 to i64*)
ret void
}

LLVM IR (-O2):
define void @SDoff() {
%1 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%2 = and i64 %1, -129
store volatile i64 %2, i64* inttoptr (i64 3758260232 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 3758276608 to i64*)
%4 = and i64 %3, -5377
store volatile i64 %4, i64* inttoptr (i64 3758276608 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigint_handler() { exit(0); }


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigint_handler() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigint_handler() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sigfft_setup();
int /*<<< orphan*/ sigrfft_setup();
int /*<<< orphan*/ sigrifft_setup();
void d_fft_setup(void) {
  sigfft_setup();
  sigrfft_setup();
  sigrifft_setup();
}


x86 assembly (clang, -O0):
<d_fft_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sigfft_setup@plt>
mov    $0x0,%al
call   1050 <sigrfft_setup@plt>
mov    $0x0,%al
call   1040 <sigrifft_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_fft_setup>:
push   %rax
xor    %eax,%eax
call   1030 <sigfft_setup@plt>
xor    %eax,%eax
call   1050 <sigrfft_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sigrifft_setup@plt>

LLVM IR (-O0):
define void @d_fft_setup() {
%1 = call i32 (...) @sigfft_setup()
%2 = call i32 (...) @sigrfft_setup()
%3 = call i32 (...) @sigrifft_setup()
ret void
}

LLVM IR (-O2):
define void @d_fft_setup() {
%1 = tail call i32 (...) @sigfft_setup()
%2 = tail call i32 (...) @sigrfft_setup()
%3 = tail call i32 (...) @sigrifft_setup()
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int res = add(40, 2);
  printf("result: %d\n", res);
  res = add(100, -5);
  printf("result: %d\n", res);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
mov    $0x2,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0xfffffffb,%esi
call   1030 <add@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"result: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 40, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @add(i32 100, i32 -5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void uninitvar_putchar(void) {
  int c;
  (void)putchar(c);
}


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

x86 assembly (clang, -O2):
<uninitvar_putchar>:
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @uninitvar_putchar() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @putchar(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_putchar() {
%1 = tail call i32 @putchar(i32 undef)
ret void
}