xunge/DecIR huggingface dataset:
void read_str(fd, str, maxstr) int fd;
char *str;
int maxstr;
{
  while (maxstr-- > 0) {
    if (read(fd, str, 1) != 1)
      break;
    if (*str == '\0')
      break;
    str++;
  }
}


x86 assembly (clang, -O0):
<read_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    117d <read_str+0x6d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <read@plt>
cmp    $0x1,%eax
je     1157 <read_str+0x47>
jmp    117d <read_str+0x6d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116c <read_str+0x5c>
jmp    117d <read_str+0x6d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1122 <read_str+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_str>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    114c <read_str+0x3c>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <read@plt>
cmp    $0x1,%eax
jne    114c <read_str+0x3c>
cmpb   $0x0,(%rbx)
je     114c <read_str+0x3c>
lea    -0x1(%r14),%eax
add    $0x1,%rbx
cmp    $0x1,%r14d
mov    %eax,%r14d
jg     1120 <read_str+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @read_str(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %23, %3
%8 = load i32, i32* %6
%9 = add nsw i32 %8, -1
store i32 %9, i32* %6
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = load i32, i32* %4
%13 = load i8*, i8** %5
%14 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %12, i8* %13, i32 1)
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %11
br label %26
17: ; preds = %11
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %17
br label %26
23: ; preds = %17
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %7
26: ; preds = %22, %16, %7
ret void
}

LLVM IR (-O2):
define void @read_str(i32 %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3, %10
%6 = phi i32 [ %13, %10 ], [ %2, %3 ]
%7 = phi i8* [ %14, %10 ], [ %1, %3 ]
%8 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %7, i32 1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i8, i8* %7
%12 = icmp ne i8 %11, 0
%13 = add nsw i32 %6, -1
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = icmp sgt i32 %6, 1
%16 = select i1 %12, i1 %15, i1 false
br i1 %16, label %5, label %17
17: ; preds = %5, %10, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void shl_reg32_cl(unsigned int reg32) {
  put8(0xD3);
  put8(0xE0 + reg32);
}


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

x86 assembly (clang, -O2):
<shl_reg32_cl>:
push   %rbx
mov    %edi,%ebx
mov    $0xd3,%edi
call   1030 <put8@plt>
add    $0xe0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @shl_reg32_cl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 211)
%4 = load i32, i32* %2
%5 = add i32 224, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @shl_reg32_cl(i32 %0) {
%2 = tail call i32 @put8(i32 211)
%3 = add i32 %0, 224
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __disable_irq();
void port_lock(void) { __disable_irq(); }


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

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

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

LLVM IR (-O2):
define void @port_lock() {
%1 = tail call i32 (...) @__disable_irq()
ret void
}
double gamma(double raw) { return raw; }


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

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

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

LLVM IR (-O2):
define double @gamma(double returned %0) {
ret double %0
}
unsigned int get_bit(int reg, int pos) {
  unsigned int mask, output;
  mask = 1;
  output = (reg >> pos) & mask;
  return output;
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_bit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int LongSwap(int);
int /*<<< orphan*/ memcpy(int *, void *, int);
int loadWord(void *addr) {
  int word;
  memcpy(&word, addr, 4);
  return LongSwap(word);
}


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

x86 assembly (clang, -O2):
<loadWord>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <LongSwap@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @loadWord(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @LongSwap(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @loadWord(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @LongSwap(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Proc();
int main() {
  Proc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Proc()
ret i32 0
}
abs(arg) int arg;
{ return (arg < 0 ? -arg : arg); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int O_NDELAY;
int O_RDWR;
int open(char *, int);
int tcc_overlaymix_init(void) {
  int olymix_fd;
  olymix_fd = open("/dev/graphic", O_RDWR | O_NDELAY);
  if (olymix_fd <= 0) {
    return -1;
  } else
    return olymix_fd;
}


x86 assembly (clang, -O0):
<tcc_overlaymix_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     114f <tcc_overlaymix_init+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <tcc_overlaymix_init+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcc_overlaymix_init>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xed6(%rip),%rdi
call   1030 <open@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovle %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/graphic\00"
@O_RDWR = global i32 0
@O_NDELAY = global i32 0
define i32 @tcc_overlaymix_init() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_NDELAY
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 -1, i32* %1
br label %12
10: ; preds = %0
%11 = load i32, i32* %2
store i32 %11, i32* %1
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/graphic\00"
@O_RDWR = global i32 0
@O_NDELAY = global i32 0
define i32 @tcc_overlaymix_init() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NDELAY
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i32 %4, 1
%6 = select i1 %5, i32 -1, i32 %4
ret i32 %6
}
void timerISR(void) {
  if ((*(volatile unsigned int *)(0x7F008824)) & 0xF) {
    (*(volatile unsigned int *)(0x7F008824)) &= 0xFFFFFFF0;
  } else {
    (*(volatile unsigned int *)(0x7F008824)) |= 0x0000000F;
  }
  (*(volatile unsigned int *)(0x7F006044)) |= (1 << 5);
  (*(volatile unsigned int *)(0x71200F00)) = 0;
  return;
}


x86 assembly (clang, -O0):
<timerISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008824,%eax
mov    (%rax),%eax
and    $0xf,%eax
cmp    $0x0,%eax
je     112d <timerISR+0x2d>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    113e <timerISR+0x3e>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0xf,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
mov    $0x7f006044,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0x7f006044,%eax
mov    %ecx,(%rax)
mov    $0x71200f00,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerISR>:
xor    %eax,%eax
testl  $0xf,0x7f008824
mov    $0xf,%ecx
cmovne %eax,%ecx
mov    0x7f008824,%eax
and    $0xfffffff0,%eax
or     %ecx,%eax
mov    %eax,0x7f008824
orl    $0x20,0x7f006044
20
movl   $0x0,0x71200f00
ret

LLVM IR (-O0):
define void @timerISR() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = and i32 %1, 15
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%6 = and i32 %5, -16
store volatile i32 %6, i32* inttoptr (i64 2130741284 to i32*)
br label %10
7: ; preds = %0
%8 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%9 = or i32 %8, 15
store volatile i32 %9, i32* inttoptr (i64 2130741284 to i32*)
br label %10
10: ; preds = %7, %4
%11 = load volatile i32, i32* inttoptr (i64 2130731076 to i32*)
%12 = or i32 %11, 32
store volatile i32 %12, i32* inttoptr (i64 2130731076 to i32*)
store volatile i32 0, i32* inttoptr (i64 1897926400 to i32*)
ret void
}

LLVM IR (-O2):
define void @timerISR() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = and i32 %1, 15
%3 = icmp eq i32 %2, 0
%4 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%5 = and i32 %4, -16
%6 = select i1 %3, i32 15, i32 0
%7 = or i32 %5, %6
store volatile i32 %7, i32* inttoptr (i64 2130741284 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 2130731076 to i32*)
%9 = or i32 %8, 32
store volatile i32 %9, i32* inttoptr (i64 2130731076 to i32*)
store volatile i32 0, i32* inttoptr (i64 1897926400 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asin(int /*<<< orphan*/);
int /*<<< orphan*/ wPopNumber();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasASin() { wPushNumber(asin(wPopNumber())); }


x86 assembly (clang, -O0):
<wBasASin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wPopNumber@plt>
mov    %eax,%edi
call   1050 <asin@plt>
mov    %eax,%edi
call   1030 <wPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasASin>:
push   %rax
xor    %eax,%eax
call   1040 <wPopNumber@plt>
mov    %eax,%edi
call   1050 <asin@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
define void @wBasASin() {
%1 = call i32 (...) @wPopNumber()
%2 = call i32 @asin(i32 %1)
%3 = call i32 @wPushNumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @wBasASin() {
%1 = tail call i32 (...) @wPopNumber()
%2 = tail call i32 @asin(i32 %1)
%3 = tail call i32 @wPushNumber(i32 %2)
ret void
}
void replay_check_pattern_end() {}


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

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

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

LLVM IR (-O2):
define void @replay_check_pattern_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x85() {
  Assert_real((isxdigit(133) == 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_isxdigit.c",
              670, ("isxdigit should be 0 for 0x85"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x85>:
push   %rax
mov    $0x85,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x29e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x85\00"
define void @t_isxdigit_0x85() {
%1 = call i64 @isxdigit(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x85\00"
define void @t_isxdigit_0x85() {
%1 = tail call i64 @isxdigit(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void Default_SPU_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_SPU_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_SPU_IRQHandler+0x9>
jmp    1109 <Default_SPU_IRQHandler+0x9>

x86 assembly (clang, -O2):
<Default_SPU_IRQHandler>:
jmp    1100 <Default_SPU_IRQHandler>

LLVM IR (-O0):
define void @Default_SPU_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_SPU_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ ltrace_init(int, char **);
int /*<<< orphan*/ ltrace_main();
int main(int argc, char *argv[]) {
  ltrace_init(argc, argv);
  ltrace_main();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @ltrace_init(i32 %6, i8** %7)
%9 = call i32 (...) @ltrace_main()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ltrace_init(i32 %0, i8** %1)
%4 = tail call i32 (...) @ltrace_main()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned short BGR24to16(uint32_t BGR) {
  return (unsigned short)(((BGR >> 3) & 0x1f) | ((BGR & 0xf80000) >> 9) |
                          ((BGR & 0xf800) >> 6));
}


x86 assembly (clang, -O0):
<BGR24to16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
mov    -0x4(%rbp),%ecx
and    $0xf80000,%ecx
sar    $0x9,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xf800,%ecx
sar    $0x6,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @BGR24to16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 3
%5 = and i32 %4, 31
%6 = load i32, i32* %2
%7 = and i32 %6, 16252928
%8 = ashr i32 %7, 9
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 63488
%12 = ashr i32 %11, 6
%13 = or i32 %9, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @BGR24to16(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 31
%4 = lshr i32 %0, 9
%5 = and i32 %4, 31744
%6 = or i32 %3, %5
%7 = lshr i32 %0, 6
%8 = and i32 %7, 992
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ rs274ngc_file_name(char *, int);
const char *rs274ngc_file() {
  static char buf[100];
  rs274ngc_file_name(buf, 100);
  return buf;
}


x86 assembly (clang, -O0):
<rs274ngc_file>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x64,%esi
call   1030 <rs274ngc_file_name@plt>
lea    0x2f14(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs274ngc_file>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <rs274ngc_file_name@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@rs274ngc_file.buf = internal global [100 x i8] zeroinitializer
define i8* @rs274ngc_file() {
%1 = call i32 @rs274ngc_file_name(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @rs274ngc_file.buf, i64 0, i64 0), i32 100)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @rs274ngc_file.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@rs274ngc_file.buf = internal global [100 x i8] zeroinitializer
define i8* @rs274ngc_file() {
%1 = tail call i32 @rs274ngc_file_name(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @rs274ngc_file.buf, i64 0, i64 0), i32 100)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @rs274ngc_file.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
main() {
  int p, q;
  printf("Enter values of p and q");
  scanf("%d %d", &p, &q);
  printf("p=%d q=%d", p, q);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter values of p and q\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [10 x i8] c"p=%d q=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter values of p and q\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [10 x i8] c"p=%d q=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
float fma(float, float, float);
float fmaf(float x, float y, float z) { return fma(x, y, z); }


x86 assembly (clang, -O0):
<fmaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fma@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaf>:
jmp    1030 <fma@plt>

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

LLVM IR (-O2):
define float @fmaf(float %0, float %1, float %2) {
%4 = tail call float @fma(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ dinky(int);
int /*<<< orphan*/ oh_no();
void binky(int i) {
  if (i == 0) {
    oh_no();
  } else {
    dinky(i);
  }
}


x86 assembly (clang, -O0):
<binky>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1141 <binky+0x21>
mov    $0x0,%al
call   1030 <oh_no@plt>
jmp    1149 <binky+0x29>
mov    -0x4(%rbp),%edi
call   1040 <dinky@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binky>:
test   %edi,%edi
je     1129 <binky+0x9>
jmp    1040 <dinky@plt>
xor    %eax,%eax
jmp    1030 <oh_no@plt>

LLVM IR (-O0):
define void @binky(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @oh_no()
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @dinky(i32 %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @binky(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @oh_no()
br label %7
5: ; preds = %1
%6 = tail call i32 @dinky(i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
int xy_to_i(int x, int y) { return (x + (y * 4)); }


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

x86 assembly (clang, -O2):
<xy_to_i>:
lea    (%rdi,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @xy_to_i(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 = mul nsw i32 %6, 4
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @xy_to_i(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = add nsw i32 %3, %0
ret i32 %4
}
char *string_copy(char *s) { return s; }


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

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

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

LLVM IR (-O2):
define i8* @string_copy(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  x = __VERIFIER_nondet_int();
  while (x >= 0) {
    x = x + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1141 <main+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@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 i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
double form_volume(double length_a, double b2a_ratio, double c2a_ratio) {
  return length_a * (length_a * b2a_ratio) * (length_a * c2a_ratio);
}


x86 assembly (clang, -O0):
<form_volume>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_volume>:
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @form_volume(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fmul double %8, %9
%11 = fmul double %7, %10
%12 = load double, double* %4
%13 = load double, double* %6
%14 = fmul double %12, %13
%15 = fmul double %11, %14
ret double %15
}

LLVM IR (-O2):
define double @form_volume(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fmul double %4, %0
%6 = fmul double %0, %2
%7 = fmul double %5, %6
ret double %7
}
signed char fb_(signed char *const b) { return (*b); }


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

x86 assembly (clang, -O2):
<fb_>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @fb_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @fb_(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
int next_lcg(void) {
  static int t = 0;
  t = (615949L * t + 797807) % (1 << 20);
  return t - (1 << 19);
}


x86 assembly (clang, -O0):
<next_lcg>:
push   %rbp
mov    %rsp,%rbp
movslq 0x2f19(%rip),%rax
imul   $0x9660d,%rax,%rax
add    $0xc2c6f,%rax
mov    $0x100000,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,0x2efa(%rip)
mov    0x2ef4(%rip),%eax
sub    $0x80000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_lcg>:
imul   $0x9660d,0x2f1a(%rip),%eax
add    $0xc2c6f,%eax
and    $0xfffff,%eax
mov    %eax,0x2f0a(%rip)
add    $0xfff80000,%eax
ret

LLVM IR (-O0):
@next_lcg.t = internal global i32 0
define i32 @next_lcg() {
%1 = load i32, i32* @next_lcg.t
%2 = sext i32 %1 to i64
%3 = mul nsw i64 615949, %2
%4 = add nsw i64 %3, 797807
%5 = srem i64 %4, 1048576
%6 = trunc i64 %5 to i32
store i32 %6, i32* @next_lcg.t
%7 = load i32, i32* @next_lcg.t
%8 = sub nsw i32 %7, 524288
ret i32 %8
}

LLVM IR (-O2):
@next_lcg.t = internal unnamed_addr global i32 0
define i32 @next_lcg() {
%1 = load i32, i32* @next_lcg.t
%2 = mul i32 %1, 615949
%3 = add i32 %2, 797807
%4 = and i32 %3, 1048575
store i32 %4, i32* @next_lcg.t
%5 = add nsw i32 %4, -524288
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rtp3640_set_aac_hbr_au_size(uint8_t *header, uint16_t size) {
  header[0] = (size >> 5) & 0xff;
  header[1] &= ~0xf8;
  header[1] |= (size << 3) & 0xf8;
}


x86 assembly (clang, -O0):
<rtp3640_set_aac_hbr_au_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
and    $0xffffff07,%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
and    $0xf8,%ecx
mov    -0x8(%rbp),%rax
or     0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp3640_set_aac_hbr_au_size>:
mov    %esi,%eax
shr    $0x5,%eax
movzbl %al,%eax
mov    %eax,(%rdi)
mov    $0xffffff07,%eax
and    0x4(%rdi),%eax
and    $0x1f,%esi
lea    (%rax,%rsi,8),%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @rtp3640_set_aac_hbr_au_size(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 5
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = and i32 %12, -249
store i32 %13, i32* %11
%14 = load i32, i32* %4
%15 = shl i32 %14, 3
%16 = and i32 %15, 248
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = or i32 %19, %16
store i32 %20, i32* %18
ret void
}

LLVM IR (-O2):
define void @rtp3640_set_aac_hbr_au_size(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 5
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = and i32 %6, -249
%8 = shl i32 %1, 3
%9 = and i32 %8, 248
%10 = or i32 %7, %9
store i32 %10, i32* %5
ret void
}
void FragTrak_Save(void) {}


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

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

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

LLVM IR (-O2):
define void @FragTrak_Save() {
ret void
}
int h(int x) {
  static int j = 0;
  j += x;
  return j;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    0x2f14(%rip),%eax
mov    %eax,0x2f0e(%rip)
mov    0x2f08(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mov    %edi,%eax
add    0x2f1c(%rip),%eax
mov    %eax,0x2f16(%rip)
ret

LLVM IR (-O0):
@h.j = internal global i32 0
define i32 @h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @h.j
%5 = add nsw i32 %4, %3
store i32 %5, i32* @h.j
%6 = load i32, i32* @h.j
ret i32 %6
}

LLVM IR (-O2):
@h.j = internal unnamed_addr global i32 0
define i32 @h(i32 %0) {
%2 = load i32, i32* @h.j
%3 = add nsw i32 %2, %0
store i32 %3, i32* @h.j
ret i32 %3
}
getldate(uid) {
  static int logout_date[2];
  return (logout_date);
}


x86 assembly (clang, -O0):
<getldate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0x2f16(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@getldate.logout_date = internal global [2 x i32] zeroinitializer
define i32 @getldate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 ptrtoint ([2 x i32]* @getldate.logout_date to i32)
}

LLVM IR (-O2):
@getldate.logout_date = internal global [2 x i32] zeroinitializer
define i32 @getldate(i32 %0) {
ret i32 ptrtoint ([2 x i32]* @getldate.logout_date to i32)
}
void nmiISR(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<nmiISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <nmiISR+0x9>
jmp    1109 <nmiISR+0x9>

x86 assembly (clang, -O2):
<nmiISR>:
jmp    1100 <nmiISR>

LLVM IR (-O0):
define void @nmiISR() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @nmiISR() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
double floor(double);
__attribute__((__weak__, __always___)) double softboundmpx_floor(double x) {
  return floor(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_floor>:
jmp    1030 <floor@plt>

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

LLVM IR (-O2):
define weak double @softboundmpx_floor(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ foobar(char *);
__attribute__((no_instrument_function)) void func2(void) {
  int i;
  for (i = 0; i < 10; i++)
    foobar("Hello world");
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1143 <func2+0x33>
lea    0xed0(%rip),%rdi
call   1030 <foobar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <func2+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <foobar@plt>
mov    %rbx,%rdi
call   1030 <foobar@plt>
mov    %rbx,%rdi
call   1030 <foobar@plt>
mov    %rbx,%rdi
call   1030 <foobar@plt>
mov    %rbx,%rdi
call   1030 <foobar@plt>
mov    %rbx,%rdi
call   1030 <foobar@plt>
mov    %rbx,%rdi
call   1030 <foobar@plt>
mov    %rbx,%rdi
call   1030 <foobar@plt>
mov    %rbx,%rdi
call   1030 <foobar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <foobar@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define void @func2() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define void @func2() {
%1 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
void f138(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    goto a;
    ({ 0; });
    0;
  });
a:
  0;
}


x86 assembly (clang, -O0):
<f138>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f138() {
ret void
}
int tuncompress_file() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tuncompress_file() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int INT32_MAX;
int INT32_MIN;
int32_t Pulse(uint32_t phase) {
  if (phase & 0x80000000) {
    return INT32_MIN >> 2;
  } else {
    return INT32_MAX >> 2;
  }
}


x86 assembly (clang, -O0):
<Pulse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     112c <Pulse+0x2c>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
sar    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <Pulse+0x3b>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
sar    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pulse>:
test   %edi,%edi
js     110d <Pulse+0xd>
mov    0x2ed5(%rip),%rax
jmp    1114 <Pulse+0x14>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
sar    $0x2,%eax
ret

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

LLVM IR (-O2):
@INT32_MIN = global i32 0
@INT32_MAX = global i32 0
define i32 @Pulse(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = load i32, i32* @INT32_MAX
%4 = load i32, i32* @INT32_MIN
%5 = select i1 %2, i32 %3, i32 %4
%6 = ashr i32 %5, 2
ret i32 %6
}
int DirtoDy(int dir) {
  if (dir == 1)
    return -1;
  else if (dir == 3)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<DirtoDy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <DirtoDy+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <DirtoDy+0x3a>
cmpl   $0x3,-0x8(%rbp)
jne    1133 <DirtoDy+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <DirtoDy+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DirtoDy>:
xor    %ecx,%ecx
cmp    $0x3,%edi
sete   %cl
cmp    $0x1,%edi
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @DirtoDy(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = zext i1 %2 to i32
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i32 -1, i32 %3
ret i32 %5
}
void hal_mem_init(struct multiboot_tag_mmap *info) {
  { (info) = (info); };
}


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

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

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

LLVM IR (-O2):
%struct.multiboot_tag_mmap = type opaque
define void @hal_mem_init(%struct.multiboot_tag_mmap* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *sxerox(char *s) {
  char *rv = (char *)malloc(strlen(s) + 1);
  strcpy(rv, s);
  return rv;
}


x86 assembly (clang, -O0):
<sxerox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sxerox>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @sxerox(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @sxerox(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int read(int, void *, size_t);
int gg_resolver_recv(int fd, void *buf, size_t len) {
  return read(fd, buf, len);
}


x86 assembly (clang, -O0):
<gg_resolver_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gg_resolver_recv>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @gg_resolver_recv(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int truncate(char *, int /*<<< orphan*/);
int fs_truncate(char *path, int len) { return truncate(path, (off_t)len); }


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

x86 assembly (clang, -O2):
<fs_truncate>:
jmp    1030 <truncate@plt>

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

LLVM IR (-O2):
define i32 @fs_truncate(i8* %0, i32 %1) {
%3 = tail call i32 @truncate(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dq_iterator_impl(void (*)(int *));
void dq_iterator(void (*fn)(int *x)) { dq_iterator_impl(fn); }


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

x86 assembly (clang, -O2):
<dq_iterator>:
jmp    1030 <dq_iterator_impl@plt>

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

LLVM IR (-O2):
define void @dq_iterator(void (i32*)* %0) {
%2 = tail call i32 @dq_iterator_impl(void (i32*)* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *, char *, char *);
void version(void) {
  printw("Prool BBS client compilation %s %s\n", "Mar 18 2022", "00:30:51");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf02(%rip),%rsi
lea    0xf07(%rip),%rdx
call   1030 <printw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xf06(%rip),%rsi
lea    0xf0b(%rip),%rdx
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Prool BBS client compilation %s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 18 2022\00"
@.str.2 = [9 x i8] c"00:30:51\00"
define void @version() {
%1 = call i32 @printw(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Prool BBS client compilation %s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 18 2022\00"
@.str.2 = [9 x i8] c"00:30:51\00"
define void @version() {
%1 = tail call i32 @printw(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void ASN1_TYPE_get_octetstring(void) {}


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

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

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

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