xunge/DecIR huggingface dataset:
void yy_1_BlockContentStar(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_BlockContentStar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_1_BlockContentStar(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_dec();
int /*<<< orphan*/ e_writeback();
void e_dec_abs() {
  e_abs();
  e_dec();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_dec_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <e_abs@plt>
mov    $0x0,%al
call   1040 <e_dec@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_dec_abs>:
push   %rax
xor    %eax,%eax
call   1050 <e_abs@plt>
xor    %eax,%eax
call   1040 <e_dec@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_dec_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_dec()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_dec_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_dec()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char ch;
  int len = 0;
  printf("Enter a message: ");
  while (getchar() != '\n') {
    len++;
  }
  printf("The message was %d character(s) long. \n", len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1165 <main+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x24>
mov    -0xc(%rbp),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%al
jne    1140 <main+0x20>
lea    0xebd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a message: \00"
@.str.1 = [40 x i8] c"The message was %d character(s) long. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %9, %0
%6 = call signext i8 (...) @getchar()
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %5
12: ; preds = %5
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter a message: \00"
@.str.1 = [40 x i8] c"The message was %d character(s) long. \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
void init_tree_owl_vital_apat(void) {}


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

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

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

LLVM IR (-O2):
define void @init_tree_owl_vital_apat() {
ret void
}
int test_imm_F1uint32_mem(unsigned int *val) {
  return ((*val) & (0xF1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F1uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 241
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned xrop3_187_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~S;
  stk1 = D | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_187_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_187_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_187_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = xor i32 %15, -1
store i32 %16, i32* %8
%17 = load i32, i32* %5
%18 = load i32, i32* %8
%19 = or i32 %17, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @xrop3_187_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = xor i32 %4, -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ customFree(int *, char *, int);
scalar_t__ customMalloc(int, char *, int);
void free_middle() {
  int *x = (int *)customMalloc(
      sizeof(int) * 100,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/"
      "heads/master/EnhancedMalloc/src/main.c",
      12);
  ;
  customFree(x + 10,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/"
             "refs/heads/master/EnhancedMalloc/src/main.c",
             13);
  ;
}


x86 assembly (clang, -O0):
<free_middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x190,%edi
lea    0xecc(%rip),%rsi
mov    $0xc,%edx
call   1030 <customMalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x28,%rdi
lea    0xeaf(%rip),%rsi
mov    $0xd,%edx
call   1040 <customFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_middle>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0x190,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1030 <customMalloc@plt>
lea    0x28(%rax),%rdi
mov    %rbx,%rsi
mov    $0xd,%edx
pop    %rbx
jmp    1040 <customFree@plt>

LLVM IR (-O0):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/heads/master/EnhancedMalloc/src/main.c\00"
define void @free_middle() {
%1 = alloca i32*
%2 = call i64 @customMalloc(i32 400, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 10
%6 = call i32 @customFree(i32* %5, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/heads/master/EnhancedMalloc/src/main.c\00"
define void @free_middle() {
%1 = tail call i64 @customMalloc(i32 400, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = inttoptr i64 %1 to i32*
%3 = getelementptr inbounds i32, i32* %2, i64 10
%4 = tail call i32 @customFree(i32* %3, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}
/* Variables and functions */
char getchar();
scalar_t__ isalpha(char);
int /*<<< orphan*/ putchar(char);
int main(void) {
  char ch;
  while ((ch = getchar()) != '\n') {
    if (isalpha(ch))
      putchar(ch + 1);
    else
      putchar(ch);
  }
  putchar(ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     118a <main+0x5a>
movsbl -0x5(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
je     117c <main+0x4c>
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1185 <main+0x55>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1166 <main+0x36>
movsbl %al,%ebx
mov    %ebx,%edi
call   1050 <isalpha@plt>
cmp    $0x1,%rax
sbb    $0xff,%bl
movsbl %bl,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %12, label %3
3: ; preds = %0, %3
%4 = phi i8 [ %10, %3 ], [ %1, %0 ]
%5 = tail call i64 @isalpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i8
%8 = add i8 %4, %7
%9 = tail call i32 @putchar(i8 signext %8)
%10 = tail call signext i8 (...) @getchar()
%11 = icmp eq i8 %10, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %0
%13 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
int test_imm_38uint32_reg(unsigned int val) {
  return ((val) & (0x38 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_38uint32_reg(i32 %0) {
%2 = and i32 %0, 56
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *str) {
  char *sp = malloc(strlen(str) + 1);
  if (sp == NULL) {
    return NULL;
  }
  strcpy(sp, str);
  return sp;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Type definitions */
struct bt_node {
  int dummy;
};

/* Variables and functions */
struct bt_node *bt_new_node(void *);
struct bt_node **bt_search(struct bt_node **,
                           int (*)(void const *, void const *), void *);
void bt_insert(struct bt_node **tree,
               int (*compare)(const void *, const void *), void *data) {
  struct bt_node **node = bt_search(tree, compare, data);
  if (*node == NULL) {
    *node = bt_new_node(data);
  }
}


x86 assembly (clang, -O0):
<bt_insert>:
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),%rdx
call   1030 <bt_search@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    116a <bt_insert+0x4a>
mov    -0x18(%rbp),%rdi
call   1040 <bt_new_node@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bt_insert>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1030 <bt_search@plt>
cmpq   $0x0,(%rax)
jne    1140 <bt_insert+0x20>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <bt_new_node@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.bt_node = type { i32 }
define void @bt_insert(%struct.bt_node** %0, i32 (i8*, i8*)* %1, i8* %2) {
%4 = tail call %struct.bt_node** @bt_search(%struct.bt_node** %0, i32 (i8*, i8*)* %1, i8* %2)
%5 = load %struct.bt_node*, %struct.bt_node** %4
%6 = icmp eq %struct.bt_node* %5, null
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call %struct.bt_node* @bt_new_node(i8* %2)
store %struct.bt_node* %8, %struct.bt_node** %4
br label %9
9: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) void BEPackInt32(uint8_t container[4], int32_t data) {
  container[0] = (uint8_t)(data >> 24);
  container[1] = (uint8_t)(data >> 16);
  container[2] = (uint8_t)(data >> 8);
  container[3] = (uint8_t)data;
}


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

x86 assembly (clang, -O2):
<BEPackInt32>:
mov    %esi,%eax
sar    $0x18,%eax
cltq
mov    %rax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
cltq
mov    %rax,0x8(%rdi)
movslq %esi,%rax
sar    $0x8,%esi
movslq %esi,%rcx
mov    %rcx,0x10(%rdi)
mov    %rax,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @BEPackInt32(i64* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
%4 = sext i32 %3 to i64
store i64 %4, i64* %0
%5 = ashr i32 %1, 16
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %6, i64* %7
%8 = ashr i32 %1, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %9, i64* %10
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %11, i64* %12
ret void
}
void cpu_pause(void) { __asm__ volatile("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @cpu_pause() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ fid;
};
typedef TYPE_1__ XFontStruct;

/* Variables and functions */
unsigned long get_XFontStruct_fid(void *_p) {
  return (unsigned long)((XFontStruct *)_p)->fid;
}


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

x86 assembly (clang, -O2):
<get_XFontStruct_fid>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XFontStruct_fid(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ SCSI_Out_Bits_SaveConfig();
void SCSI_Out_Bits_Sleep(void) { SCSI_Out_Bits_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @SCSI_Out_Bits_Sleep() {
%1 = tail call i32 (...) @SCSI_Out_Bits_SaveConfig()
ret void
}
/* Variables and functions */
int error(int, char *);
int b_time(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  return error(49, argv[0]);
}


x86 assembly (clang, -O0):
<b_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1142 <b_time+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <b_time+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x31,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_time>:
cmp    $0x2,%edi
mov    (%rsi),%rsi
mov    $0x1,%eax
mov    $0x31,%edi
cmovge %eax,%edi
jmp    1030 <error@plt>

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

LLVM IR (-O2):
define i32 @b_time(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = load i8*, i8** %1
%5 = select i1 %3, i32 1, i32 49
%6 = tail call i32 @error(i32 %5, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ shift_up(void *, int, int, int (*)(void *, void *));
void heapify_up(void *array, int asize, int esize,
                int compare(void *key1, void *key2)) {
  int i = 2;
  while (i <= asize) {
    shift_up(array, i, esize, compare);
    i++;
  }
  return;
}


x86 assembly (clang, -O0):
<heapify_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     115a <heapify_up+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <shift_up@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <heapify_up+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify_up>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x2,%esi
jl     1152 <heapify_up+0x42>
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%r12
neg    %ebx
mov    $0x2,%ebp
nop
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <shift_up@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
jne    1130 <heapify_up+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @heapify_up(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3) {
%5 = icmp slt i32 %1, 2
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ 2, %4 ]
%8 = tail call i32 @shift_up(i8* %0, i32 %7, i32 %2, i32 (i8*, i8*)* %3)
%9 = add nuw i32 %7, 1
%10 = icmp eq i32 %7, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %4
ret void
}
unsigned int get_unsigned_int_max() {
  unsigned int max = ~0;
  return (max);
}


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

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

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

LLVM IR (-O2):
define i32 @get_unsigned_int_max() {
ret i32 -1
}
/* Variables and functions */
size_t get_args_lg(const char *const *args) {
  if (NULL == args) {
    return 0;
  }
  size_t lg = 0;
  while (NULL != args[lg]) {
    ++lg;
  }
  return lg;
}


x86 assembly (clang, -O0):
<get_args_lg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1121 <get_args_lg+0x21>
movq   $0x0,-0x8(%rbp)
jmp    1156 <get_args_lg+0x56>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
cmp    (%rcx,%rdx,8),%rax
je     114e <get_args_lg+0x4e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1129 <get_args_lg+0x29>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_args_lg>:
test   %rdi,%rdi
je     1120 <get_args_lg+0x20>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <get_args_lg+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @get_args_lg(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %4, %3 ]
ret i64 %10
}
/* Type definitions */
struct variable {
  int dummy;
};
struct lexer {
  int dummy;
};
struct dictionary {
  int dummy;
};

/* Variables and functions */
struct variable const *parse_variable(struct lexer *,
                                      struct dictionary const *);
const struct variable *parse_variable_const(struct lexer *l,
                                            const struct dictionary *d) {
  return parse_variable(l, d);
}


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

x86 assembly (clang, -O2):
<parse_variable_const>:
jmp    1030 <parse_variable@plt>

LLVM IR (-O0):
%struct.variable = type { i32 }
%struct.lexer = type { i32 }
%struct.dictionary = type { i32 }
define %struct.variable* @parse_variable_const(%struct.lexer* %0, %struct.dictionary* %1) {
%3 = alloca %struct.lexer*
%4 = alloca %struct.dictionary*
store %struct.lexer* %0, %struct.lexer** %3
store %struct.dictionary* %1, %struct.dictionary** %4
%5 = load %struct.lexer*, %struct.lexer** %3
%6 = load %struct.dictionary*, %struct.dictionary** %4
%7 = call %struct.variable* @parse_variable(%struct.lexer* %5, %struct.dictionary* %6)
ret %struct.variable* %7
}

LLVM IR (-O2):
%struct.variable = type { i32 }
%struct.lexer = type { i32 }
%struct.dictionary = type { i32 }
define %struct.variable* @parse_variable_const(%struct.lexer* %0, %struct.dictionary* %1) {
%3 = tail call %struct.variable* @parse_variable(%struct.lexer* %0, %struct.dictionary* %1)
ret %struct.variable* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int ld_to_ll(double);
double ll_to_ld(long long);
main() {
  long long n;
  if (ll_to_ld(10LL) != 10.0)
    abort();
  if (ld_to_ll(10.0) != 10)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <ll_to_ld@plt>
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1176 <main+0x36>
jp     1176 <main+0x36>
jmp    117d <main+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  0xe7b(%rip),%xmm0
call   1050 <ld_to_ll@plt>
cmp    $0xa,%eax
je     119a <main+0x5a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <ll_to_ld@plt>
ucomisd 0xead(%rip),%xmm0
jne    1170 <main+0x30>
jp     1170 <main+0x30>
movsd  0xea1(%rip),%xmm0
call   1050 <ld_to_ll@plt>
cmp    $0xa,%eax
jne    1170 <main+0x30>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call double @ll_to_ld(i64 10)
%4 = fcmp une double %3, 1.000000e+01
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @ld_to_ll(double 1.000000e+01)
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %7
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @ll_to_ld(i64 10)
%2 = fcmp une double %1, 1.000000e+01
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @ld_to_ll(double 1.000000e+01)
%7 = icmp eq i32 %6, 10
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ h2o_fatal(char *);
void *malloc(size_t);
void *h2o_mem_alloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    h2o_fatal("no memory");
  return p;
}


x86 assembly (clang, -O0):
<h2o_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <h2o_mem_alloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <h2o_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <h2o_mem_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <h2o_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"no memory\00"
define noalias i8* @h2o_mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @h2o_fatal(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int device_get_config_int(char *);
void *oti067_common_init(char *, int);
void *oti067_init() {
  int vram_size = device_get_config_int("memory");
  return oti067_common_init("oti067/bios.bin", vram_size);
}


x86 assembly (clang, -O0):
<oti067_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <device_get_config_int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1040 <oti067_common_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oti067_init>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <device_get_config_int@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <oti067_common_init@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"memory\00"
@.str.1 = [16 x i8] c"oti067/bios.bin\00"
define i8* @oti067_init() {
%1 = alloca i32
%2 = call i32 @device_get_config_int(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i8* @oti067_common_init(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"memory\00"
@.str.1 = [16 x i8] c"oti067/bios.bin\00"
define i8* @oti067_init() {
%1 = tail call i32 @device_get_config_int(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @oti067_common_init(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void svg_printf_end(void) { printf("</svg>\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"</svg>\00"
define void @svg_printf_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int power(int i) {
  if (i == 0)
    return 1;
  else if (i == 1)
    return 10;
  else
    return 10 * power(i - 1);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <power+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1158 <power+0x48>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <power+0x37>
movl   $0xa,-0x4(%rbp)
jmp    1158 <power+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <power@plt>
imul   $0xa,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
mov    $0x1,%ecx
test   %edi,%edi
je     1121 <power+0x21>
nopl   0x0(%rax)
cmp    $0x1,%edi
je     112a <power+0x2a>
add    $0xffffffff,%edi
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
test   %edi,%edi
jne    1110 <power+0x10>
mov    $0x1,%eax
imul   %ecx,%eax
ret
mov    $0xa,%eax
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i32 [ 1, %1 ], [ %7, %5 ]
%4 = phi i32 [ %0, %1 ], [ %6, %5 ]
switch i32 %4, label %5 [
i32 0, label %8
i32 1, label %9
]
5: ; preds = %2
%6 = add nsw i32 %4, -1
%7 = mul nsw i32 %3, 10
br label %2
8: ; preds = %2
br label %9
9: ; preds = %2, %8
%10 = phi i32 [ 1, %8 ], [ 10, %2 ]
%11 = mul nsw i32 %10, %3
ret i32 %11
}
__attribute__((always_)) const double fmink(double x, double y) {
  return x < y ? x : y;
}


x86 assembly (clang, -O0):
<fmink>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fmink+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <fmink+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmink>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmink(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @fmink(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void yy_1_AttributeStar(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_AttributeStar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_1_AttributeStar(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int start_trie();
int zen_trie_init() { return start_trie(); }


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

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

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

LLVM IR (-O2):
define i32 @zen_trie_init() {
%1 = tail call i32 (...) @start_trie()
ret i32 %1
}
void sysfs_remove_file(struct kobject *x, struct attribute const *y) { return; }


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
%struct.attribute = type opaque
define void @sysfs_remove_file(%struct.kobject* %0, %struct.attribute* %1) {
%3 = alloca %struct.kobject*
%4 = alloca %struct.attribute*
store %struct.kobject* %0, %struct.kobject** %3
store %struct.attribute* %1, %struct.attribute** %4
ret void
}

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute = type opaque
define void @sysfs_remove_file(%struct.kobject* nocapture %0, %struct.attribute* nocapture %1) {
ret void
}
unsigned int orgfx_vga_AVMP() {
  unsigned int status_reg = *((volatile unsigned int *)((0x97000000 + 0x004)));
  status_reg = status_reg >> 16;
  return status_reg & 1;
}


x86 assembly (clang, -O0):
<orgfx_vga_AVMP>:
push   %rbp
mov    %rsp,%rbp
mov    $0x97000004,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfx_vga_AVMP>:
mov    $0x97000004,%eax
mov    (%rax),%eax
shr    $0x10,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @orgfx_vga_AVMP() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 2533359620 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = lshr i32 %3, 16
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @orgfx_vga_AVMP() {
%1 = load volatile i32, i32* inttoptr (i64 2533359620 to i32*)
%2 = lshr i32 %1, 16
%3 = and i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ gptp(char *, int);
void g_pthread_t() { gptp("pthread_t", sizeof(pthread_t)); }


x86 assembly (clang, -O0):
<g_pthread_t>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <gptp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_pthread_t>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <gptp@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"pthread_t\00"
define void @g_pthread_t() {
%1 = tail call i32 @gptp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
int Percentile2Byte(int vPerc) { return (vPerc * 255) / 100; }


x86 assembly (clang, -O0):
<Percentile2Byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xff,-0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Percentile2Byte>:
mov    %edi,%eax
shl    $0x8,%eax
sub    %edi,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Percentile2Byte(i32 %0) {
%2 = mul nsw i32 %0, 255
%3 = sdiv i32 %2, 100
ret i32 %3
}
/* Variables and functions */
scalar_t__ calloc(int, int);
void leaking() {
  char *c;
  c = (char *)calloc(15, sizeof(*c));
}


x86 assembly (clang, -O0):
<leaking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @leaking() {
%1 = alloca i8*
%2 = call i64 @calloc(i32 15, i32 1)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
ret void
}

LLVM IR (-O2):
define void @leaking() {
%1 = tail call i64 @calloc(i32 15, i32 1)
ret void
}
int smb347_AC_in_current(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @smb347_AC_in_current() {
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
void rmEol(char *p) {
  char *q;
  if (q = strchr(p, '\n'))
    *q = 0;
  if (q = strchr(p, '\r'))
    *q = 0;
}


x86 assembly (clang, -O0):
<rmEol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     113f <rmEol+0x2f>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1162 <rmEol+0x52>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmEol>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <rmEol+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <rmEol+0x2b>
movb   $0x0,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @rmEol(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 13)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i8 0, i8* %6
br label %9
9: ; preds = %8, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI_RP_DisableRxInt();
int /*<<< orphan*/ SPI_RP_DisableTxInt();
void SPI_RP_DisableInt(void) {
  SPI_RP_DisableTxInt();
  SPI_RP_DisableRxInt();
}


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

x86 assembly (clang, -O2):
<SPI_RP_DisableInt>:
push   %rax
xor    %eax,%eax
call   1040 <SPI_RP_DisableTxInt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SPI_RP_DisableRxInt@plt>

LLVM IR (-O0):
define void @SPI_RP_DisableInt() {
%1 = call i32 (...) @SPI_RP_DisableTxInt()
%2 = call i32 (...) @SPI_RP_DisableRxInt()
ret void
}

LLVM IR (-O2):
define void @SPI_RP_DisableInt() {
%1 = tail call i32 (...) @SPI_RP_DisableTxInt()
%2 = tail call i32 (...) @SPI_RP_DisableRxInt()
ret void
}