xunge/DecIR huggingface dataset:
int test_imm_F6uint8_mem(unsigned char *val) {
  return ((*val) & (-0xF6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F6uint8_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, -246
%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_F6uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 10
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void dio_ssp_stop() { ; }


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

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

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

LLVM IR (-O2):
define void @dio_ssp_stop() {
ret void
}
void HSMMCSDIntrStatusClear(unsigned int baseAddr, unsigned int flag) {
  (*((volatile unsigned int *)(baseAddr + (0x230)))) = flag;
}


x86 assembly (clang, -O0):
<HSMMCSDIntrStatusClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x230,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSMMCSDIntrStatusClear>:
add    $0x230,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @HSMMCSDIntrStatusClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 560
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @HSMMCSDIntrStatusClear(i32 %0, i32 %1) {
%3 = add i32 %0, 560
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
void srand48(long s) {}


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

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

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

LLVM IR (-O2):
define void @srand48(i64 %0) {
ret void
}
void RTZipDecompress(void) {}


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

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

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

LLVM IR (-O2):
define void @RTZipDecompress() {
ret void
}
void TestIsZero(void) {
  (void)0;
  (void)0;
  (void)0;
  (void)0;
}


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

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

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

LLVM IR (-O2):
define void @TestIsZero() {
ret void
}
/* Variables and functions */
short POLLHUP;
short POLLIN;
short POLLOUT;
short chan_flags_to_pollfd_events(int chan_fd_flags) {
  short events = 0;
  if ((chan_fd_flags & ((1 << 0) | (1 << 2))) != 0)
    events |= POLLIN | POLLHUP;
  if ((chan_fd_flags & (1 << 1)) != 0)
    events |= POLLOUT;
  return events;
}


x86 assembly (clang, -O0):
<chan_flags_to_pollfd_events>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
mov    -0x4(%rbp),%eax
and    $0x5,%eax
cmp    $0x0,%eax
je     113c <chan_flags_to_pollfd_events+0x3c>
mov    0x2eb5(%rip),%rax
movswl (%rax),%ecx
mov    0x2eb3(%rip),%rax
movswl (%rax),%eax
or     %eax,%ecx
movswl -0x6(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     115f <chan_flags_to_pollfd_events+0x5f>
mov    0x2ea6(%rip),%rax
movswl (%rax),%ecx
movswl -0x6(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chan_flags_to_pollfd_events>:
mov    %edi,%ecx
and    $0x5,%ecx
mov    0x2ecc(%rip),%rdx
mov    0x2ecd(%rip),%rax
movzwl (%rax),%eax
or     (%rdx),%ax
test   %ecx,%ecx
cmove  %ecx,%eax
test   $0x2,%dil
je     1131 <chan_flags_to_pollfd_events+0x31>
mov    0x2ecd(%rip),%rcx
movzwl (%rcx),%ecx
or     %ecx,%eax
ret
xor    %ecx,%ecx
or     %ecx,%eax
ret

LLVM IR (-O0):
@POLLIN = global i16 0
@POLLHUP = global i16 0
@POLLOUT = global i16 0
define signext i16 @chan_flags_to_pollfd_events(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
store i16 0, i16* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 5
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i16, i16* @POLLIN
%9 = sext i16 %8 to i32
%10 = load i16, i16* @POLLHUP
%11 = sext i16 %10 to i32
%12 = or i32 %9, %11
%13 = load i16, i16* %3
%14 = sext i16 %13 to i32
%15 = or i32 %14, %12
%16 = trunc i32 %15 to i16
store i16 %16, i16* %3
br label %17
17: ; preds = %7, %1
%18 = load i32, i32* %2
%19 = and i32 %18, 2
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load i16, i16* @POLLOUT
%23 = sext i16 %22 to i32
%24 = load i16, i16* %3
%25 = sext i16 %24 to i32
%26 = or i32 %25, %23
%27 = trunc i32 %26 to i16
store i16 %27, i16* %3
br label %28
28: ; preds = %21, %17
%29 = load i16, i16* %3
ret i16 %29
}

LLVM IR (-O2):
@POLLIN = global i16 0
@POLLHUP = global i16 0
@POLLOUT = global i16 0
define signext i16 @chan_flags_to_pollfd_events(i32 %0) {
%2 = and i32 %0, 5
%3 = icmp eq i32 %2, 0
%4 = load i16, i16* @POLLIN
%5 = load i16, i16* @POLLHUP
%6 = or i16 %5, %4
%7 = select i1 %3, i16 0, i16 %6
%8 = and i32 %0, 2
%9 = icmp eq i32 %8, 0
%10 = load i16, i16* @POLLOUT
%11 = select i1 %9, i16 0, i16 %10
%12 = or i16 %7, %11
ret i16 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int __block_index4(int i, int n, int sz) {
  if (i == n) {
    return sz;
  }
  return i * sz / n - ((i * sz / n) & 0x3);
}


x86 assembly (clang, -O0):
<__block_index4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1124 <__block_index4+0x24>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <__block_index4+0x4a>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
and    $0x3,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__block_index4>:
mov    %edx,%eax
cmp    %esi,%edi
je     110f <__block_index4+0xf>
imul   %edi,%eax
cltd
idiv   %esi
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @__block_index4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %7
store i32 %12, i32* %4
br label %26
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %6
%18 = sdiv i32 %16, %17
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %6
%23 = sdiv i32 %21, %22
%24 = and i32 %23, 3
%25 = sub nsw i32 %18, %24
store i32 %25, i32* %4
br label %26
26: ; preds = %13, %11
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @__block_index4(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = mul nsw i32 %2, %0
%7 = sdiv i32 %6, %1
%8 = and i32 %7, -4
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %8, %5 ], [ %2, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
FILE *open_master() {
  FILE *master = fopen("headers/master.h", "w");
  if (master == NULL) {
    fprintf(stderr, "ERROR: unable to open file headers/master.h\n");
    exit(-2);
  }
  return master;
}


x86 assembly (clang, -O0):
<open_master>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1179 <open_master+0x49>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_master>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     114b <open_master+0x1b>
pop    %rcx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"headers/master.h\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.2 = [45 x i8] c"ERROR: unable to open file headers/master.h\0A\00"
define i32* @open_master() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @exit(i32 -2)
unreachable
9: ; preds = %0
%10 = load i32*, i32** %1
ret i32* %10
}

LLVM IR (-O2):
@.str = [17 x i8] c"headers/master.h\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.2 = [45 x i8] c"ERROR: unable to open file headers/master.h\0A\00"
define noalias i32* @open_master() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -2)
unreachable
7: ; preds = %0
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int help() {
  char const *help =
      "\nLinInspect : Written by Jack Riales\n\nVerbosity\t-v\tEnables "
      "printing of debug information.\nSwap Space\t-s\tIncludes any available "
      "swap space in\n\t\t\tshowing the memory "
      "information.\nHelp\t\t-h\tPrints this help information.";
  printf("%s\n\n", help);
  return 0;
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xfbf(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [215 x i8] c"\0ALinInspect : Written by Jack Riales\0A\0AVerbosity\09-v\09Enables printing of debug information.\0ASwap Space\09-s\09Includes any available swap space in\0A\09\09\09showing the memory information.\0AHelp\09\09-h\09Prints this help information.\00"
@.str.1 = [5 x i8] c"%s\0A\0A\00"
define i32 @help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([215 x i8], [215 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [215 x i8] c"\0ALinInspect : Written by Jack Riales\0A\0AVerbosity\09-v\09Enables printing of debug information.\0ASwap Space\09-s\09Includes any available swap space in\0A\09\09\09showing the memory information.\0AHelp\09\09-h\09Prints this help information.\00"
@.str.1 = [5 x i8] c"%s\0A\0A\00"
define i32 @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([215 x i8], [215 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int bext_l(int *, int *, int *);
int intr_wrap_524(int p1, int p2, int p3) { return bext_l(&p1, &p2, &p3); }


x86 assembly (clang, -O0):
<intr_wrap_524>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <bext_l@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_524>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <bext_l@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @intr_wrap_524(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @bext_l(i32* %4, i32* %5, i32* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(void) { printf("I'm being initted!\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"I'm being initted!\0A\00"
define void @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"I'm being initted!\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_free(void *ptr, void *mem_user_data) { free(ptr); }


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

x86 assembly (clang, -O2):
<default_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @default_free(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_diagonal_homotopy(int a, int b) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(165, &a, &b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<standard_diagonal_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0xa5,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_diagonal_homotopy>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0xa5,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @standard_diagonal_homotopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc4c(i32 165, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @standard_diagonal_homotopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 165, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void print_version(void) {
  printf("bee-cache-inventory v%d.%d.%d - "
         "by Tobias Dreyer <dreyer@molgen.mpg.de> 2012\n",
         1, 0, 0);
}


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

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [78 x i8] c"bee-cache-inventory v%d.%d.%d - by Tobias Dreyer <dreyer@molgen.mpg.de> 2012\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [78 x i8] c"bee-cache-inventory v%d.%d.%d - by Tobias Dreyer <dreyer@molgen.mpg.de> 2012\0A\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
ret void
}
int test_imm_4Auint16_reg(unsigned short val) {
  return ((val) & (0x4A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Auint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x4a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_4Auint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 74
%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_4Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 74
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ draw_stats();
void render_stats() { draw_stats(); }


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

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

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

LLVM IR (-O2):
define void @render_stats() {
%1 = tail call i32 (...) @draw_stats()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
scalar_t__ _mm_extract_epi32(int /*<<< orphan*/, int);
unsigned long long int foo32(__m128i x) {
  return (unsigned int)_mm_extract_epi32(x, 2);
}


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

x86 assembly (clang, -O2):
<foo32>:
push   %rax
mov    $0x2,%esi
call   1030 <_mm_extract_epi32@plt>
mov    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @foo32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @_mm_extract_epi32(i32 %3, i32 2)
%5 = trunc i64 %4 to i32
%6 = zext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @foo32(i32 %0) {
%2 = tail call i64 @_mm_extract_epi32(i32 %0, i32 2)
%3 = and i64 %2, 4294967295
ret i64 %3
}
void rop3_54_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_54_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_54_1_0>:
mov    (%rdi),%al
or     %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_54_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = or i32 %27, %33
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %4
store i8 %35, i8* %36
ret void
}

LLVM IR (-O2):
define void @rop3_54_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = xor i8 %1, -1
%7 = and i8 %5, %6
%8 = and i8 %4, %1
%9 = or i8 %7, %8
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
size_t c_tree_max_size(void) { return (-1); }


x86 assembly (clang, -O0):
<c_tree_max_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_tree_max_size>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @c_tree_max_size() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @c_tree_max_size() {
ret i64 -1
}
int equalsint(long int a, long int b) { return a == b; }


x86 assembly (clang, -O0):
<equalsint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalsint>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @equalsint(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned invert2(unsigned x, int p, int n) {
  unsigned y = ((~(x >> (p - n + 1)) & ~(~0 << n)) << (p - n + 1));
  unsigned mask = ~(~0 << n) << (p - n + 1);
  x = x & ~mask;
  x = x | y;
  return x;
}


x86 assembly (clang, -O0):
<invert2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
shr    %cl,%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert2>:
mov    %edx,%r8d
sub    %edx,%esi
add    $0x1,%esi
mov    %edi,%edx
mov    %esi,%ecx
shr    %cl,%edx
not    %edx
mov    $0xffffffff,%eax
mov    %r8d,%ecx
shl    %cl,%eax
not    %eax
and    %eax,%edx
mov    %esi,%ecx
shl    %cl,%edx
shl    %cl,%eax
not    %eax
and    %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @invert2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = sub nsw i32 %10, %11
%13 = add nsw i32 %12, 1
%14 = lshr i32 %9, %13
%15 = xor i32 %14, -1
%16 = load i32, i32* %6
%17 = shl i32 -1, %16
%18 = xor i32 %17, -1
%19 = and i32 %15, %18
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = sub nsw i32 %20, %21
%23 = add nsw i32 %22, 1
%24 = shl i32 %19, %23
store i32 %24, i32* %7
%25 = load i32, i32* %6
%26 = shl i32 -1, %25
%27 = xor i32 %26, -1
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = sub nsw i32 %28, %29
%31 = add nsw i32 %30, 1
%32 = shl i32 %27, %31
store i32 %32, i32* %8
%33 = load i32, i32* %4
%34 = load i32, i32* %8
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
store i32 %36, i32* %4
%37 = load i32, i32* %4
%38 = load i32, i32* %7
%39 = or i32 %37, %38
store i32 %39, i32* %4
%40 = load i32, i32* %4
ret i32 %40
}

LLVM IR (-O2):
define i32 @invert2(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %2
%5 = add nsw i32 %4, 1
%6 = lshr i32 %0, %5
%7 = xor i32 %6, -1
%8 = shl nsw i32 -1, %2
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = shl i32 %10, %5
%12 = shl i32 %9, %5
%13 = xor i32 %12, -1
%14 = and i32 %13, %0
%15 = or i32 %11, %14
ret i32 %15
}
/* Variables and functions */
int _nc_has_mouse();
int hsncurses_has_mouse() { return _nc_has_mouse(); }


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

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

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

LLVM IR (-O2):
define i32 @hsncurses_has_mouse() {
%1 = tail call i32 (...) @_nc_has_mouse()
ret i32 %1
}
void wfff_xml_read(void) {}


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

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

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

LLVM IR (-O2):
define void @wfff_xml_read() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *, int, int);
void split_reverse(char *str, int start2, int start3, int len) {
  reverse(str, 0, start2 - 1);
  reverse(str, start2, start3 - 1);
  reverse(str, start3, len - 1);
}


x86 assembly (clang, -O0):
<split_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_reverse>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
lea    -0x1(%r15),%edx
xor    %esi,%esi
call   1030 <reverse@plt>
lea    -0x1(%r14),%edx
mov    %rbx,%rdi
mov    %r15d,%esi
call   1030 <reverse@plt>
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <reverse@plt>

LLVM IR (-O0):
define void @split_reverse(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = call i32 @reverse(i8* %9, i32 0, i32 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = sub nsw i32 %15, 1
%17 = call i32 @reverse(i8* %13, i32 %14, i32 %16)
%18 = load i8*, i8** %5
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = sub nsw i32 %20, 1
%22 = call i32 @reverse(i8* %18, i32 %19, i32 %21)
ret void
}

LLVM IR (-O2):
define void @split_reverse(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, -1
%6 = tail call i32 @reverse(i8* %0, i32 0, i32 %5)
%7 = add nsw i32 %2, -1
%8 = tail call i32 @reverse(i8* %0, i32 %1, i32 %7)
%9 = add nsw i32 %3, -1
%10 = tail call i32 @reverse(i8* %0, i32 %2, i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_ATTRIBUTE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_ATTRIBUTE_it;
void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a) {
  ASN1_item_free((ASN1_VALUE *)a, &X509_ATTRIBUTE_it);
}


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

x86 assembly (clang, -O2):
<X509_ATTRIBUTE_free>:
mov    0x2ec1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@X509_ATTRIBUTE_it = global i32 0
define void @X509_ATTRIBUTE_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @X509_ATTRIBUTE_it)
ret void
}
int solib_main(int arg) { return arg * arg * arg; }


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

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

LLVM IR (-O0):
define i32 @solib_main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @solib_main(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
void strcatch(char *b, char c) {
  char *e = b + strlen(b);
  *e++ = c;
  *e = 0;
}


x86 assembly (clang, -O0):
<strcatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcatch>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @strcatch(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8* %10, i8** %5
%11 = load i8, i8* %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
store i8 %11, i8* %12
%14 = load i8*, i8** %5
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @strcatch(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %1, i8* %5
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void miscstringhook_free(void *hook) {
  if (hook) {
    sfree(hook);
  }
  return;
}


x86 assembly (clang, -O0):
<miscstringhook_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <miscstringhook_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<miscstringhook_free>:
test   %rdi,%rdi
je     111a <miscstringhook_free+0xa>
jmp    1030 <sfree@plt>
ret

LLVM IR (-O0):
define void @miscstringhook_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @sfree(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @miscstringhook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_DFint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xDF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DFint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xdf,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_DFint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 223
%7 = icmp ne i64 %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_DFint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 957777707008
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int atoi(char *);
int get_int(char **q, size_t len) {
  char old;
  int res;
  char *p = *q;
  old = p[len];
  p[len] = '\0';
  res = atoi(p);
  p[len] = old;
  p += len;
  *q = p;
  return res;
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    (%rdi),%rbx
lea    (%rbx,%rsi,1),%r12
mov    (%rbx,%rsi,1),%bpl
movb   $0x0,(%rbx,%rsi,1)
mov    %rbx,%rdi
call   1030 <atoi@plt>
mov    %bpl,(%rbx,%r15,1)
mov    %r12,(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_int(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
%5 = alloca i8
%6 = alloca i32
%7 = alloca i8*
store i8** %0, i8*** %3
store i64 %1, i64* %4
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i64, i64* %4
%12 = getelementptr inbounds i8, i8* %10, i64 %11
%13 = load i8, i8* %12
store i8 %13, i8* %5
%14 = load i8*, i8** %7
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %7
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %6
%19 = load i8, i8* %5
%20 = load i8*, i8** %7
%21 = load i64, i64* %4
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8 %19, i8* %22
%23 = load i64, i64* %4
%24 = load i8*, i8** %7
%25 = getelementptr inbounds i8, i8* %24, i64 %23
store i8* %25, i8** %7
%26 = load i8*, i8** %7
%27 = load i8**, i8*** %3
store i8* %26, i8** %27
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @get_int(i8** nocapture %0, i64 %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 %1
%5 = load i8, i8* %4
store i8 0, i8* %4
%6 = tail call i32 @atoi(i8* %3)
store i8 %5, i8* %4
store i8* %4, i8** %0
ret i32 %6
}
int Operand_bt16_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~(0 << 4)) != 0;
  *valp = *valp >> 4;
  return error;
}


x86 assembly (clang, -O0):
<Operand_bt16_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xffffffff,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shr    $0x4,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_bt16_encode>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
shr    $0x4,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @Operand_bt16_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = lshr i32 %10, 4
%12 = load i32*, i32** %2
store i32 %11, i32* %12
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @Operand_bt16_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = lshr i32 %2, 4
store i32 %5, i32* %0
ret i32 %4
}
long syscall0(long nr) {
  register long r0 asm("rax") = nr;
  asm volatile("syscall" : "=r"(r0) : "r"(r0) : "rcx", "r11", "memory");
  return r0;
}


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

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

LLVM IR (-O0):
define i64 @syscall0(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = call i64 asm sideeffect "syscall", "={rax},{rax},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @syscall0(i64 %0) {
%2 = tail call i64 asm sideeffect "syscall", "={rax},{rax},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *malloc_X(size_t size) {
  void *res = malloc(size);
  if (!res) {
    do {
      perror("malloc");
      exit(EXIT_FAILURE);
    } while (0);
  }
  return res;
}


x86 assembly (clang, -O0):
<malloc_X>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <malloc_X+0x43>
jmp    1159 <malloc_X+0x29>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_X>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <malloc_X+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define i8* @malloc_X(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 ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; No predecessors!
br label %14
14: ; preds = %13, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @malloc_X(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
void *malloc(unsigned int);
int /*<<< orphan*/ stderr;
void *Malloc(unsigned n) {
  void *p;
  if (!(p = malloc(n))) {
    fprintf(stderr, "Malloc(%d) failed.\n", n);
    fflush(stderr);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1191 <Malloc+0x51>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     1158 <Malloc+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e81(%rip),%r14
mov    (%r14),%edi
lea    0xe97(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Malloc(%d) failed.\0A\00"
define i8* @Malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %14, label %7
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i32, i32* %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fflush(i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Malloc(%d) failed.\0A\00"
define noalias i8* @Malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ vx86_NBSB_Write(int, unsigned char, unsigned long);
void sb1_Write(unsigned char offset, unsigned long val) {
  vx86_NBSB_Write(3, offset, val);
}


x86 assembly (clang, -O0):
<sb1_Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rdx
mov    $0x3,%edi
movzbl %al,%esi
call   1030 <vx86_NBSB_Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb1_Write>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <vx86_NBSB_Write@plt>

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

LLVM IR (-O2):
define void @sb1_Write(i8 zeroext %0, i64 %1) {
%3 = tail call i32 @vx86_NBSB_Write(i32 3, i8 zeroext %0, i64 %1)
ret void
}
int pico_is_digit(char c) {
  if (c < '0' || c > '9')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<pico_is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <pico_is_digit+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1130 <pico_is_digit+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1137 <pico_is_digit+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pico_is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @pico_is_digit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 48
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 0, i32* %2
br label %13
12: ; preds = %7
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @pico_is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
float celsiusToFarenheit(long c) { return (c * 1.8) + 32; }


x86 assembly (clang, -O0):
<celsiusToFarenheit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsiusToFarenheit>:
cvtsi2sd %rdi,%xmm0
mulsd  0xef3(%rip),%xmm0
addsd  0xef3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @celsiusToFarenheit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = call double @llvm.fmuladd.f64(double %4, double 1.800000e+00, double 3.200000e+01)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @celsiusToFarenheit(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
void foo554() {}


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

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

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

LLVM IR (-O2):
define void @foo554() {
ret void
}