xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void memerror() {
  printf("Memory allocation error\n");
  fflush(stdout);
  getchar();
  exit(6);
}


x86 assembly (clang, -O0):
<memerror>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x6,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<memerror>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    $0x6,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Memory allocation error\0A\00"
@stdout = global i32 0
define void @memerror() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 (...) @getchar()
%5 = call i32 @exit(i32 6)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [24 x i8] c"Memory allocation error\00"
define void @memerror() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 @exit(i32 6)
unreachable
}
/* Variables and functions */
int tcp_connect(char const *, char *);
int /*<<< orphan*/ time_recv(int);
void test_concur(const char *host) {
  int connfd;
  while (1) {
    connfd = tcp_connect(host, "daytime");
    time_recv(connfd);
  }
}


x86 assembly (clang, -O0):
<test_concur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <tcp_connect@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <time_recv@plt>
jmp    112c <test_concur+0xc>

x86 assembly (clang, -O2):
<test_concur>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <tcp_connect@plt>
mov    %eax,%edi
call   1030 <time_recv@plt>
jmp    1130 <test_concur+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"daytime\00"
define void @test_concur(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %1, %4
%5 = load i8*, i8** %2
%6 = call i32 @tcp_connect(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @time_recv(i32 %7)
br label %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"daytime\00"
define void @test_concur(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @tcp_connect(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @time_recv(i32 %3)
br label %2
}
void mapMem(void) { return; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @EC_POINT_is_on_curve() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AssertFailure(char *, int);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTFIFODisable(unsigned long ulBase) {
  {
    if (!(UARTBaseValid(ulBase))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          509);
    }
  };
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) &= ~(0x00000010);
}


x86 assembly (clang, -O0):
<UARTFIFODisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    114f <UARTFIFODisable+0x2f>
lea    0xebb(%rip),%rdi
mov    $0x1fd,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
and    $0xffffffffffffffef,%rcx
mov    %rcx,0x2c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFODisable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    113e <UARTFIFODisable+0x1e>
lea    0xecc(%rip),%rdi
mov    $0x1fd,%esi
call   1030 <AssertFailure@plt>
andq   $0xffffffffffffffef,0x2c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTFIFODisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 509)
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = add i64 %9, 44
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, -17
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define void @UARTFIFODisable(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 509)
br label %6
6: ; preds = %4, %1
%7 = add i64 %0, 44
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, -17
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ bsearch(int, int);
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  bsearch(x, y);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <bsearch@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @bsearch(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int floatsleep(double secs) {
  sleep((int)secs);
  return 0;
}


x86 assembly (clang, -O0):
<floatsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatsleep>:
push   %rax
cvttsd2si %xmm0,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @floatsleep(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = call i32 @sleep(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @floatsleep(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call i32 @sleep(i32 %2)
ret i32 0
}
int unsetenv(const char *n __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @unsetenv(i8* nocapture readnone %0) {
ret i32 0
}
int gll1(int j, unsigned char *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<gll1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gll1>:
movzbl (%rsi,%rdx,1),%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @gll1(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 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @gll1(i32 %0, i8* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xd5() {
  Assert_real((isxdigit(213) == 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",
              1070, ("isxdigit should be 0 for 0xd5"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xd5>:
push   %rax
mov    $0xd5,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x42e,%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 0xd5\00"
define void @t_isxdigit_0xd5() {
%1 = call i64 @isxdigit(i32 213)
%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 1070, 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 0xd5\00"
define void @t_isxdigit_0xd5() {
%1 = tail call i64 @isxdigit(i32 213)
%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 1070, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int max_limit_check(int val, const int MAX, const int MIN) {
  return (val > MAX) || (val < MIN);
}


x86 assembly (clang, -O0):
<max_limit_check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     112a <max_limit_check+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_limit_check>:
cmp    %esi,%edi
setg   %al
cmp    %edx,%edi
setl   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @max_limit_check(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sgt i32 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ true, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @max_limit_check(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp slt i32 %0, %2
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
long int __arch_atomic_swap(long int *p, long int replace) {
  long temp = *p;
  *p = replace;
  return temp;
}


x86 assembly (clang, -O0):
<__arch_atomic_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @__arch_atomic_swap(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
store i64 %1, i64* %0
ret i64 %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
extern int isreg(const char *fn) {
  struct stat buf;
  return (stat(fn, &buf) ? 0 : S_ISREG(buf.st_mode));
}


x86 assembly (clang, -O0):
<isreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     114d <isreg+0x2d>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <isreg+0x38>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreg>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <isreg+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isreg(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISREG(i32 %10)
br label %12
12: ; preds = %8, %7
%13 = phi i32 [ 0, %7 ], [ %11, %8 ]
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isreg(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Type definitions */
struct Task {
  int dummy;
};

/* Variables and functions */
char *strdup(char *);
int /*<<< orphan*/ timecalc_set_busy(int);
char *handle_unbusy(char *arg, struct Task *tasks, unsigned n) {
  (void)arg, (void)tasks, (void)n;
  timecalc_set_busy(false);
  return strdup("You're no longer assumed to be busy.");
}


x86 assembly (clang, -O0):
<handle_unbusy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
call   1030 <timecalc_set_busy@plt>
lea    0xebf(%rip),%rdi
call   1040 <strdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_unbusy>:
push   %rax
xor    %edi,%edi
call   1030 <timecalc_set_busy@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <strdup@plt>

LLVM IR (-O0):
%struct.Task = type { i32 }
@.str = [37 x i8] c"You're no longer assumed to be busy.\00"
define i8* @handle_unbusy(i8* %0, %struct.Task* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.Task*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.Task* %1, %struct.Task** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load %struct.Task*, %struct.Task** %5
%9 = load i32, i32* %6
%10 = call i32 @timecalc_set_busy(i32 0)
%11 = call i8* @strdup(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i8* %11
}

LLVM IR (-O2):
%struct.Task = type { i32 }
@.str = [37 x i8] c"You're no longer assumed to be busy.\00"
define noalias i8* @handle_unbusy(i8* nocapture readnone %0, %struct.Task* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @timecalc_set_busy(i32 0)
%5 = tail call dereferenceable_or_null(37) i8* @strdup(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open64(char *, int /*<<< orphan*/);
int main(void) {
  char *path = "/etc/passwd";
  int fd = open64(path, O_RDONLY);
  if (fd >= 0)
    close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1040 <open64@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1161 <main+0x41>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open64@plt>
test   %eax,%eax
js     1141 <main+0x21>
mov    %eax,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/etc/passwd\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open64(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %3
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"/etc/passwd\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open64(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __cxa_finalize(int /*<<< orphan*/ *);
int /*<<< orphan*/ __thread_doexit(int);
int /*<<< orphan*/ _exit(int);
void __libc_exit(int code) {
  __thread_doexit(code);
  __cxa_finalize(NULL);
  _exit(code);
}


x86 assembly (clang, -O0):
<__libc_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <__thread_doexit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <__cxa_finalize@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<__libc_exit>:
push   %rbx
mov    %edi,%ebx
call   1040 <__thread_doexit@plt>
xor    %edi,%edi
call   1050 <__cxa_finalize@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @__libc_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__thread_doexit(i32 %3)
%5 = call i32 @__cxa_finalize(i32* null)
%6 = load i32, i32* %2
%7 = call i32 @_exit(i32 %6)
unreachable
}

LLVM IR (-O2):
define void @__libc_exit(i32 %0) {
%2 = tail call i32 @__thread_doexit(i32 %0)
%3 = tail call i32 @__cxa_finalize(i32* null)
%4 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void nomem(void) {
  fprintf(stderr, "No enough memory\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<nomem>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nomem>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"No enough memory\0A\00"
@EXIT_FAILURE = global i32 0
define void @nomem() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"No enough memory\0A\00"
@EXIT_FAILURE = global i32 0
define void @nomem() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR66_get(void) { return U_WMRCORENONE_get("U_WMR66"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR66\00"
define i32 @U_WMR66_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR66\00"
define i32 @U_WMR66_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x55() {
  Assert_real((isbdigit(85) == 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_isbdigit.c",
              430, ("isbdigit should be 0 for U"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x55>:
push   %rax
mov    $0x55,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1ae,%edx
pop    %rax
jmp    1030 <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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for U\00"
define void @t_isbdigit_0x55() {
%1 = call i64 @isbdigit(i32 85)
%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 430, i8* getelementptr inbounds ([27 x i8], [27 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for U\00"
define void @t_isbdigit_0x55() {
%1 = tail call i64 @isbdigit(i32 85)
%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 430, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void idle(void) {
  while (1) {
    asm volatile("hlt");
  }
}


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

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

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

LLVM IR (-O2):
define void @idle() {
br label %1
1: ; preds = %0, %1
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
int test_imm_9Duint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x9D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Duint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 157
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_9Duint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10289152
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int close(int);
int lisp_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<lisp_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @lisp_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __udivmoddi4(long long, long long, long long *);
long long __moddi3(long long u, long long v) {
  long c = 0;
  long long w;
  if (u < 0) {
    c = ~c;
    u = -u;
  }
  if (v < 0)
    v = -v;
  __udivmoddi4(u, v, &w);
  if (c)
    w = -w;
  return w;
}


x86 assembly (clang, -O0):
<__moddi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1149 <__moddi3+0x39>
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    115e <__moddi3+0x4e>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <__udivmoddi4@plt>
cmpq   $0x0,-0x18(%rbp)
je     1184 <__moddi3+0x74>
xor    %eax,%eax
sub    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__moddi3>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
neg    %rdi
cmovs  %rbx,%rdi
mov    %rsi,%rax
neg    %rax
cmovns %rax,%rsi
lea    0x8(%rsp),%rdx
call   1030 <__udivmoddi4@plt>
mov    0x8(%rsp),%rcx
mov    %rcx,%rax
neg    %rax
test   %rbx,%rbx
cmovns %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__moddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%7 = load i64, i64* %3
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i64, i64* %5
%11 = xor i64 %10, -1
store i64 %11, i64* %5
%12 = load i64, i64* %3
%13 = sub nsw i64 0, %12
store i64 %13, i64* %3
br label %14
14: ; preds = %9, %2
%15 = load i64, i64* %4
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i64, i64* %4
%19 = sub nsw i64 0, %18
store i64 %19, i64* %4
br label %20
20: ; preds = %17, %14
%21 = load i64, i64* %3
%22 = load i64, i64* %4
%23 = call i32 @__udivmoddi4(i64 %21, i64 %22, i64* %6)
%24 = load i64, i64* %5
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %20
%27 = load i64, i64* %6
%28 = sub nsw i64 0, %27
store i64 %28, i64* %6
br label %29
29: ; preds = %26, %20
%30 = load i64, i64* %6
ret i64 %30
}

LLVM IR (-O2):
define i64 @__moddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = icmp slt i64 %0, 0
%6 = sub nsw i64 0, %0
%7 = select i1 %5, i64 %6, i64 %0
%8 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%9 = call i32 @__udivmoddi4(i64 %7, i64 %8, i64* %3)
%10 = load i64, i64* %3
%11 = sub nsw i64 0, %10
%12 = select i1 %5, i64 %11, i64 %10
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ safe_memset(void *, int /*<<< orphan*/, size_t);
void safe_memclear(void *s, size_t n) { safe_memset(s, 0, n); }


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

x86 assembly (clang, -O2):
<safe_memclear>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <safe_memset@plt>

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

LLVM IR (-O2):
define void @safe_memclear(i8* %0, i64 %1) {
%3 = tail call i32 @safe_memset(i8* %0, i32 0, i64 %1)
ret void
}
void fillz(ptr, size, nitem) char *ptr;
int size, nitem;
{
  register long n;
  n = size * nitem;
  while (n--)
    *ptr++ = '\0';
}


x86 assembly (clang, -O0):
<fillz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     114b <fillz+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    111b <fillz+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillz>:
imul   %edx,%esi
test   %esi,%esi
je     1126 <fillz+0x16>
push   %rax
movslq %esi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @fillz(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = sext i32 %4 to i64
br label %8
8: ; preds = %6, %3
ret void
}
int pathconN_nm6_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @pathconN_nm6_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @pathconN_nm6_n_out() {
ret i32 2
}
/* Variables and functions */
int LeoGeo_size_of_lba(int, int);
int LeoGeo_size_of_sectors(int type, int lba) {
  return LeoGeo_size_of_lba(type, lba) / 85;
}


x86 assembly (clang, -O0):
<LeoGeo_size_of_sectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <LeoGeo_size_of_lba@plt>
mov    $0x55,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeoGeo_size_of_sectors>:
push   %rax
call   1030 <LeoGeo_size_of_lba@plt>
cltq
imul   $0x60606061,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @LeoGeo_size_of_sectors(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 = call i32 @LeoGeo_size_of_lba(i32 %5, i32 %6)
%8 = sdiv i32 %7, 85
ret i32 %8
}

LLVM IR (-O2):
define i32 @LeoGeo_size_of_sectors(i32 %0, i32 %1) {
%3 = tail call i32 @LeoGeo_size_of_lba(i32 %0, i32 %1)
%4 = sdiv i32 %3, 85
ret i32 %4
}
float floorf(float x) {
  long r;
  r = x;
  if (r <= 0)
    return (r + ((r > x) ? -1 : 0));
  else
    return r;
}


x86 assembly (clang, -O0):
<floorf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     114f <floorf+0x4f>
mov    -0x10(%rbp),%rax
cvtsi2ssq -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %ecx,%ecx
mov    $0xffffffff,%edx
ucomiss %xmm1,%xmm0
cmova  %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115a <floorf+0x5a>
cvtsi2ssq -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floorf>:
cvttss2si %xmm0,%rax
cvtsi2ss %rax,%xmm1
ucomiss %xmm0,%xmm1
seta   %cl
test   %rax,%rax
setle  %dl
and    %cl,%dl
movzbl %dl,%ecx
sub    %rcx,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
ret

LLVM IR (-O0):
define float @floorf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i64
store float %0, float* %3
%5 = load float, float* %3
%6 = fptosi float %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = icmp sle i64 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %1
%10 = load i64, i64* %4
%11 = load i64, i64* %4
%12 = sitofp i64 %11 to float
%13 = load float, float* %3
%14 = fcmp ogt float %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 -1, i32 0
%17 = sext i32 %16 to i64
%18 = add nsw i64 %10, %17
%19 = sitofp i64 %18 to float
store float %19, float* %2
br label %23
20: ; preds = %1
%21 = load i64, i64* %4
%22 = sitofp i64 %21 to float
store float %22, float* %2
br label %23
23: ; preds = %20, %9
%24 = load float, float* %2
ret float %24
}

LLVM IR (-O2):
define float @floorf(float %0) {
%2 = fptosi float %0 to i64
%3 = sitofp i64 %2 to float
%4 = fcmp ogt float %3, %0
%5 = icmp slt i64 %2, 1
%6 = and i1 %5, %4
%7 = sext i1 %6 to i64
%8 = add nsw i64 %7, %2
%9 = sitofp i64 %8 to float
ret float %9
}
int hugetlbfs_unlinked_fd_for_size(long page_size) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @hugetlbfs_unlinked_fd_for_size(i64 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ UI_PopMenu();
void UI_TeamOrdersMenu_BackEvent(void *ptr, int event) {
  if (event != 3) {
    return;
  }
  UI_PopMenu();
}


x86 assembly (clang, -O0):
<UI_TeamOrdersMenu_BackEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
je     112e <UI_TeamOrdersMenu_BackEvent+0x1e>
jmp    1135 <UI_TeamOrdersMenu_BackEvent+0x25>
mov    $0x0,%al
call   1030 <UI_PopMenu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_TeamOrdersMenu_BackEvent>:
cmp    $0x3,%esi
jne    111c <UI_TeamOrdersMenu_BackEvent+0xc>
xor    %eax,%eax
jmp    1030 <UI_PopMenu@plt>
ret

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

LLVM IR (-O2):
define void @UI_TeamOrdersMenu_BackEvent(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @UI_PopMenu()
br label %6
6: ; preds = %2, %4
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_usec;
  double tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double get_microtime() {
  struct timeval tv;
  struct timezone tz;
  if (!gettimeofday(&tv, &tz)) {
    return ((0.000001 * tv.tv_usec) + tv.tv_sec);
  }
  return -1.0;
}


x86 assembly (clang, -O0):
<get_microtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <gettimeofday@plt>
cmp    $0x0,%eax
jne    1152 <get_microtime+0x42>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <get_microtime+0x4f>
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_microtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
test   %eax,%eax
je     1132 <get_microtime+0x22>
movsd  0xedb(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  0x8(%rsp),%xmm0
mulsd  0xec0(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @get_microtime() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = alloca %struct.timezone
%4 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%10 = load double, double* %9
%11 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %8, double %10)
store double %11, double* %1
br label %13
12: ; preds = %0
store double -1.000000e+00, double* %1
br label %13
13: ; preds = %12, %6
%14 = load double, double* %1
ret double %14
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @get_microtime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load double, double* %9
%11 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %10)
%12 = select i1 %6, double %11, double -1.000000e+00
ret double %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ErrorDisplayMessage(char *, int);
void checkRegister(uint32_t sourceRegister) {
  if (sourceRegister > 12)
    ErrorDisplayMessage("DataHandler: Unexpected register", 1);
}


x86 assembly (clang, -O0):
<checkRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jle    1136 <checkRegister+0x26>
lea    0xed4(%rip),%rdi
mov    $0x1,%esi
call   1030 <ErrorDisplayMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkRegister>:
cmp    $0xd,%edi
jl     1126 <checkRegister+0x16>
lea    0xee4(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <ErrorDisplayMessage@plt>
ret

LLVM IR (-O0):
@.str = [33 x i8] c"DataHandler: Unexpected register\00"
define void @checkRegister(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 12
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @ErrorDisplayMessage(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1)
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"DataHandler: Unexpected register\00"
define void @checkRegister(i32 %0) {
%2 = icmp sgt i32 %0, 12
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @ErrorDisplayMessage(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  if (fork() == 0) {
    printf("hello world\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
jne    1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    115f <main+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    1140 <main+0x20>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ tprintf(char *, double, double, double, double, char *);
void putOvalPartsPicture(double cx, double cy, double rx, double ry,
                         char *position) {
  tprintf("\\put(%3.4f,%3.4f){\\oval(%3.4f,%3.4f)%s}\n", cx, cy, rx, ry,
          position);
}


x86 assembly (clang, -O0):
<putOvalPartsPicture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mov    -0x28(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <tprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [41 x i8] c"\\put(%3.4f,%3.4f){\\oval(%3.4f,%3.4f)%s}\0A\00"
define void @putOvalPartsPicture(double %0, double %1, double %2, double %3, i8* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i8*
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i8* %4, i8** %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %8
%14 = load double, double* %9
%15 = load i8*, i8** %10
%16 = call i32 @tprintf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double %11, double %12, double %13, double %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"\\put(%3.4f,%3.4f){\\oval(%3.4f,%3.4f)%s}\0A\00"
define void @putOvalPartsPicture(double %0, double %1, double %2, double %3, i8* %4) {
%6 = tail call i32 @tprintf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %2, double %3, i8* %4)
ret void
}
void rewriteClientCommandVector(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               117, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<rewriteClientCommandVector>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x75,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewriteClientCommandVector>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x75,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.rewriteClientCommandVector = [27 x i8] c"rewriteClientCommandVector\00"
define void @rewriteClientCommandVector() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 117, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.rewriteClientCommandVector, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.rewriteClientCommandVector = [27 x i8] c"rewriteClientCommandVector\00"
define void @rewriteClientCommandVector() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 117, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.rewriteClientCommandVector, i64 0, i64 0))
ret void
}