xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ d86f_has_extra_bit_cells(int);
int d86f_track_header_size(int drive) {
  int temp = 6;
  if (d86f_has_extra_bit_cells(drive))
    temp += 4;
  return temp;
}


x86 assembly (clang, -O0):
<d86f_track_header_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <d86f_has_extra_bit_cells@plt>
cmp    $0x0,%rax
je     113d <d86f_track_header_size+0x2d>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d86f_track_header_size>:
push   %rax
call   1030 <d86f_has_extra_bit_cells@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0x6(,%rcx,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @d86f_track_header_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 6, i32* %3
%4 = load i32, i32* %2
%5 = call i64 @d86f_has_extra_bit_cells(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 4
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @d86f_track_header_size(i32 %0) {
%2 = tail call i64 @d86f_has_extra_bit_cells(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 6, i32 10
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x41() {
  Assert_real((isdigit(65) == 0),
              "/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_isdigit.c",
              330, ("isdigit should be 0 for A"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x41>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x14a,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x41>:
push   %rax
mov    $0x41,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14a,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for A\00"
define void @t_isdigit_0x41() {
%1 = call i64 @isdigit(i32 65)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 330, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for A\00"
define void @t_isdigit_0x41() {
%1 = tail call i64 @isdigit(i32 65)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 330, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank0(int);
void m82setParams7EFA(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank0((val & 0xFC) << 11);
}


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

x86 assembly (clang, -O2):
<m82setParams7EFA>:
mov    %esi,%edi
shl    $0xb,%edi
and    $0x7e000,%edi
jmp    1030 <prg8setBank0@plt>

LLVM IR (-O0):
define void @m82setParams7EFA(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 252
%8 = shl i32 %7, 11
%9 = call i32 @prg8setBank0(i32 %8)
ret void
}

LLVM IR (-O2):
define void @m82setParams7EFA(i32 %0, i32 %1) {
%3 = shl i32 %1, 11
%4 = and i32 %3, 516096
%5 = tail call i32 @prg8setBank0(i32 %4)
ret void
}
int logicalShift(int x, int n) { return (x >> n) & (~((1 << 31) >> n << 1)); }


x86 assembly (clang, -O0):
<logicalShift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x8(%rbp),%ecx
mov    $0x80000000,%edx
sar    %cl,%edx
mov    %edx,%ecx
shl    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicalShift>:
mov    %esi,%ecx
sar    %cl,%edi
mov    $0x80000000,%eax
sar    %cl,%eax
add    %eax,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %4
%9 = ashr i32 -2147483648, %8
%10 = shl i32 %9, 1
%11 = xor i32 %10, -1
%12 = and i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = ashr i32 -2147483648, %1
%5 = shl i32 %4, 1
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
ret i32 %7
}
/* Type definitions */
struct netent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dump_net(struct netent *);
int /*<<< orphan*/ endnetent();
struct netent *getnetent();
int /*<<< orphan*/ printf(char *);
void test_net() {
  printf("start walk around net entry\n");
  struct netent *h = 0;
  while ((h = getnetent()) != 0) {
    dump_net(h);
  }
  endnetent();
  printf("end\n");
}


x86 assembly (clang, -O0):
<test_net>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getnetent@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     117f <test_net+0x3f>
mov    -0x8(%rbp),%rdi
call   1060 <dump_net@plt>
jmp    115c <test_net+0x1c>
mov    $0x0,%al
call   1050 <endnetent@plt>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_net>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getnetent@plt>
test   %rax,%rax
je     1166 <test_net+0x26>
mov    %rax,%rdi
call   1060 <dump_net@plt>
jmp    1150 <test_net+0x10>
xor    %eax,%eax
call   1050 <endnetent@plt>
lea    0xea8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.netent = type { i32 }
@.str = [29 x i8] c"start walk around net entry\0A\00"
@.str.1 = [5 x i8] c"end\0A\00"
define void @test_net() {
%1 = alloca %struct.netent*
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store %struct.netent* null, %struct.netent** %1
br label %3
3: ; preds = %6, %0
%4 = call %struct.netent* (...) @getnetent()
store %struct.netent* %4, %struct.netent** %1
%5 = icmp ne %struct.netent* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load %struct.netent*, %struct.netent** %1
%8 = call i32 @dump_net(%struct.netent* %7)
br label %3
9: ; preds = %3
%10 = call i32 (...) @endnetent()
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.netent = type { i32 }
@str = [28 x i8] c"start walk around net entry\00"
@str.2 = [4 x i8] c"end\00"
define void @test_net() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call %struct.netent* (...) @getnetent()
%3 = icmp eq %struct.netent* %2, null
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = phi %struct.netent* [ %7, %4 ], [ %2, %0 ]
%6 = tail call i32 @dump_net(%struct.netent* %5)
%7 = tail call %struct.netent* (...) @getnetent()
%8 = icmp eq %struct.netent* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %0
%10 = tail call i32 (...) @endnetent()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *allocate(size_t n, size_t m) { return calloc(n, m); }


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

x86 assembly (clang, -O2):
<allocate>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @allocate(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 = call i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @allocate(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *getbasename(const char *f) {
  const char *p;
  if ((p = strrchr(f, '/')))
    f = p + 1;
  return f;
}


x86 assembly (clang, -O0):
<getbasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1144 <getbasename+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbasename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @getbasename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void mallocAssert(int *g) {
  struct xx *p = malloc(12);
  ((g != 0) ? (void)(0)
            : __assert_fail(
                  "g != 0",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/abduld/clreflect/refs/"
                  "heads/master/QMOLEDEV/clang-3.1.src/test/Analysis/malloc.c",
                  603, __func__));
  free(p);
  return;
}


x86 assembly (clang, -O0):
<mallocAssert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115a <mallocAssert+0x2a>
jmp    117b <mallocAssert+0x4b>
lea    0xe9f(%rip),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x25b,%edx
lea    0xf3e(%rip),%rcx
mov    $0x0,%al
call   1040 <__assert_fail@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocAssert>:
test   %rdi,%rdi
je     1116 <mallocAssert+0x6>
ret
lea    0xee3(%rip),%rdi
lea    0xee3(%rip),%rsi
lea    0xf87(%rip),%rcx
mov    $0x25b,%edx
xor    %eax,%eax
jmp    1030 <__assert_fail@plt>

LLVM IR (-O0):
%struct.xx = type opaque
@.str = [7 x i8] c"g != 0\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/abduld/clreflect/refs/heads/master/QMOLEDEV/clang-3.1.src/test/Analysis/malloc.c\00"
@__func__.mallocAssert = [13 x i8] c"mallocAssert\00"
define void @mallocAssert(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.xx*
store i32* %0, i32** %2
%4 = call i8* @malloc(i64 12)
%5 = bitcast i8* %4 to %struct.xx*
store %struct.xx* %5, %struct.xx** %3
%6 = load i32*, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %11
9: ; preds = %1
%10 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0), i32 603, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.mallocAssert, i64 0, i64 0))
br label %11
11: ; preds = %9, %8
%12 = load %struct.xx*, %struct.xx** %3
%13 = bitcast %struct.xx* %12 to i8*
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"g != 0\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/abduld/clreflect/refs/heads/master/QMOLEDEV/clang-3.1.src/test/Analysis/malloc.c\00"
@__func__.mallocAssert = [13 x i8] c"mallocAssert\00"
define void @mallocAssert(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0), i32 603, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.mallocAssert, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TRNG_DriverIRQHandler();
__attribute__((weak)) void TRNG_IRQHandler(void) { TRNG_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @TRNG_IRQHandler() {
%1 = call i32 (...) @TRNG_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @TRNG_IRQHandler() {
%1 = tail call i32 (...) @TRNG_DriverIRQHandler()
ret void
}
int answer(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @answer() {
ret i32 42
}

LLVM IR (-O2):
define i32 @answer() {
ret i32 42
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  char s[] = "12AF";
  int val = htoi(s);
  printf("val = %d\n", val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x15(%rbp),%rdi
call   1040 <htoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x46413231,(%rsp)
mov    %rsp,%rdi
call   1040 <htoi@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s = [5 x i8] c"12AF\00"
@.str = [10 x i8] c"val = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [5 x i8]* %6 to i8*
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%10 = call i32 @htoi(i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [5 x i8] c"12AF\00"
@.str = [10 x i8] c"val = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 @htoi(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void status_increment(uint64_t *dest) {
  ((void)0);
  (*dest)++;
}


x86 assembly (clang, -O0):
<status_increment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_increment>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @status_increment(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_scroll_tab();
int /*<<< orphan*/ init_ttl_syllable_tab();
int /*<<< orphan*/ reset_scroll_ttl_syllable();
void init_scroll(void) {
  init_ttl_syllable_tab();
  init_scroll_tab();
  reset_scroll_ttl_syllable();
}


x86 assembly (clang, -O0):
<init_scroll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_ttl_syllable_tab@plt>
mov    $0x0,%al
call   1050 <init_scroll_tab@plt>
mov    $0x0,%al
call   1040 <reset_scroll_ttl_syllable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_scroll>:
push   %rax
xor    %eax,%eax
call   1030 <init_ttl_syllable_tab@plt>
xor    %eax,%eax
call   1050 <init_scroll_tab@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <reset_scroll_ttl_syllable@plt>

LLVM IR (-O0):
define void @init_scroll() {
%1 = call i32 (...) @init_ttl_syllable_tab()
%2 = call i32 (...) @init_scroll_tab()
%3 = call i32 (...) @reset_scroll_ttl_syllable()
ret void
}

LLVM IR (-O2):
define void @init_scroll() {
%1 = tail call i32 (...) @init_ttl_syllable_tab()
%2 = tail call i32 (...) @init_scroll_tab()
%3 = tail call i32 (...) @reset_scroll_ttl_syllable()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int /*<<< orphan*/ EVP_PKEY_assign_RSA(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ *EVP_PKEY_new();
int /*<<< orphan*/ *RSA_generate_key(int const, int, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
EVP_PKEY *ssl_key_genrsa(const int keysize) {
  EVP_PKEY *pkey;
  RSA *rsa;
  rsa = RSA_generate_key(keysize, 3, NULL, NULL);
  if (!rsa)
    return NULL;
  pkey = EVP_PKEY_new();
  EVP_PKEY_assign_RSA(pkey, rsa);
  return pkey;
}


x86 assembly (clang, -O0):
<ssl_key_genrsa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x3,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1050 <RSA_generate_key@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116b <ssl_key_genrsa+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    118b <ssl_key_genrsa+0x5b>
mov    $0x0,%al
call   1040 <EVP_PKEY_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <EVP_PKEY_assign_RSA@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_key_genrsa>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <RSA_generate_key@plt>
test   %rax,%rax
je     1161 <ssl_key_genrsa+0x31>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <EVP_PKEY_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <EVP_PKEY_assign_RSA@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @ssl_key_genrsa(i32 %0) {
%2 = tail call i32* @RSA_generate_key(i32 %0, i32 3, i32* null, i32* null)
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32* (...) @EVP_PKEY_new()
%6 = tail call i32 @EVP_PKEY_assign_RSA(i32* %5, i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32* [ %5, %4 ], [ null, %1 ]
ret i32* %8
}
int pow2(int i) {
  int r = 1;
  while (i > 0)
    r *= 2;
  return r;
}


x86 assembly (clang, -O0):
<pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1126 <pow2+0x26>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <pow2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pow2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 2
store i32 %9, i32* %3
br label %4
10: ; preds = %4
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @pow2(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printplain(const char *text) { printf("decrpyted: %s\n", text); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"decrpyted: %s\0A\00"
define void @printplain(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"decrpyted: %s\0A\00"
define void @printplain(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double Dotp(a, b)
double a[3], b[3];
{ return (a[0] * b[0] + a[1] * b[1] + a[2] * b[2]); }


x86 assembly (clang, -O0):
<Dotp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dotp>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Dotp(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @Dotp(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
imm0reg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (22 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x16,%eax
cmp    -0xc(%rbp),%eax
jg     1132 <imm0reg1+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <imm0reg1+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0reg1>:
xor    %eax,%eax
cmp    $0x16,%esi
setge  %al
ret

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

LLVM IR (-O2):
define i32 @imm0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = icmp sgt i32 %1, 21
%8 = zext i1 %7 to i32
ret i32 %8
}
float mul(float c, float d) { return c * d; }


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mul(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @mul(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ ReadIOchip(int);
void ReadAllIO(void) {
  int chip_no;
  for (chip_no = 0; chip_no <= 7; chip_no++)
    ReadIOchip(chip_no);
}


x86 assembly (clang, -O0):
<ReadAllIO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jg     113f <ReadAllIO+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <ReadIOchip@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ReadAllIO+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadAllIO>:
push   %rax
xor    %edi,%edi
call   1030 <ReadIOchip@plt>
mov    $0x1,%edi
call   1030 <ReadIOchip@plt>
mov    $0x2,%edi
call   1030 <ReadIOchip@plt>
mov    $0x3,%edi
call   1030 <ReadIOchip@plt>
mov    $0x4,%edi
call   1030 <ReadIOchip@plt>
mov    $0x5,%edi
call   1030 <ReadIOchip@plt>
mov    $0x6,%edi
call   1030 <ReadIOchip@plt>
mov    $0x7,%edi
pop    %rax
jmp    1030 <ReadIOchip@plt>

LLVM IR (-O0):
define void @ReadAllIO() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 7
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @ReadIOchip(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @ReadAllIO() {
%1 = tail call i32 @ReadIOchip(i32 0)
%2 = tail call i32 @ReadIOchip(i32 1)
%3 = tail call i32 @ReadIOchip(i32 2)
%4 = tail call i32 @ReadIOchip(i32 3)
%5 = tail call i32 @ReadIOchip(i32 4)
%6 = tail call i32 @ReadIOchip(i32 5)
%7 = tail call i32 @ReadIOchip(i32 6)
%8 = tail call i32 @ReadIOchip(i32 7)
ret void
}
double bspline_curve(unsigned int n, unsigned int p, const double t[n + 1],
                     const double v[n - p], double x) {
  return cox_deboor(n, p, t, v, x);
}


x86 assembly (clang, -O0):
<bspline_curve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1030 <cox_deboor@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bspline_curve>:
push   %rax
mov    $0x1,%al
call   1030 <cox_deboor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bspline_curve(i32 %0, i32 %1, double* %2, double* %3, double %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store double %4, double* %10
%11 = load i32, i32* %6
%12 = add i32 %11, 1
%13 = zext i32 %12 to i64
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = sub i32 %14, %15
%17 = zext i32 %16 to i64
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = load double*, double** %8
%21 = load double*, double** %9
%22 = load double, double* %10
%23 = call i32 (i32, i32, double*, double*, double, ...) bitcast (i32 (...)* @cox_deboor to i32 (i32, i32, double*, double*, double, ...)*)(i32 %18, i32 %19, double* %20, double* %21, double %22)
%24 = sitofp i32 %23 to double
ret double %24
}

LLVM IR (-O2):
define double @bspline_curve(i32 %0, i32 %1, double* %2, double* %3, double %4) {
%6 = tail call i32 (i32, i32, double*, double*, double, ...) bitcast (i32 (...)* @cox_deboor to i32 (i32, i32, double*, double*, double, ...)*)(i32 %0, i32 %1, double* %2, double* %3, double %4)
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int sqrt(int);
int computeDistance(int xCoor1, int yCoor1, int xCoor2, int yCoor2) {
  int xSquare, ySquare;
  xSquare = (xCoor1 - xCoor2) * (xCoor1 - xCoor2);
  ySquare = (yCoor1 - yCoor2) * (yCoor1 - yCoor2);
  return sqrt(xSquare + ySquare);
}


x86 assembly (clang, -O0):
<computeDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
add    -0x18(%rbp),%edi
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeDistance>:
sub    %edx,%edi
imul   %edi,%edi
sub    %ecx,%esi
imul   %esi,%esi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @computeDistance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = sub nsw i32 %14, %15
%17 = mul nsw i32 %13, %16
store i32 %17, i32* %9
%18 = load i32, i32* %6
%19 = load i32, i32* %8
%20 = sub nsw i32 %18, %19
%21 = load i32, i32* %6
%22 = load i32, i32* %8
%23 = sub nsw i32 %21, %22
%24 = mul nsw i32 %20, %23
store i32 %24, i32* %10
%25 = load i32, i32* %9
%26 = load i32, i32* %10
%27 = add nsw i32 %25, %26
%28 = call i32 @sqrt(i32 %27)
ret i32 %28
}

LLVM IR (-O2):
define i32 @computeDistance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = mul nsw i32 %5, %5
%7 = sub nsw i32 %1, %3
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %6
%10 = tail call i32 @sqrt(i32 %9)
ret i32 %10
}
void out8(unsigned short port, int value) {
  __asm__ volatile("outb %0, %1" : : "a"((char)value), "d"(port));
}


x86 assembly (clang, -O0):
<out8>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<out8>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @out8(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @out8(i16 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
tail call void asm sideeffect "outb $0, $1", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %3, i16 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int catch (int sig) {
  perror("Closing with reason:");
  exit(1);
}


x86 assembly (clang, -O0):
<catch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<catch>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Closing with reason:\00"
define i32 @catch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"Closing with reason:\00"
define i32 @catch(i32 %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int cfb15_get_color(unsigned int color) {
  unsigned int r, g, b;
  r = (color >> 16) & 0xff;
  g = (color >> 8) & 0xff;
  b = (color)&0xff;
  return ((((r) >> 3) << 10) | (((g) >> 3) << 5) | ((b) >> 3));
}


x86 assembly (clang, -O0):
<cfb15_get_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x3,%eax
shl    $0xa,%eax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shr    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfb15_get_color>:
mov    %edi,%ecx
shr    $0x9,%ecx
and    $0x7c00,%ecx
mov    %edi,%eax
shr    $0x6,%eax
and    $0x3e0,%eax
or     %ecx,%eax
shr    $0x3,%edi
and    $0x1f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @cfb15_get_color(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = lshr i32 %6, 16
%8 = and i32 %7, 255
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = and i32 %12, 255
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = lshr i32 %14, 3
%16 = shl i32 %15, 10
%17 = load i32, i32* %4
%18 = lshr i32 %17, 3
%19 = shl i32 %18, 5
%20 = or i32 %16, %19
%21 = load i32, i32* %5
%22 = lshr i32 %21, 3
%23 = or i32 %20, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @cfb15_get_color(i32 %0) {
%2 = lshr i32 %0, 9
%3 = and i32 %2, 31744
%4 = lshr i32 %0, 6
%5 = and i32 %4, 992
%6 = or i32 %3, %5
%7 = lshr i32 %0, 3
%8 = and i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int trigamma(double);
double d2_alhood(double a, int D, int K) {
  return (D * (K * K * trigamma(K * a) - K * trigamma(a)));
}


x86 assembly (clang, -O0):
<d2_alhood>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <trigamma@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <trigamma@plt>
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    %eax,%esi
mov    -0x14(%rbp),%eax
imul   %esi,%edx
sub    %edx,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2_alhood>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %edi,%r14d
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
mov    %esi,%ebx
imul   %esi,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <trigamma@plt>
mov    %eax,%ebp
imul   %ebx,%ebp
movsd  (%rsp),%xmm0
call   1030 <trigamma@plt>
imul   %r15d,%eax
sub    %eax,%ebp
imul   %r14d,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @d2_alhood(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = call i32 @trigamma(double %14)
%16 = mul nsw i32 %10, %15
%17 = load i32, i32* %6
%18 = load double, double* %4
%19 = call i32 @trigamma(double %18)
%20 = mul nsw i32 %17, %19
%21 = sub nsw i32 %16, %20
%22 = mul nsw i32 %7, %21
%23 = sitofp i32 %22 to double
ret double %23
}

LLVM IR (-O2):
define double @d2_alhood(double %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %2
%5 = sitofp i32 %2 to double
%6 = fmul double %5, %0
%7 = tail call i32 @trigamma(double %6)
%8 = mul nsw i32 %4, %7
%9 = tail call i32 @trigamma(double %0)
%10 = mul nsw i32 %9, %2
%11 = sub nsw i32 %8, %10
%12 = mul nsw i32 %11, %1
%13 = sitofp i32 %12 to double
ret double %13
}
/* Variables and functions */
char *strncpy(char *, char const *, int);
char *safe_strncpy(char *dst, const char *src, int size) {
  dst[size - 1] = '\0';
  return strncpy(dst, src, size - 1);
}


x86 assembly (clang, -O0):
<safe_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strncpy>:
movslq %edx,%rdx
movb   $0x0,-0x1(%rdi,%rdx,1)
add    $0xffffffffffffffff,%rdx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define i8* @safe_strncpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = call i8* @strncpy(i8* %12, i8* %13, i32 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @safe_strncpy(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = tail call i8* @strncpy(i8* %0, i8* %1, i32 %4)
ret i8* %7
}
void main() {
  int x;
  do {
    if (x)
      do {
        do {
        } while (1);
      } while (0);
  } while (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,-0x4(%rbp)
je     1136 <main+0x36>
jmp    1113 <main+0x13>
jmp    1118 <main+0x18>
jmp    111d <main+0x1d>
mov    $0x1,%al
test   $0x1,%al
jne    1118 <main+0x18>
jmp    112c <main+0x2c>
jmp    1131 <main+0x31>
jmp    1136 <main+0x36>
jmp    113b <main+0x3b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
br label %6
6: ; preds = %5
br label %7
7: ; preds = %8, %6
br label %8
8: ; preds = %7
br i1 true, label %7, label %9
9: ; preds = %8
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10, %2
br label %12
12: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
unsigned int list_in(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *);
bool test_list_in_null_params(void) {
  bool pass = false;
  unsigned int res = list_in(NULL, NULL, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_in_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <list_in@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1142 <test_list_in_null_params+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_in_null_params>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <list_in@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_list_in_null_params() {
%1 = tail call i32 @list_in(i32* null, i32* null, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *replacer(const char *key, void *value, void *arg) {
  (void)key;
  free(value);
  return arg;
}


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

x86 assembly (clang, -O2):
<replacer>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @replacer(i8* nocapture readnone %0, i8* nocapture %1, i8* readnone returned %2) {
%4 = tail call i32 @free(i8* %1)
ret i8* %2
}
void ScaleRowDown4Box_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown4Box_Any_SSSE3() {
ret void
}
/* Variables and functions */
double M_PI;
double dtor(double d) { return d * (M_PI / 180.0); }


x86 assembly (clang, -O0):
<dtor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xedf(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtor>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
divsd  0xeed(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @dtor(double %0) {
%2 = load double, double* @M_PI
%3 = fdiv double %2, 1.800000e+02
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
struct PIN_LCD {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LCD_Command(int, struct PIN_LCD *);
void LCD_Home(struct PIN_LCD *PIN_LCD) { LCD_Command(0x02, PIN_LCD); }


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

x86 assembly (clang, -O2):
<LCD_Home>:
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <LCD_Command@plt>

LLVM IR (-O0):
%struct.PIN_LCD = type { i32 }
define void @LCD_Home(%struct.PIN_LCD* %0) {
%2 = alloca %struct.PIN_LCD*
store %struct.PIN_LCD* %0, %struct.PIN_LCD** %2
%3 = load %struct.PIN_LCD*, %struct.PIN_LCD** %2
%4 = call i32 @LCD_Command(i32 2, %struct.PIN_LCD* %3)
ret void
}

LLVM IR (-O2):
%struct.PIN_LCD = type { i32 }
define void @LCD_Home(%struct.PIN_LCD* %0) {
%2 = tail call i32 @LCD_Command(i32 2, %struct.PIN_LCD* %0)
ret void
}
double PADE_2_2(double x) {
  double x_2 = x * x;
  return 1. - x_2 / (3. + 9. / 5. * x_2);
}


x86 assembly (clang, -O0):
<PADE_2_2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xede(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xeda(%rip),%xmm2
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PADE_2_2>:
mulsd  %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeec(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @PADE_2_2(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %8, double 3.000000e+00)
%10 = fdiv double %7, %9
%11 = fsub double 1.000000e+00, %10
ret double %11
}

LLVM IR (-O2):
define double @PADE_2_2(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.000000e+00)
%4 = fdiv double %2, %3
%5 = fsub double 1.000000e+00, %4
ret double %5
}