xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage: mod2gbt modfile.mod song_name [-speed][-512-banks]\n\n");
  printf("       -speed      Don't convert speed from 50 Hz to 60 Hz.\n");
  printf(
      "       -512-banks  Output data for a ROM with more than 256 banks.\n");
  printf("\n\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xf47(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: mod2gbt modfile.mod song_name [-speed][-512-banks]\0A\0A\00"
@.str.1 = [61 x i8] c" -speed Don't convert speed from 50 Hz to 60 Hz.\0A\00"
@.str.2 = [68 x i8] c" -512-banks Output data for a ROM with more than 256 banks.\0A\00"
@.str.3 = [3 x i8] c"\0A\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [59 x i8] c"Usage: mod2gbt modfile.mod song_name [-speed][-512-banks]\0A\00"
@str.4 = [60 x i8] c" -speed Don't convert speed from 50 Hz to 60 Hz.\00"
@str.5 = [67 x i8] c" -512-banks Output data for a ROM with more than 256 banks.\00"
@str.6 = [2 x i8] c"\0A\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
ret void
}
void put_u16(void *addr, unsigned short val) {
  unsigned char *b = addr;
  b[0] = (val >> 8) & 0xFF;
  b[1] = (val & 0xFF);
}


x86 assembly (clang, -O0):
<put_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_u16>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @put_u16(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
ret void
}

LLVM IR (-O2):
define void @put_u16(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %0
%5 = trunc i16 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int __BITS_PER_LONG;
void clear_bit(int nr, unsigned long *addr) {
  addr[nr / __BITS_PER_LONG] &= ~(1UL << (nr % __BITS_PER_LONG));
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed3(%rip),%rcx
cltd
idivl  (%rcx)
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eaa(%rip),%rcx
cltd
idivl  (%rcx)
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
and    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
cltd
idivl  (%rcx)
mov    %edx,%ecx
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
cltq
and    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
@__BITS_PER_LONG = global i32 0
define void @clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @__BITS_PER_LONG
%7 = srem i32 %5, %6
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
%10 = xor i64 %9, -1
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = load i32, i32* @__BITS_PER_LONG
%14 = sdiv i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %11, i64 %15
%17 = load i64, i64* %16
%18 = and i64 %17, %10
store i64 %18, i64* %16
ret void
}

LLVM IR (-O2):
@__BITS_PER_LONG = global i32 0
define void @clear_bit(i32 %0, i64* nocapture %1) {
%3 = load i32, i32* @__BITS_PER_LONG
%4 = srem i32 %0, %3
%5 = zext i32 %4 to i64
%6 = shl nuw i64 1, %5
%7 = xor i64 %6, -1
%8 = sdiv i32 %0, %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %1, i64 %9
%11 = load i64, i64* %10
%12 = and i64 %11, %7
store i64 %12, i64* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void _exitEmu(void) { exit(0); }


x86 assembly (clang, -O0):
<_exitEmu>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<_exitEmu>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @_exitEmu() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @_exitEmu() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
int IsPowerOf2(int x) { return (x & (x - 1)) == 0; }


x86 assembly (clang, -O0):
<IsPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsPowerOf2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @IsPowerOf2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int enabled_uint(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @enabled_uint() {
ret i32 1
}

LLVM IR (-O2):
define i32 @enabled_uint() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ reset_term();
handler() {
  clear_screen();
  reset_term();
  exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clear_screen@plt>
mov    $0x0,%al
call   1040 <reset_term@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
xor    %eax,%eax
call   1030 <clear_screen@plt>
xor    %eax,%eax
call   1040 <reset_term@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @handler() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 (...) @reset_term()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @handler() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 (...) @reset_term()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM1_CC_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @TIM1_CC_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
void asm_sfence(void) { __asm__ __volatile__("sfence"); }


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

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

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

LLVM IR (-O2):
define void @asm_sfence() {
tail call void asm sideeffect "sfence", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x9e() {
  Assert_real((islower(158) == 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_islower.c",
              795, ("islower should be 0 for 0x9e"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x9e>:
push   %rax
mov    $0x9e,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x31b,%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 = [29 x i8] c"islower should be 0 for 0x9e\00"
define void @t_islower_0x9e() {
%1 = call i64 @islower(i32 158)
%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 795, i8* getelementptr inbounds ([29 x i8], [29 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 = [29 x i8] c"islower should be 0 for 0x9e\00"
define void @t_islower_0x9e() {
%1 = tail call i64 @islower(i32 158)
%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 795, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void chop_newline(char *s) {
  char *p;
  p = strchr(s, '\0') - 1;
  while (*p == '\n')
    *p-- = '\0';
}


x86 assembly (clang, -O0):
<chop_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1156 <chop_newline+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    112f <chop_newline+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmpb   $0xa,-0x1(%rbx,%rax,1)
jne    113d <chop_newline+0x2d>
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movb   $0x0,(%rax)
cmpb   $0xa,-0x1(%rax)
lea    -0x1(%rax),%rax
je     1130 <chop_newline+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chop_newline(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr i8, i8* %0, i64 %2
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = phi i8* [ %9, %7 ], [ %4, %1 ]
store i8 0, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 10
br i1 %11, label %7, label %12
12: ; preds = %7, %1
ret void
}
/* Variables and functions */
int b(int);
int c(int);
int a(int x) { return a(x) + b(x) + c(x); }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <a@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <b@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <c@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1050 <a@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <b@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %ebx,%edi
call   1040 <c@plt>
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @a(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @b(i32 %5)
%7 = add nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @c(i32 %8)
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = tail call i32 @a(i32 %0)
%3 = tail call i32 @b(i32 %0)
%4 = add nsw i32 %3, %2
%5 = tail call i32 @c(i32 %0)
%6 = add nsw i32 %4, %5
ret i32 %6
}
void posix_class2P_PRINT() {}


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

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

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

LLVM IR (-O2):
define void @posix_class2P_PRINT() {
ret void
}
unsigned char *hmac512digest(bitstr, bitcnt, key, keylen)
unsigned char *bitstr;
unsigned long bitcnt;
unsigned char *key;
unsigned int keylen;
{ return ((unsigned char *)hmaccomp(512, 1, bitstr, bitcnt, key, keylen)); }


x86 assembly (clang, -O0):
<hmac512digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0x200,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <hmaccomp@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac512digest>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x200,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <hmaccomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hmac512digest(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 512, i32 1, i8* %9, i64 %10, i8* %11, i32 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @hmac512digest(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 512, i32 1, i8* %0, i64 %1, i8* %2, i32 %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
float cos(float);
float sin(float);
void polares_cartesianas(float r, float theta, float *x, float *y) {
  *x = r * cos(theta);
  *y = r * sin(theta);
}


x86 assembly (clang, -O0):
<polares_cartesianas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polares_cartesianas>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
movaps %xmm1,%xmm0
call   1040 <cos@plt>
mulss  (%rsp),%xmm0
movss  %xmm0,(%rbx)
movss  0x4(%rsp),%xmm0
call   1030 <sin@plt>
mulss  (%rsp),%xmm0
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @polares_cartesianas(float %0, float %1, float* %2, float* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float*
%8 = alloca float*
store float %0, float* %5
store float %1, float* %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = call float @cos(float %10)
%12 = fmul float %9, %11
%13 = load float*, float** %7
store float %12, float* %13
%14 = load float, float* %5
%15 = load float, float* %6
%16 = call float @sin(float %15)
%17 = fmul float %14, %16
%18 = load float*, float** %8
store float %17, float* %18
ret void
}

LLVM IR (-O2):
define void @polares_cartesianas(float %0, float %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = tail call float @cos(float %1)
%6 = fmul float %5, %0
store float %6, float* %2
%7 = tail call float @sin(float %1)
%8 = fmul float %7, %0
store float %8, float* %3
ret void
}
/* Type definitions */
struct action {
  int dummy;
};

/* Variables and functions */
int getloglevel();
int getLoglevel(struct action *params) { return getloglevel(); }


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

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

LLVM IR (-O0):
%struct.action = type { i32 }
define i32 @getLoglevel(%struct.action* %0) {
%2 = alloca %struct.action*
store %struct.action* %0, %struct.action** %2
%3 = call i32 (...) @getloglevel()
ret i32 %3
}

LLVM IR (-O2):
%struct.action = type { i32 }
define i32 @getLoglevel(%struct.action* nocapture readnone %0) {
%2 = tail call i32 (...) @getloglevel()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ addll(long long, long long);
int /*<<< orphan*/ printf(char *, long long, long long, int /*<<< orphan*/);
test(long long i, long long j) {
  printf("%lld + %lld = %lld\n", i, j, addll(i, j));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <addll@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <addll@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%lld + %lld = %lld\0A\00"
define i32 @test(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = call i32 @addll(i64 %8, i64 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %7, i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [20 x i8] c"%lld + %lld = %lld\0A\00"
define i32 @test(i64 %0, i64 %1) {
%3 = tail call i32 @addll(i64 %0, i64 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i32 %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ screen_monitor_put_char(char);
void screen_monitor_string_write(char *c) {
  int i;
  i = 0;
  while (c[i]) {
    screen_monitor_put_char(c[i++]);
  }
}


x86 assembly (clang, -O0):
<screen_monitor_string_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <screen_monitor_string_write+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <screen_monitor_put_char@plt>
jmp    1123 <screen_monitor_string_write+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_monitor_string_write>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <screen_monitor_string_write+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <screen_monitor_put_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <screen_monitor_string_write+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @screen_monitor_string_write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @screen_monitor_put_char(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
unsigned Aig_InfoMask(int nVar) { return (~(unsigned)0) >> (32 - nVar); }


x86 assembly (clang, -O0):
<Aig_InfoMask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x20,%ecx
sub    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Aig_InfoMask>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @Aig_InfoMask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 32, %3
%5 = lshr i32 -1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @Aig_InfoMask(i32 %0) {
%2 = sub nsw i32 32, %0
%3 = lshr i32 -1, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ from_fini();
__attribute__((destructor)) void func_fini(void) { from_fini(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @func_fini, i8* null }]
define void @func_fini() {
%1 = call i32 (...) @from_fini()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @func_fini, i8* null }]
define void @func_fini() {
%1 = tail call i32 (...) @from_fini()
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t time_diff_usec(struct timeval start, struct timeval end) {
  return ((end.tv_sec - start.tv_sec) * 1000000 +
          (end.tv_usec - start.tv_usec));
}


x86 assembly (clang, -O0):
<time_diff_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %edx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0xf4240,%eax,%eax
cltq
mov    -0x18(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff_usec>:
sub    %edi,%edx
imul   $0xf4240,%edx,%eax
cltq
sub    %rsi,%rcx
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @time_diff_usec(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %5 to { i32, i64 }*
%8 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 0
store i32 %0, i32* %8
%9 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timeval* %6 to { i32, i64 }*
%11 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 0
store i32 %2, i32* %11
%12 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%16 = load i32, i32* %15
%17 = sub nsw i32 %14, %16
%18 = mul nsw i32 %17, 1000000
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%21 = load i64, i64* %20
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%23 = load i64, i64* %22
%24 = sub nsw i64 %21, %23
%25 = add nsw i64 %19, %24
ret i64 %25
}

LLVM IR (-O2):
define i64 @time_diff_usec(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = sub nsw i32 %2, %0
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = sub i64 %3, %1
%9 = add nsw i64 %8, %7
ret i64 %9
}
/* Type definitions */
typedef void *uint8_t;
typedef int uint16_t;

/* Variables and functions */
void store16(void *dst, uint16_t w) {
  uint8_t *p = (uint8_t *)dst;
  *p++ = (uint8_t)w;
  w >>= 8;
  *p++ = (uint8_t)w;
}


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

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

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

LLVM IR (-O2):
define void @store16(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i8**
%4 = sext i32 %1 to i64
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i8**
store i8* %5, i8** %3
%8 = ashr i32 %1, 8
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %7
ret void
}
void warn(char *s) {}


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

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

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

LLVM IR (-O2):
define void @warn(i8* nocapture %0) {
ret void
}
double link_function_deriv_relation(double link_function_val) {
  return (link_function_val + (8 * 8)) * ((8 * 8) - link_function_val) /
         (2 * (8 * 8));
}


x86 assembly (clang, -O0):
<link_function_deriv_relation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<link_function_deriv_relation>:
movsd  0xef8(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
mulsd  0xee8(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @link_function_deriv_relation(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 6.400000e+01
%5 = load double, double* %2
%6 = fsub double 6.400000e+01, %5
%7 = fmul double %4, %6
%8 = fdiv double %7, 1.280000e+02
ret double %8
}

LLVM IR (-O2):
define double @link_function_deriv_relation(double %0) {
%2 = fadd double %0, 6.400000e+01
%3 = fsub double 6.400000e+01, %0
%4 = fmul double %2, %3
%5 = fmul double %4, 7.812500e-03
ret double %5
}
int mini(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<mini>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <mini+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <mini+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mini>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @mini(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
bool ispalindrome(int number) {
  int i = number;
  int result = 0;
  do {
    result = result * 10 + (i % 10);
  } while (i /= 10);
  return result == number;
}


x86 assembly (clang, -O0):
<ispalindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    1114 <ispalindrome+0x14>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispalindrome>:
xor    %edx,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rdx,%rdx,4),%r8d
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edx
sub    %esi,%edx
lea    (%rdx,%r8,2),%edx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <ispalindrome+0x10>
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @ispalindrome(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %12, %1
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 10
%9 = load i32, i32* %3
%10 = srem i32 %9, 10
%11 = add nsw i32 %8, %10
store i32 %11, i32* %4
br label %12
12: ; preds = %6
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 10
store i32 %14, i32* %3
%15 = icmp ne i32 %14, 0
br i1 %15, label %6, label %16
16: ; preds = %12
%17 = load i32, i32* %4
%18 = load i32, i32* %2
%19 = icmp eq i32 %17, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @ispalindrome(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %8, %2 ]
%4 = phi i32 [ 0, %1 ], [ %7, %2 ]
%5 = mul nsw i32 %4, 10
%6 = srem i32 %3, 10
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %3, 10
%9 = add i32 %3, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %2
11: ; preds = %2
%12 = icmp eq i32 %7, %0
%13 = zext i1 %12 to i32
ret i32 %13
}
int rie_max(int a, int b) {
  if (a < b) {
    return b;
  }
  return a;
}


x86 assembly (clang, -O0):
<rie_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <rie_max+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <rie_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rie_max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @rie_max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int twenty_one();
int main(void) {
  int i = 0;
  i = twenty_one() + twenty_one();
  return i;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <twenty_one@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <twenty_one@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @twenty_one()
%2 = tail call i32 (...) @twenty_one()
%3 = add nsw i32 %2, %1
ret i32 %3
}
void subroutine(int in) {
  int count = in;
  while (count < 100)
    count++;
}


x86 assembly (clang, -O0):
<subroutine>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1125 <subroutine+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110d <subroutine+0xd>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @subroutine(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x2f() {
  Assert_real((iscntrl(47) == 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_iscntrl.c",
              240, ("iscntrl should be 0 for /"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x2f>:
push   %rax
mov    $0x2f,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf0,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for /\00"
define void @t_iscntrl_0x2f() {
%1 = call i64 @iscntrl(i32 47)
%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 240, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for /\00"
define void @t_iscntrl_0x2f() {
%1 = tail call i64 @iscntrl(i32 47)
%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 240, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int ioctl(int, int, int);
int open(char *, int /*<<< orphan*/);
extern int rpi_dev_smbus_open(char *filename, int address) {
  int fd;
  int ir;
  fd = open(filename, O_RDWR);
  if (fd >= 0) {
    if ((ir = ioctl(fd, 0x0703, address)) < 0) {
      fd = ir;
    }
  }
  return fd;
}


x86 assembly (clang, -O0):
<rpi_dev_smbus_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1175 <rpi_dev_smbus_open+0x55>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x703,%esi
call   1030 <ioctl@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1170 <rpi_dev_smbus_open+0x50>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1175 <rpi_dev_smbus_open+0x55>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpi_dev_smbus_open>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     114c <rpi_dev_smbus_open+0x2c>
mov    %ebx,%edi
mov    $0x703,%esi
mov    %ebp,%edx
call   1030 <ioctl@plt>
test   %eax,%eax
cmovs  %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @rpi_dev_smbus_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* @O_RDWR
%9 = call i32 @open(i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @ioctl(i32 %13, i32 1795, i32 %14)
store i32 %15, i32* %6
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i32, i32* %6
store i32 %18, i32* %5
br label %19
19: ; preds = %17, %12
br label %20
20: ; preds = %19, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @rpi_dev_smbus_open(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* %0, i32 %3)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @ioctl(i32 %4, i32 1795, i32 %1)
%8 = icmp slt i32 %7, 0
%9 = select i1 %8, i32 %7, i32 %4
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ %4, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadWord(int /*<<< orphan*/, int);
uint16_t wiznetGetSocketTXReadPointer(uint8_t socket) {
  return wiznetRegReadWord(socket, (0x0000 + 0x0022));
}


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

x86 assembly (clang, -O2):
<wiznetGetSocketTXReadPointer>:
mov    $0x22,%esi
jmp    1030 <wiznetRegReadWord@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetSocketTXReadPointer(i32 %0) {
%2 = tail call i32 @wiznetRegReadWord(i32 %0, i32 34)
ret i32 %2
}
long long r7(void *x) { return *(long long *)(x + 32761); }


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

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

LLVM IR (-O0):
define i64 @r7(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32761
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r7(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32761
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int main() {
  int *p = (int *)malloc(8);
  free(p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @free(i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
scalar_t__ __glibc_unlikely(int);
size_t confstr(int, char *, size_t);
size_t __confstr_chk(int name, char *buf, size_t len, size_t buflen) {
  if (__glibc_unlikely(buflen < len))
    __chk_fail();
  return confstr(name, buf, len);
}


x86 assembly (clang, -O0):
<__confstr_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__glibc_unlikely@plt>
cmp    $0x0,%rax
je     116d <__confstr_chk+0x3d>
mov    $0x0,%al
call   1030 <__chk_fail@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <confstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__confstr_chk>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
cmp    %rdx,%rcx
setb   %dil
call   1040 <__glibc_unlikely@plt>
test   %rax,%rax
je     1156 <__confstr_chk+0x26>
xor    %eax,%eax
call   1030 <__chk_fail@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <confstr@plt>

LLVM IR (-O0):
define i64 @__confstr_chk(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %7
%11 = icmp ult i64 %9, %10
%12 = zext i1 %11 to i32
%13 = call i64 @__glibc_unlikely(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %4
%16 = call i32 (...) @__chk_fail()
br label %17
17: ; preds = %15, %4
%18 = load i32, i32* %5
%19 = load i8*, i8** %6
%20 = load i64, i64* %7
%21 = call i64 @confstr(i32 %18, i8* %19, i64 %20)
ret i64 %21
}

LLVM IR (-O2):
define i64 @__confstr_chk(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = icmp ult i64 %3, %2
%6 = zext i1 %5 to i32
%7 = tail call i64 @__glibc_unlikely(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 (...) @__chk_fail()
br label %11
11: ; preds = %9, %4
%12 = tail call i64 @confstr(i32 %0, i8* %1, i64 %2)
ret i64 %12
}
/* Variables and functions */
double __nv_trunc(double);
double trunc(double __a) { return __nv_trunc(__a); }


x86 assembly (clang, -O0):
<trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__nv_trunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunc>:
jmp    1030 <__nv_trunc@plt>

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

LLVM IR (-O2):
define double @trunc(double %0) {
%2 = tail call double @__nv_trunc(double %0)
ret double %2
}