xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ entree();
int /*<<< orphan*/ sombrero1();
int /*<<< orphan*/ sombrero2();
int /*<<< orphan*/ sombrero3();
int /*<<< orphan*/ sombrero4();
int main() {
  entree();
  sombrero1();
  sombrero2();
  sombrero4();
  sombrero3();
  while (1)
    sombrero4();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <entree@plt>
mov    $0x0,%al
call   1040 <sombrero1@plt>
mov    $0x0,%al
call   1050 <sombrero2@plt>
mov    $0x0,%al
call   1060 <sombrero4@plt>
mov    $0x0,%al
call   1030 <sombrero3@plt>
mov    $0x0,%al
call   1060 <sombrero4@plt>
jmp    1182 <main+0x32>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <entree@plt>
xor    %eax,%eax
call   1040 <sombrero1@plt>
xor    %eax,%eax
call   1050 <sombrero2@plt>
xor    %eax,%eax
call   1060 <sombrero4@plt>
xor    %eax,%eax
call   1030 <sombrero3@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <sombrero4@plt>
jmp    1180 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @entree()
%3 = call i32 (...) @sombrero1()
%4 = call i32 (...) @sombrero2()
%5 = call i32 (...) @sombrero4()
%6 = call i32 (...) @sombrero3()
br label %7
7: ; preds = %0, %7
%8 = call i32 (...) @sombrero4()
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @entree()
%2 = tail call i32 (...) @sombrero1()
%3 = tail call i32 (...) @sombrero2()
%4 = tail call i32 (...) @sombrero4()
%5 = tail call i32 (...) @sombrero3()
br label %6
6: ; preds = %0, %6
%7 = tail call i32 (...) @sombrero4()
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int die;
  srand(time(NULL));
  die = rand() % 6 + 1;
  printf("Congrats, you rolled a %d!\n", die);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Congrats, you rolled a %d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Congrats, you rolled a %d!\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_TSTP(int /*<<< orphan*/);
int gen_TSTP() { handle_TSTP(0); }


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

x86 assembly (clang, -O2):
<gen_TSTP>:
xor    %edi,%edi
jmp    1030 <handle_TSTP@plt>

LLVM IR (-O0):
define i32 @gen_TSTP() {
%1 = alloca i32
%2 = call i32 @handle_TSTP(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_TSTP() {
%1 = tail call i32 @handle_TSTP(i32 0)
ret i32 undef
}
char is_vowel(short ch) {
  return ((ch == 'a') || (ch == 'e') || (ch == 'i') || (ch == 'o') ||
          (ch == 'u'));
}


x86 assembly (clang, -O0):
<is_vowel>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
je     1160 <is_vowel+0x60>
movswl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x65,%ecx
mov    %al,-0x3(%rbp)
je     1160 <is_vowel+0x60>
movswl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x69,%ecx
mov    %al,-0x3(%rbp)
je     1160 <is_vowel+0x60>
movswl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6f,%ecx
mov    %al,-0x3(%rbp)
je     1160 <is_vowel+0x60>
movswl -0x2(%rbp),%eax
cmp    $0x75,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_vowel>:
lea    -0x61(%rdi),%ecx
ror    %cx
cmp    $0x8,%cx
jae    1118 <is_vowel+0x18>
mov    $0x1,%al
mov    $0x95,%edx
bt     %ecx,%edx
jb     111f <is_vowel+0x1f>
cmp    $0x75,%di
sete   %al
ret

LLVM IR (-O0):
define signext i8 @is_vowel(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp eq i32 %4, 97
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp eq i32 %8, 101
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i16, i16* %2
%12 = sext i16 %11 to i32
%13 = icmp eq i32 %12, 105
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i16, i16* %2
%16 = sext i16 %15 to i32
%17 = icmp eq i32 %16, 111
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i16, i16* %2
%20 = sext i16 %19 to i32
%21 = icmp eq i32 %20, 117
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
%25 = trunc i32 %24 to i8
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @is_vowel(i16 signext %0) {
%2 = add i16 %0, -97
%3 = tail call i16 @llvm.fshl.i16(i16 %2, i16 %2, i16 15)
%4 = icmp ult i16 %3, 8
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = icmp eq i16 %0, 117
%7 = zext i1 %6 to i8
br label %13
8: ; preds = %1
%9 = trunc i16 %3 to i8
%10 = lshr i8 -107, %9
%11 = and i8 %10, 1
%12 = icmp eq i8 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %8, %5
%14 = phi i8 [ %7, %5 ], [ 1, %8 ]
ret i8 %14
}
/* Variables and functions */
int /*<<< orphan*/ MultiMapGadgets(int);
void RemapAllGadgets() {
  MultiMapGadgets(((1 << 3) | (1 << 4) | (1 << 5)) | (1 << 1));
}


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

x86 assembly (clang, -O2):
<RemapAllGadgets>:
mov    $0x3a,%edi
jmp    1030 <MultiMapGadgets@plt>

LLVM IR (-O0):
define void @RemapAllGadgets() {
%1 = call i32 @MultiMapGadgets(i32 58)
ret void
}

LLVM IR (-O2):
define void @RemapAllGadgets() {
%1 = tail call i32 @MultiMapGadgets(i32 58)
ret void
}
int func(void) {
  int n = 3;
  int m = 5;
  n &= m;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
unsigned char test_bit_reverse8(unsigned char v) {
  unsigned char result = 0;
  int w = sizeof(char) * 8;
  int i;
  for (i = 0; i < w; i++) {
    if (v & (1 << i))
      result |= 1 << (w - i - 1);
  }
  return result;
}


x86 assembly (clang, -O0):
<test_bit_reverse8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1171 <test_bit_reverse8+0x71>
movzbl -0x1(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115e <test_bit_reverse8+0x5e>
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
jmp    1163 <test_bit_reverse8+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <test_bit_reverse8+0x1c>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit_reverse8>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @test_bit_reverse8(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %2
store i8 0, i8* %3
store i32 8, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %28, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %31
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = load i32, i32* %5
%14 = shl i32 1, %13
%15 = and i32 %12, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %27
17: ; preds = %10
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = sub nsw i32 %18, %19
%21 = sub nsw i32 %20, 1
%22 = shl i32 1, %21
%23 = load i8, i8* %3
%24 = zext i8 %23 to i32
%25 = or i32 %24, %22
%26 = trunc i32 %25 to i8
store i8 %26, i8* %3
br label %27
27: ; preds = %17, %10
br label %28
28: ; preds = %27
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %6
31: ; preds = %6
%32 = load i8, i8* %3
ret i8 %32
}

LLVM IR (-O2):
define zeroext i8 @test_bit_reverse8(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add(struct node *);
struct node *initnode(int);
int /*<<< orphan*/ printnode(struct node *);
int main() {
  struct node *head = initnode(5);
  add(initnode(6));
  printnode(head);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <initnode@plt>
mov    %rax,-0x8(%rbp)
mov    $0x6,%edi
call   1040 <initnode@plt>
mov    %rax,%rdi
call   1030 <add@plt>
mov    -0x8(%rbp),%rdi
call   1050 <printnode@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1040 <initnode@plt>
mov    %rax,%rbx
mov    $0x6,%edi
call   1040 <initnode@plt>
mov    %rax,%rdi
call   1030 <add@plt>
mov    %rbx,%rdi
call   1050 <printnode@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca %struct.node*
%2 = call %struct.node* @initnode(i32 5)
store %struct.node* %2, %struct.node** %1
%3 = call %struct.node* @initnode(i32 6)
%4 = call i32 @add(%struct.node* %3)
%5 = load %struct.node*, %struct.node** %1
%6 = call i32 @printnode(%struct.node* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = tail call %struct.node* @initnode(i32 5)
%2 = tail call %struct.node* @initnode(i32 6)
%3 = tail call i32 @add(%struct.node* %2)
%4 = tail call i32 @printnode(%struct.node* %1)
ret i32 0
}
int iemgui_modulo_color(int col) {
  while (col >= 30)
    col -= 30;
  while (col < 0)
    col += 30;
  return (col);
}


x86 assembly (clang, -O0):
<iemgui_modulo_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1e,-0x4(%rbp)
jl     111f <iemgui_modulo_color+0x1f>
mov    -0x4(%rbp),%eax
sub    $0x1e,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <iemgui_modulo_color+0x7>
jmp    1124 <iemgui_modulo_color+0x24>
cmpl   $0x0,-0x4(%rbp)
jge    113c <iemgui_modulo_color+0x3c>
mov    -0x4(%rbp),%eax
add    $0x1e,%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <iemgui_modulo_color+0x24>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iemgui_modulo_color>:
cmp    $0x1d,%edi
mov    $0x1d,%eax
cmovl  %edi,%eax
neg    %eax
add    %edi,%eax
add    $0x1d,%eax
mov    $0x88888889,%edx
imul   %rdx,%rax
shr    $0x24,%rax
mov    %eax,%ecx
shl    $0x5,%ecx
sub    %eax,%ecx
sub    %eax,%ecx
mov    %edi,%eax
sub    %ecx,%eax
xor    %esi,%esi
test   %eax,%eax
cmovg  %eax,%esi
add    %ecx,%esi
xor    %eax,%eax
sub    %edi,%esi
setne  %al
sub    %eax,%esi
imul   %rdx,%rsi
shr    $0x24,%rsi
add    %eax,%esi
mov    %esi,%eax
shl    $0x5,%eax
sub    %esi,%eax
sub    %esi,%eax
add    %edi,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @iemgui_modulo_color(i32 %0) {
%2 = add i32 %0, 29
%3 = call i32 @llvm.smin.i32(i32 %0, i32 29)
%4 = sub i32 %2, %3
%5 = urem i32 %4, 30
%6 = sub i32 %4, %5
%7 = sub i32 %0, %6
%8 = call i32 @llvm.smax.i32(i32 %7, i32 0)
%9 = add i32 %8, %6
%10 = sub i32 %9, %0
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = sub i32 %10, %12
%14 = udiv i32 %13, 30
%15 = add nuw nsw i32 %14, %12
%16 = mul i32 %15, 30
%17 = add i32 %16, %0
%18 = sub i32 %17, %6
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ g5_runMC(int);
void(g5_runMC_)(int *devid) { g5_runMC(*devid); }


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

x86 assembly (clang, -O2):
<g5_runMC_>:
mov    (%rdi),%edi
jmp    1030 <g5_runMC@plt>

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

LLVM IR (-O2):
define void @g5_runMC_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @g5_runMC(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void _nxweb_close_good_socket(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<_nxweb_close_good_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @_nxweb_close_good_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void update_grid() { printf("%s\n", "update grid!"); }


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

x86 assembly (clang, -O2):
<update_grid>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [13 x i8] c"update grid!\00"
define void @update_grid() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
__attribute__((deprecated)) uint64_t ntohll(uint64_t x) { return be64toh(x); }


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

x86 assembly (clang, -O2):
<ntohll>:
jmp    1030 <be64toh@plt>

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

LLVM IR (-O2):
define i32 @ntohll(i32 %0) {
%2 = tail call i32 @be64toh(i32 %0)
ret i32 %2
}
__attribute__((always_)) void trace_mm_pagevec_free(struct page *page,
                                                    int cold) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @trace_mm_pagevec_free(%struct.page* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double const *, int);
void MatrixCopy(const double *a, int m, int n, double *b) {
  memcpy(b, a, m * n * sizeof(double));
  return;
}


x86 assembly (clang, -O0):
<MatrixCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatrixCopy>:
mov    %rdi,%rax
imul   %esi,%edx
shl    $0x3,%edx
mov    %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @MatrixCopy(double* %0, i32 %1, i32 %2, double* %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%9 = load double*, double** %8
%10 = load double*, double** %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = mul nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 8
%16 = trunc i64 %15 to i32
%17 = call i32 @memcpy(double* %9, double* %10, i32 %16)
ret void
}

LLVM IR (-O2):
define void @MatrixCopy(double* %0, i32 %1, i32 %2, double* %3) {
%5 = shl i32 %1, 3
%6 = mul i32 %5, %2
%7 = tail call i32 @memcpy(double* %3, double* %0, i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __sighandler_t;

/* Variables and functions */
int /*<<< orphan*/ SA_RESETHAND;
int /*<<< orphan*/ _signal(int, int /*<<< orphan*/, int /*<<< orphan*/);
__sighandler_t sysv_signal(int signum, __sighandler_t handler) {
  return _signal(signum, handler, SA_RESETHAND);
}


x86 assembly (clang, -O0):
<sysv_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
call   1030 <_signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysv_signal>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <_signal@plt>

LLVM IR (-O0):
@SA_RESETHAND = global i32 0
define i32 @sysv_signal(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 = load i32, i32* @SA_RESETHAND
%8 = call i32 @_signal(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SA_RESETHAND = global i32 0
define i32 @sysv_signal(i32 %0, i32 %1) {
%3 = load i32, i32* @SA_RESETHAND
%4 = tail call i32 @_signal(i32 %0, i32 %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("One small step for programmers\n");
  printf("One giant leap for mankind!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"One small step for programmers\0A\00"
@.str.1 = [29 x i8] c"One giant leap for mankind!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"One small step for programmers\00"
@str.2 = [28 x i8] c"One giant leap for mankind!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int setegid(int /*<<< orphan*/);
int pthread_setegid_np(gid_t gid) { return setegid(gid); }


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

x86 assembly (clang, -O2):
<pthread_setegid_np>:
jmp    1030 <setegid@plt>

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

LLVM IR (-O2):
define i32 @pthread_setegid_np(i32 %0) {
%2 = tail call i32 @setegid(i32 %0)
ret i32 %2
}
int compaq_nvram_store(void *rom_start) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @compaq_nvram_store(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int inh(uint16_t pc, const uint8_t *ram, char *buffer) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @inh(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
void bug4(void) {
  char *p = "Hello world\n";
  char dst[4];
  strcpy(dst, p);
  printf("%s:%s\n", __FUNCTION__, dst);
}


x86 assembly (clang, -O0):
<bug4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xc(%rbp),%rdx
lea    0xec2(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug4>:
push   %rax
movabs $0xa646c726f7720,%rax
mov    %rax,0x5(%rsp)
movabs $0x6f77206f6c6c6548,%rax
20 77 6f
mov    %rax,(%rsp)
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
@.str.1 = [7 x i8] c"%s:%s\0A\00"
@__FUNCTION__.bug4 = [5 x i8] c"bug4\00"
define void @bug4() {
%1 = alloca i8*
%2 = alloca [4 x i8]
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = load i8*, i8** %1
%5 = call i8* @strcpy(i8* %3, i8* %4)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.bug4, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world\0A\00"
@.str.1 = [7 x i8] c"%s:%s\0A\00"
@__FUNCTION__.bug4 = [5 x i8] c"bug4\00"
define void @bug4() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.bug4, i64 0, i64 0), i8* %2)
ret void
}
void log_deinit_stderr(void) {}


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

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

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

LLVM IR (-O2):
define void @log_deinit_stderr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void output4(int thisword) {
  putchar(thisword & 0xFF);
  putchar((thisword >> 8) & 0xFF);
  putchar((thisword >> 16) & 0xFF);
  putchar((thisword >> 24) & 0xFF);
  return;
}


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

x86 assembly (clang, -O2):
<output4>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <putchar@plt>
movzbl %bh,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <putchar@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @output4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @putchar(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @putchar(i32 %8)
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = call i32 @putchar(i32 %12)
%14 = load i32, i32* %2
%15 = ashr i32 %14, 24
%16 = and i32 %15, 255
%17 = call i32 @putchar(i32 %16)
ret void
}

LLVM IR (-O2):
define void @output4(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @putchar(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @putchar(i32 %5)
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = tail call i32 @putchar(i32 %8)
%10 = lshr i32 %0, 24
%11 = tail call i32 @putchar(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ssd1306_i2cInitEx(int, int, int);
void ssd1306_i2cInit() { ssd1306_i2cInitEx(-1, -1, 0x3C); }


x86 assembly (clang, -O0):
<ssd1306_i2cInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%esi
mov    $0x3c,%edx
mov    %esi,%edi
call   1030 <ssd1306_i2cInitEx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssd1306_i2cInit>:
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0x3c,%edx
jmp    1030 <ssd1306_i2cInitEx@plt>

LLVM IR (-O0):
define void @ssd1306_i2cInit() {
%1 = call i32 @ssd1306_i2cInitEx(i32 -1, i32 -1, i32 60)
ret void
}

LLVM IR (-O2):
define void @ssd1306_i2cInit() {
%1 = tail call i32 @ssd1306_i2cInitEx(i32 -1, i32 -1, i32 60)
ret void
}
/* Variables and functions */
scalar_t__ getenv(char *);
char *GetPath(void) {
  char *path = (char *)getenv("SM_SAVE_DIR");
  if (!path) {
    path = (char *)getenv("HOME");
    if (!path)
      path = ".";
  }
  return (path);
}


x86 assembly (clang, -O0):
<GetPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115e <GetPath+0x4e>
lea    0xed2(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1159 <GetPath+0x49>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <GetPath+0x4e>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPath>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1124 <GetPath+0x14>
pop    %rcx
ret
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
test   %rax,%rax
lea    0xed4(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"SM_SAVE_DIR\00"
@.str.1 = [5 x i8] c"HOME\00"
@.str.2 = [2 x i8] c".\00"
define i8* @GetPath() {
%1 = alloca i8*
%2 = call i64 @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %0
%7 = call i64 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %1
%9 = load i8*, i8** %1
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %12
12: ; preds = %11, %6
br label %13
13: ; preds = %12, %0
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"SM_SAVE_DIR\00"
@.str.1 = [5 x i8] c"HOME\00"
@.str.2 = [2 x i8] c".\00"
define i8* @GetPath() {
%1 = tail call i64 @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i64 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
%8 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* %6
br label %9
9: ; preds = %4, %0
%10 = phi i8* [ %2, %0 ], [ %8, %4 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ palindromicNumber();
int main() {
  palindromicNumber();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @palindromicNumber()
ret i32 0
}
double Sleef_fabs(double x) { return __builtin_fabs(x); }


x86 assembly (clang, -O0):
<Sleef_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_fabs>:
andps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @Sleef_fabs(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
/* Variables and functions */
int memcmp(unsigned char *, unsigned char *, int);
int BTREE_CompareKeys(unsigned char *key1, int key_len1, unsigned char *key2,
                      int key_len2) {
  int rc;
  if (key_len1 > key_len2)
    rc = memcmp(key1, key2, key_len2);
  else
    rc = memcmp(key1, key2, key_len1);
  if (!rc)
    rc = key_len1 - key_len2;
  return rc;
}


x86 assembly (clang, -O0):
<BTREE_CompareKeys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    114a <BTREE_CompareKeys+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x20(%rbp)
jmp    115d <BTREE_CompareKeys+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1170 <BTREE_CompareKeys+0x60>
mov    -0xc(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BTREE_CompareKeys>:
push   %rbx
mov    %esi,%eax
mov    %esi,%ebx
sub    %ecx,%ebx
cmovg  %ecx,%eax
mov    %rdx,%rsi
mov    %eax,%edx
call   1030 <memcmp@plt>
test   %eax,%eax
cmove  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @BTREE_CompareKeys(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp sgt i32 %1, %3
%6 = select i1 %5, i32 %3, i32 %1
%7 = tail call i32 @memcmp(i8* %0, i8* %2, i32 %6)
%8 = icmp eq i32 %7, 0
%9 = sub nsw i32 %1, %3
%10 = select i1 %8, i32 %9, i32 %7
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fix_screen();
int /*<<< orphan*/ init_term();
int /*<<< orphan*/ rebind_key_macros();
int /*<<< orphan*/ setup_screen(int /*<<< orphan*/);
int change_term() {
  fix_screen();
  init_term();
  setup_screen(0);
  rebind_key_macros();
  return 1;
}


x86 assembly (clang, -O0):
<change_term>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <fix_screen@plt>
mov    $0x0,%al
call   1030 <init_term@plt>
xor    %edi,%edi
call   1040 <setup_screen@plt>
mov    $0x0,%al
call   1050 <rebind_key_macros@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_term>:
push   %rax
xor    %eax,%eax
call   1060 <fix_screen@plt>
xor    %eax,%eax
call   1030 <init_term@plt>
xor    %edi,%edi
call   1040 <setup_screen@plt>
xor    %eax,%eax
call   1050 <rebind_key_macros@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @change_term() {
%1 = call i32 (...) @fix_screen()
%2 = call i32 (...) @init_term()
%3 = call i32 @setup_screen(i32 0)
%4 = call i32 (...) @rebind_key_macros()
ret i32 1
}

LLVM IR (-O2):
define i32 @change_term() {
%1 = tail call i32 (...) @fix_screen()
%2 = tail call i32 (...) @init_term()
%3 = tail call i32 @setup_screen(i32 0)
%4 = tail call i32 (...) @rebind_key_macros()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ mergehalves(size_t, int *);
void mergesort(size_t size, int *v) {
  if (size > 1) {
    mergesort(size / 2, v);
    mergesort((size + 1) / 2, v + size / 2);
    mergehalves(size, v);
  }
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x8(%rbp)
jbe    117d <mergesort+0x5d>
mov    -0x8(%rbp),%rdi
shr    $0x1,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
shr    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
shl    $0x2,%rax
add    %rax,%rsi
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mergehalves@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    $0x1,%rdi
jbe    115f <mergesort+0x3f>
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%r15
shr    %r15
mov    %r15,%rdi
call   1040 <mergesort@plt>
lea    0x1(%rbx),%rdi
shr    %rdi
lea    (%r14,%r15,4),%rsi
call   1040 <mergesort@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <mergehalves@plt>
ret

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

LLVM IR (-O2):
define void @mergesort(i64 %0, i32* %1) {
%3 = icmp ugt i64 %0, 1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i64 %0, 1
tail call void @mergesort(i64 %6, i32* %1)
%7 = add i64 %0, 1
%8 = lshr i64 %7, 1
%9 = getelementptr inbounds i32, i32* %1, i64 %6
tail call void @mergesort(i64 %8, i32* %9)
%10 = tail call i32 @mergehalves(i64 %0, i32* %1)
br label %4
}
void feed_theme_cleanup(struct feed_color_list *const p_color_list) {
  (void)(p_color_list);
}


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

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

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

LLVM IR (-O2):
%struct.feed_color_list = type opaque
define void @feed_theme_cleanup(%struct.feed_color_list* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg4setBank1(int);
void m31setParams5001(uint16_t addr, uint8_t val) {
  (void)addr;
  prg4setBank1(val << 12);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xc,%edi
jmp    1030 <prg4setBank1@plt>

LLVM IR (-O0):
define void @m31setParams5001(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 = shl i32 %6, 12
%8 = call i32 @prg4setBank1(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m31setParams5001(i32 %0, i32 %1) {
%3 = shl i32 %1, 12
%4 = tail call i32 @prg4setBank1(i32 %3)
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t len = 0;
  while (*s != 0) {
    len += 1;
    s += 1;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <strlen+0x3d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add i64 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %7, %4 ]
ret i64 %12
}
int test_imm_9Euint8_mem(unsigned char *val) {
  return ((*val) & (0x9E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -98
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int negative_compare(int x) { return x > -1 || x < 1; }


x86 assembly (clang, -O0):
<negative_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xffffffff,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1120 <negative_compare+0x20>
cmpl   $0x1,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @negative_compare(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @negative_compare(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int map_cmp_uint32(const void *v1, const void *v2, void *dummy) {
  uint32_t *i1 = (uint32_t *)v1;
  uint32_t *i2 = (uint32_t *)v2;
  return (*i1 > *i2) - (*i1 < *i2);
}


x86 assembly (clang, -O0):
<map_cmp_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x28(%rbp),%rdx
cmp    (%rdx),%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_cmp_uint32>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @map_cmp_uint32(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i64*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %7
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i64*
store i64* %12, i64** %8
%13 = load i64*, i64** %7
%14 = load i64, i64* %13
%15 = load i64*, i64** %8
%16 = load i64, i64* %15
%17 = icmp sgt i64 %14, %16
%18 = zext i1 %17 to i32
%19 = load i64*, i64** %7
%20 = load i64, i64* %19
%21 = load i64*, i64** %8
%22 = load i64, i64* %21
%23 = icmp slt i64 %20, %22
%24 = zext i1 %23 to i32
%25 = sub nsw i32 %18, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @map_cmp_uint32(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i64*
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp sgt i64 %6, %7
%9 = zext i1 %8 to i32
%10 = icmp slt i64 %6, %7
%11 = sext i1 %10 to i32
%12 = add nsw i32 %11, %9
ret i32 %12
}
float radians(float degrees) {
  return ((3.14159265358979323846f) / 180.0f) * degrees;
}


x86 assembly (clang, -O0):
<radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 0x3F91DF46A0000000, %3
ret float %4
}

LLVM IR (-O2):
define float @radians(float %0) {
%2 = fmul float %0, 0x3F91DF46A0000000
ret float %2
}
signed char return_char() { return 42; }


x86 assembly (clang, -O0):
<return_char>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_char>:
mov    $0x2a,%al
ret

LLVM IR (-O0):
define signext i8 @return_char() {
ret i8 42
}

LLVM IR (-O2):
define signext i8 @return_char() {
ret i8 42
}