xunge/DecIR huggingface dataset:
void test4(int b) {
  int *p = __builtin_malloc(sizeof(int) * 4);
  if (b)
    __builtin_free(p);
  *p = 5;
  __builtin_free(p);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <test4+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test4(i32 %0) {
ret void
}
/* Variables and functions */
int isMatch(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *s = "abbaabbbbababaababababbabbbaaaabbbbaaabbbabaabbbbbabbbbabbabbaaaba"
            "aaabbbbbbaaabbabbbbababbbaaabbabbabb";
  char *p = "***b**a*a*b***b*a*b*bbb**baa*bba**b**bb***b*a*aab*a**";
  printf("%d", isMatch(s, p));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xf26(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <isMatch@plt>
mov    %eax,%esi
lea    0xf42(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf38(%rip),%rsi
call   1030 <isMatch@plt>
lea    0xf62(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [103 x i8] c"abbaabbbbababaababababbabbbaaaabbbbaaabbbabaabbbbbabbbbabbabbaaabaaaabbbbbbaaabbabbbbababbbaaabbabbabb\00"
@.str.1 = [54 x i8] c"***b**a*a*b***b*a*b*bbb**baa*bba**b**bb***b*a*aab*a**\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @isMatch(i8* %4, i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [103 x i8] c"abbaabbbbababaababababbabbbaaaabbbbaaabbbabaabbbbbabbbbabbabbaaabaaaabbbbbbaaabbabbbbababbbaaabbabbabb\00"
@.str.1 = [54 x i8] c"***b**a*a*b***b*a*b*bbb**baa*bba**b**bb***b*a*aab*a**\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @isMatch(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g(int /*<<< orphan*/);
void h() { g(0); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <g@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @h() {
%1 = call i32 @g(i32 0)
ret void
}

LLVM IR (-O2):
define void @h() {
%1 = tail call i32 @g(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ islower(int);
void t_islower_0x64() {
  Assert_real((islower(100)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              505, ("islower should be 1 for d"));
}


x86 assembly (clang, -O0):
<t_islower_0x64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <islower@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1f9,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x64>:
push   %rax
mov    $0x64,%edi
call   1030 <islower@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1f9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for d\00"
define void @t_islower_0x64() {
%1 = call i32 @islower(i32 100)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for d\00"
define void @t_islower_0x64() {
%1 = tail call i32 @islower(i32 100)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
float load_le_float(const uint8_t *p) {
  union {
    float f;
    uint8_t b[sizeof(float)];
  } u;
  memcpy(u.b, p, sizeof(float));
  return u.f;
}


x86 assembly (clang, -O0):
<load_le_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_le_float>:
sub    $0x18,%rsp
mov    %rdi,%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%union.anon = type { [4 x i32] }
define float @load_le_float(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = bitcast %union.anon* %3 to [4 x i32]*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 4)
%8 = bitcast %union.anon* %3 to float*
%9 = load float, float* %8
ret float %9
}

LLVM IR (-O2):
%union.anon = type { [4 x i32] }
define float @load_le_float(i32* %0) {
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i8*
%4 = getelementptr inbounds %union.anon, %union.anon* %2, i64 0, i32 0, i64 0
%5 = call i32 @memcpy(i32* %4, i32* %0, i32 4)
%6 = bitcast %union.anon* %2 to float*
%7 = load float, float* %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int *foo(int *);
scalar_t__ malloc(int);
int main() {
  int *p = (int *)malloc(sizeof(int));
  int *q = foo(p);
  __CRAB_assert(*q >= 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <foo@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x6,(%rax)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1050 <foo@plt>
xor    %edi,%edi
cmpl   $0x6,(%rax)
setge  %dil
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i32* @foo(i32* %6)
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = icmp sge i32 %9, 6
%11 = zext i1 %10 to i32
%12 = call i32 @__CRAB_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32* @foo(i32* %2)
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 5
%6 = zext i1 %5 to i32
%7 = tail call i32 @__CRAB_assert(i32 %6)
ret i32 0
}
int SNDDummyInit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SNDDummyInit() {
ret i32 0
}
/* Type definitions */
struct flock {
  int l_type;
  int l_whence;
  void *l_len;
  void *l_start;
};
typedef void *off_t;

/* Variables and functions */
int fcntl(int, int, struct flock *);
int file_lock(int fd, int cmd, int type, off_t start, int whence, off_t len) {
  struct flock lock;
  lock.l_type = type;
  lock.l_start = start;
  lock.l_whence = whence;
  lock.l_len = len;
  return fcntl(fd, cmd, &lock);
}


x86 assembly (clang, -O0):
<file_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_lock>:
sub    $0x18,%rsp
mov    %edx,(%rsp)
mov    %rcx,0x10(%rsp)
mov    %r8d,0x4(%rsp)
mov    %r9,0x8(%rsp)
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @file_lock(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca %struct.flock
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%14 = load i32, i32* %9
%15 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 0
store i32 %14, i32* %15
%16 = load i8*, i8** %10
%17 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 3
store i8* %16, i8** %17
%18 = load i32, i32* %11
%19 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 1
store i32 %18, i32* %19
%20 = load i8*, i8** %12
%21 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 2
store i8* %20, i8** %21
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 @fcntl(i32 %22, i32 %23, %struct.flock* %13)
ret i32 %24
}

LLVM IR (-O2):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @file_lock(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca %struct.flock
%8 = bitcast %struct.flock* %7 to i8*
%9 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 0
store i32 %2, i32* %9
%10 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 3
store i8* %3, i8** %10
%11 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 1
store i32 %4, i32* %11
%12 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 2
store i8* %5, i8** %12
%13 = call i32 @fcntl(i32 %0, i32 %1, %struct.flock* %7)
ret i32 %13
}
int truncate(float flt) {
  int i;
  i = flt;
  return i;
}


x86 assembly (clang, -O0):
<truncate>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncate>:
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @truncate(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @truncate(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
/* Variables and functions */
scalar_t__ COND_GT();
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sgt_8_aw(void) { m68ki_write_8(EA_AW_8(), COND_GT() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_sgt_8_aw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AW_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_GT@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sgt_8_aw>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AW_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_GT@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sgt_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i64 (...) @COND_GT()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sgt_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i64 (...) @COND_GT()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
char *langDbgDevMsxMidi() { return "MSX MIDI"; }


x86 assembly (clang, -O0):
<langDbgDevMsxMidi>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgDevMsxMidi>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"MSX MIDI\00"
define i8* @langDbgDevMsxMidi() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"MSX MIDI\00"
define i8* @langDbgDevMsxMidi() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
unsigned long long TimerValueGet64(unsigned long ulBase) {
  unsigned long ulHigh1, ulHigh2, ulLow;
  ;
  do {
    ulHigh1 = (*((volatile unsigned long *)(ulBase + 0x0000004C)));
    ulLow = (*((volatile unsigned long *)(ulBase + 0x00000048)));
    ulHigh2 = (*((volatile unsigned long *)(ulBase + 0x0000004C)));
  } while (ulHigh1 != ulHigh2);
  return (((unsigned long long)ulHigh1 << 32) | (unsigned long long)ulLow);
}


x86 assembly (clang, -O0):
<TimerValueGet64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4c(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4c(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1108 <TimerValueGet64+0x8>
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerValueGet64>:
mov    0x4c(%rdi),%rax
mov    0x48(%rdi),%rcx
cmp    0x4c(%rdi),%rax
jne    1100 <TimerValueGet64>
shl    $0x20,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @TimerValueGet64(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %2
br label %6
6: ; preds = %19, %1
%7 = load i64, i64* %2
%8 = add i64 %7, 76
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
store i64 %10, i64* %3
%11 = load i64, i64* %2
%12 = add i64 %11, 72
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
store i64 %14, i64* %5
%15 = load i64, i64* %2
%16 = add i64 %15, 76
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
store i64 %18, i64* %4
br label %19
19: ; preds = %6
%20 = load i64, i64* %3
%21 = load i64, i64* %4
%22 = icmp ne i64 %20, %21
br i1 %22, label %6, label %23
23: ; preds = %19
%24 = load i64, i64* %3
%25 = shl i64 %24, 32
%26 = load i64, i64* %5
%27 = or i64 %25, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @TimerValueGet64(i64 %0) {
%2 = add i64 %0, 76
%3 = inttoptr i64 %2 to i64*
%4 = add i64 %0, 72
%5 = inttoptr i64 %4 to i64*
br label %6
6: ; preds = %6, %1
%7 = load volatile i64, i64* %3
%8 = load volatile i64, i64* %5
%9 = load volatile i64, i64* %3
%10 = icmp eq i64 %7, %9
br i1 %10, label %11, label %6
11: ; preds = %6
%12 = shl i64 %7, 32
%13 = or i64 %12, %8
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ quote_calc_parse();
int /*<<< orphan*/ stdin;
int main(void) {
  while (!feof(stdin)) {
    quote_calc_parse();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1152 <main+0x32>
jmp    115e <main+0x3e>
mov    $0x0,%al
call   1030 <quote_calc_parse@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    1144 <main+0x24>
xor    %eax,%eax
call   1030 <quote_calc_parse@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* @stdin
%4 = call i32 @feof(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @quote_calc_parse()
br label %2
9: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @feof(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = tail call i32 (...) @quote_calc_parse()
%6 = load i32, i32* @stdin
%7 = tail call i32 @feof(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %0
ret i32 0
}
int func(int a, int b) {
  int main;
  a = 3;
  main = a * b;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *, char const *, int);
void *malloc(size_t);
void *smalloc(size_t size, const char *file) {
  void *res = malloc(size);
  if (!res && size)
    fail("%s: allocation of %d bytes failed\n", file, (int)size);
  return res;
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1169 <smalloc+0x49>
cmpq   $0x0,-0x8(%rbp)
je     1169 <smalloc+0x49>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xe9c(%rip),%rdi
call   1030 <fail@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r15
test   %rbx,%rbx
je     114e <smalloc+0x2e>
test   %r15,%r15
jne    114e <smalloc+0x2e>
lea    0xebc(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <fail@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"%s: allocation of %d bytes failed\0A\00"
define i8* @smalloc(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %18, label %10
10: ; preds = %2
%11 = load i64, i64* %3
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = load i64, i64* %3
%16 = trunc i64 %15 to i32
%17 = call i32 @fail(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %16)
br label %18
18: ; preds = %13, %10, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s: allocation of %d bytes failed\0A\00"
define noalias i8* @smalloc(i64 %0, i8* %1) {
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %0, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = trunc i64 %0 to i32
%9 = tail call i32 @fail(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %8)
br label %10
10: ; preds = %7, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ keccak_absorb(int /*<<< orphan*/ *, int,
                                 unsigned char const *, unsigned long long,
                                 int);
void shake256_absorb(uint64_t *s, const unsigned char *input,
                     unsigned long long inputByteLen) {
  keccak_absorb(s, 136, input, inputByteLen, 0x1F);
}


x86 assembly (clang, -O0):
<shake256_absorb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x88,%esi
mov    $0x1f,%r8d
call   1030 <keccak_absorb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shake256_absorb>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x88,%esi
mov    $0x1f,%r8d
jmp    1030 <keccak_absorb@plt>

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

LLVM IR (-O2):
define void @shake256_absorb(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @keccak_absorb(i32* %0, i32 136, i8* %1, i64 %2, i32 31)
ret void
}
int divpwr2(int x, int n) {
  int t = x >> 31;
  return (x + (t ^ (t << n))) >> n;
}


x86 assembly (clang, -O0):
<divpwr2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    -0x10(%rbp),%ecx
xor    %edx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divpwr2>:
mov    %esi,%ecx
mov    %edi,%edx
sar    $0x1f,%edx
mov    %edx,%eax
shl    %cl,%eax
xor    %edx,%eax
add    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @divpwr2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = ashr i32 %6, 31
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = shl i32 %10, %11
%13 = xor i32 %9, %12
%14 = add nsw i32 %8, %13
%15 = load i32, i32* %4
%16 = ashr i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @divpwr2(i32 %0, i32 %1) {
%3 = ashr i32 %0, 31
%4 = shl nsw i32 %3, %1
%5 = xor i32 %4, %3
%6 = add nsw i32 %5, %0
%7 = ashr i32 %6, %1
ret i32 %7
}
int leastBitPos(int x) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @leastBitPos(i32 %0) {
ret i32 2
}
int getPriority(char op) {
  if (op == '^')
    return 2;
  if (op == '/' || op == '*' || op == '%')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<getPriority>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
jne    1123 <getPriority+0x23>
movl   $0x2,-0x4(%rbp)
jmp    115d <getPriority+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     114a <getPriority+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     114a <getPriority+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x25,%eax
jne    1156 <getPriority+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <getPriority+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPriority>:
cmp    $0x2e,%dil
jg     1114 <getPriority+0x14>
cmp    $0x25,%dil
je     1126 <getPriority+0x26>
cmp    $0x2a,%dil
je     1126 <getPriority+0x26>
jmp    112c <getPriority+0x2c>
cmp    $0x2f,%dil
je     1126 <getPriority+0x26>
mov    $0x2,%eax
cmp    $0x5e,%dil
jne    112c <getPriority+0x2c>
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getPriority(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 eq i32 %5, 94
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 2, i32* %2
br label %22
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 47
br i1 %11, label %20, label %12
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 42
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 37
br i1 %19, label %20, label %21
20: ; preds = %16, %12, %8
store i32 1, i32* %2
br label %22
21: ; preds = %16
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @getPriority(i8 signext %0) {
switch i8 %0, label %2 [
i8 94, label %4
i8 47, label %3
i8 42, label %3
i8 37, label %3
]
2: ; preds = %1
br label %4
3: ; preds = %1, %1, %1
br label %4
4: ; preds = %1, %3, %2
%5 = phi i32 [ 0, %2 ], [ 2, %1 ], [ 1, %3 ]
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ next_in;
};
typedef TYPE_1__ z_stream;

/* Variables and functions */
char *streaming_commons_get_next_in(z_stream *stream) {
  return (char *)stream->next_in;
}


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

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

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

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define i8* @streaming_commons_get_next_in(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void TimerARRPreloadConfigure(unsigned long ulBase,
                              unsigned long ulARRProload) {

  ;

  ;
  if (ulARRProload == 0x00000001) {
    (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00000080;
  } else {
    (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000080;
  }
}


x86 assembly (clang, -O0):
<TimerARRPreloadConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    112d <TimerARRPreloadConfigure+0x2d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x80,%rcx
mov    %rcx,(%rax)
jmp    113e <TimerARRPreloadConfigure+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xffffffffffffff7f,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerARRPreloadConfigure>:
xor    %eax,%eax
cmp    $0x1,%rsi
sete   %al
mov    $0xffffffffffffff7f,%rcx
and    (%rdi),%rcx
shl    $0x7,%rax
or     %rcx,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @TimerARRPreloadConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add i64 %8, 0
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 128
store volatile i64 %12, i64* %10
br label %19
13: ; preds = %2
%14 = load i64, i64* %3
%15 = add i64 %14, 0
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
%18 = and i64 %17, -129
store volatile i64 %18, i64* %16
br label %19
19: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
define void @TimerARRPreloadConfigure(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 1
%4 = inttoptr i64 %0 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -129
%7 = select i1 %3, i64 128, i64 0
%8 = or i64 %6, %7
store volatile i64 %8, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Merge(int *, int);
void MergeSort(int *vet, int n) {
  int x;
  if (n > 1) {
    x = n / 2;
    MergeSort(vet, x);
    MergeSort(vet + x, n - x);
    Merge(vet, n);
  }
}


x86 assembly (clang, -O0):
<MergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1179 <MergeSort+0x59>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <MergeSort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1040 <MergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <Merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MergeSort>:
cmp    $0x1,%esi
jle    1154 <MergeSort+0x34>
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
mov    %ebx,%esi
call   1040 <MergeSort@plt>
lea    (%r14,%rbx,4),%rdi
mov    %ebp,%esi
sub    %ebx,%esi
call   1040 <MergeSort@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <Merge@plt>
ret

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

LLVM IR (-O2):
define void @MergeSort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i32 %1, 1
tail call void @MergeSort(i32* %0, i32 %6)
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = sub nsw i32 %1, %6
tail call void @MergeSort(i32* %8, i32 %9)
%10 = tail call i32 @Merge(i32* %0, i32 %1)
br label %4
}
void SSMR3HandleIsLiveSave(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3HandleIsLiveSave() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void test4() {
  int *ptr;
  ptr = (int *)malloc(sizeof(int));
  free(ptr);
}


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

x86 assembly (clang, -O2):
<test4>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @test4() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @free(i32* %4)
ret void
}

LLVM IR (-O2):
define void @test4() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ PBEPARAM;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ PBEPARAM_it;
int i2d_PBEPARAM(PBEPARAM *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBEPARAM_it);
}


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

x86 assembly (clang, -O2):
<i2d_PBEPARAM>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@PBEPARAM_it = global i32 0
define i32 @i2d_PBEPARAM(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @PBEPARAM_it)
ret i32 %3
}
void all_threads_done(void) {}


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

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

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

LLVM IR (-O2):
define void @all_threads_done() {
ret void
}
void idr_find(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<idr_find>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<idr_find>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.idr_find = [9 x i8] c"idr_find\00"
define void @idr_find() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.idr_find, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.idr_find = [9 x i8] c"idr_find\00"
define void @idr_find() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.idr_find, i64 0, i64 0))
ret void
}
/* Variables and functions */
int CHAR_BIT;
int main(void) { return (int)1 >> (sizeof(int) - 1) * CHAR_BIT; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ece(%rip),%rax
movslq (%rax),%rax
imul   $0x3,%rax,%rax
mov    %eax,%ecx
mov    $0x1,%eax
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
lea    (%rax,%rax,2),%ecx
mov    $0x1,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @CHAR_BIT
%3 = sext i32 %2 to i64
%4 = mul i64 3, %3
%5 = trunc i64 %4 to i32
%6 = ashr i32 1, %5
ret i32 %6
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = load i32, i32* @CHAR_BIT
%2 = mul i32 %1, 3
%3 = lshr i32 1, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void g() {
  int x[3] = {2, 22, 222};
  printf("G says: %d %d %d\n", x[0], x[1], x[2]);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
mov    $0x16,%edx
mov    $0xde,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.g.x = [3 x i32] [i32 2, i32 22, i32 222]
@.str = [18 x i8] c"G says: %d %d %d\0A\00"
define void @g() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"G says: %d %d %d\0A\00"
define void @g() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 22, i32 222)
ret void
}
int os2_netinc(int timo) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @os2_netinc(i32 %0) {
ret i32 -1
}
int __stub_zero() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__stub_zero() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dcs_input();
char *skip_prefix(int /*<<< orphan*/, char *);
char *skip_dcs(char *input) {
  if ((unsigned char)*input == 0220) {
    return input + 1;
  }
  return skip_prefix(dcs_input(), input);
}


x86 assembly (clang, -O0):
<skip_dcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x90,%eax
jne    114f <skip_dcs+0x2f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <skip_dcs+0x45>
mov    $0x0,%al
call   1030 <dcs_input@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <skip_prefix@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_dcs>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x90,(%rdi)
jne    1132 <skip_dcs+0x12>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <dcs_input@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <skip_prefix@plt>

LLVM IR (-O0):
define i8* @skip_dcs(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 144
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %15
11: ; preds = %1
%12 = call i32 (...) @dcs_input()
%13 = load i8*, i8** %3
%14 = call i8* @skip_prefix(i32 %12, i8* %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %11, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @skip_dcs(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -112
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
br label %9
6: ; preds = %1
%7 = tail call i32 (...) @dcs_input()
%8 = tail call i8* @skip_prefix(i32 %7, i8* %0)
br label %9
9: ; preds = %6, %4
%10 = phi i8* [ %5, %4 ], [ %8, %6 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
unsigned int aes_detect_dec_with_rev(int, int /*<<< orphan*/ const *, void *);
unsigned int aes_detect_dec(const uint32_t *ctx, void *key) {
  unsigned int len;
  len = aes_detect_dec_with_rev(true, ctx, key);
  if (len)
    return len;
  return aes_detect_dec_with_rev(false, ctx, key);
}


x86 assembly (clang, -O0):
<aes_detect_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%edi
call   1030 <aes_detect_dec_with_rev@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114a <aes_detect_dec+0x3a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <aes_detect_dec+0x4c>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
call   1030 <aes_detect_dec_with_rev@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_detect_dec>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <aes_detect_dec_with_rev@plt>
test   %eax,%eax
je     1136 <aes_detect_dec+0x26>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <aes_detect_dec_with_rev@plt>

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

LLVM IR (-O2):
define i32 @aes_detect_dec(i32* %0, i8* %1) {
%3 = tail call i32 @aes_detect_dec_with_rev(i32 1, i32* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @aes_detect_dec_with_rev(i32 0, i32* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %8
}
/* Variables and functions */
double chi2cdf(double, double);
double exp(double);
scalar_t__ pca_divisions();
double pow(double, double);
double mixture_pvalue(double DB) {
  double BC, k, chisq;
  BC = exp(-DB);
  chisq = 4.0 * (1.0 - BC);
  k = pow((double)pca_divisions(), 2.0);
  return chi2cdf(chisq, k);
}


x86 assembly (clang, -O0):
<mixture_pvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xe95(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xe80(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1050 <pca_divisions@plt>
cvtsi2sd %rax,%xmm0
movsd  0xe5b(%rip),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <chi2cdf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixture_pvalue>:
push   %rax
xorpd  0xec7(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xeca(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xec6(%rip),%xmm1
movsd  %xmm1,(%rsp)
xor    %eax,%eax
call   1050 <pca_divisions@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm1
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <chi2cdf@plt>

LLVM IR (-O0):
define double @mixture_pvalue(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = fneg double %6
%8 = call double @exp(double %7)
store double %8, double* %3
%9 = load double, double* %3
%10 = fsub double 1.000000e+00, %9
%11 = fmul double 4.000000e+00, %10
store double %11, double* %5
%12 = call i64 (...) @pca_divisions()
%13 = sitofp i64 %12 to double
%14 = call double @pow(double %13, double 2.000000e+00)
store double %14, double* %4
%15 = load double, double* %5
%16 = load double, double* %4
%17 = call double @chi2cdf(double %15, double %16)
ret double %17
}

LLVM IR (-O2):
define double @mixture_pvalue(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
%4 = fsub double 1.000000e+00, %3
%5 = fmul double %4, 4.000000e+00
%6 = tail call i64 (...) @pca_divisions()
%7 = sitofp i64 %6 to double
%8 = fmul double %7, %7
%9 = tail call double @chi2cdf(double %5, double %8)
ret double %9
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
float float_pos_inf() {
  union {
    float f;
    int32_t i;
  } u;
  u.i = 0x7F800000;
  return u.f;
}


x86 assembly (clang, -O0):
<float_pos_inf>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7f800000,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { float }
define float @float_pos_inf() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 2139095040, i32* %2
%3 = bitcast %union.anon* %1 to float*
%4 = load float, float* %3
ret float %4
}

LLVM IR (-O2):
define float @float_pos_inf() {
ret float 0x7FF0000000000000
}
volatile char *copyright_notice(void) {
  return "Contains multiple-precision arithmetic code originally written by "
         "David Ireland,"
         " copyright (c) 2001-8 by D.I. Management Services Pty Limited "
         "<www.di-mgt.com.au>,"
         " and is used with permission.";
}


x86 assembly (clang, -O0):
<copyright_notice>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyright_notice>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [192 x i8] c"Contains multiple-precision arithmetic code originally written by David Ireland, copyright (c) 2001-8 by D.I. Management Services Pty Limited <www.di-mgt.com.au>, and is used with permission.\00"
define i8* @copyright_notice() {
ret i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [192 x i8] c"Contains multiple-precision arithmetic code originally written by David Ireland, copyright (c) 2001-8 by D.I. Management Services Pty Limited <www.di-mgt.com.au>, and is used with permission.\00"
define i8* @copyright_notice() {
ret i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str, i64 0, i64 0)
}