xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ add(size_t, size_t);
void *xreallocn(void *, int /*<<< orphan*/, size_t);
void *xrealloce(void *ptr, size_t count1, size_t count2, size_t elemsize) {
  return xreallocn(ptr, add(count1, count2), elemsize);
}


x86 assembly (clang, -O0):
<xrealloce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <add@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
call   1040 <xreallocn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloce>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <add@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <xreallocn@plt>

LLVM IR (-O0):
define i8* @xrealloce(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = call i32 @add(i64 %10, i64 %11)
%13 = load i64, i64* %8
%14 = call i8* @xreallocn(i8* %9, i32 %12, i64 %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @xrealloce(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @add(i64 %1, i64 %2)
%6 = tail call i8* @xreallocn(i8* %0, i32 %5, i64 %3)
ret i8* %6
}
void print_serial(const char *buf) {
  unsigned long len = strlen(buf);
  asm volatile("cld; addr32/rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1));
}


x86 assembly (clang, -O0):
<print_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0xf1,%edx
cld
rep outsb %ds:(%esi),(%dx)
mov    %rsi,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_serial>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0xf1,%edx
mov    %rbx,%rsi
mov    %rax,%rcx
cld
rep outsb %ds:(%esi),(%dx)
pop    %rbx
ret

LLVM IR (-O0):
define void @print_serial(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call { i8*, i64 } asm sideeffect "cld; addr32/rep/outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 241, i8* %6, i64 %7)
%9 = extractvalue { i8*, i64 } %8, 0
%10 = extractvalue { i8*, i64 } %8, 1
store i8* %9, i8** %2
store i64 %10, i64* %3
ret void
}

LLVM IR (-O2):
define void @print_serial(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call { i8*, i64 } asm sideeffect "cld; addr32/rep/outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 241, i8* %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun3();
int main(void) {
  fun3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fun3()
ret i32 0
}
int f_lt_rm2(float a1, float *a2) { return !(((a1) < (*a2))); }


x86 assembly (clang, -O0):
<f_lt_rm2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_lt_rm2>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_lt_rm2(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = load float*, float** %4
%7 = load float, float* %6
%8 = fcmp olt float %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_lt_rm2(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp ule float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void disable_srat(void) {}


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

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

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

LLVM IR (-O2):
define void @disable_srat() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __no_gpio_code_for_this_architecture__();
void gpio_dir(int gpio, int output, int value) {
  __no_gpio_code_for_this_architecture__();
}


x86 assembly (clang, -O0):
<gpio_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__no_gpio_code_for_this_architecture__@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gpio_dir(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 = call i32 (...) @__no_gpio_code_for_this_architecture__()
ret void
}

LLVM IR (-O2):
define void @gpio_dir(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @__no_gpio_code_for_this_architecture__()
ret void
}
void *test_anti_range_104(unsigned int n) {
  extern void *alloc_anti_range_104(unsigned int)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_104(n);
}


x86 assembly (clang, -O0):
<test_anti_range_104>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
ja     1137 <test_anti_range_104+0x27>
cmpl   $0x2,-0x4(%rbp)
ja     1137 <test_anti_range_104+0x27>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_104@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_104>:
cmp    $0x3,%edi
mov    $0xffffffff,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_104@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_104(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = select i1 %2, i32 -1, i32 %0
%4 = tail call i8* @alloc_anti_range_104(i32 %3)
ret i8* %4
}
void free3(void ***p) {
  free(p[0][0]);
  free(p[0]);
  free(p);
}


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

x86 assembly (clang, -O2):
<free3>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free3(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i8***, i8**** %2
%4 = getelementptr inbounds i8**, i8*** %3, i64 0
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = load i8***, i8**** %2
%9 = getelementptr inbounds i8**, i8*** %8, i64 0
%10 = load i8**, i8*** %9
%11 = bitcast i8** %10 to i8*
%12 = load i8***, i8**** %2
%13 = bitcast i8*** %12 to i8*
ret void
}

LLVM IR (-O2):
define void @free3(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i8*** %0 to i8**
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast i8*** %0 to i8*
tail call void @free(i8* %6)
ret void
}
int ispunct(int c) {
  return ((c >= 0x21 && c <= 0x2F) || (c >= 0x3a && c <= 0x40) ||
          (c >= 0x5b && c <= 0x60) || (c >= 0x7b && c <= 0x7e));
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
jl     1120 <ispunct+0x20>
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x3a,-0x4(%rbp)
jl     1139 <ispunct+0x39>
mov    $0x1,%al
cmpl   $0x40,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x5b,-0x4(%rbp)
jl     1152 <ispunct+0x52>
mov    $0x1,%al
cmpl   $0x60,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
xor    %eax,%eax
cmpl   $0x7b,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     116b <ispunct+0x6b>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddd  0xeef(%rip),%xmm0
pxor   0xef7(%rip),%xmm0
movdqa 0xeff(%rip),%xmm1
pcmpgtd %xmm0,%xmm1
movmskps %xmm1,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 47
br i1 %7, label %28, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 58
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 64
br i1 %13, label %28, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 91
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 96
br i1 %19, label %28, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp sge i32 %21, 123
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 126
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ false, %20 ], [ %25, %23 ]
br label %28
28: ; preds = %26, %17, %11, %5
%29 = phi i1 [ true, %17 ], [ true, %11 ], [ true, %5 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = insertelement <4 x i32> poison, i32 %0, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = add <4 x i32> %3, <i32 -123, i32 -91, i32 -33, i32 -58>
%5 = icmp ult <4 x i32> %4, <i32 4, i32 6, i32 15, i32 7>
%6 = bitcast <4 x i1> %5 to i4
%7 = icmp ne i4 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
void asm_test(void) {}


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

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

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

LLVM IR (-O2):
define void @asm_test() {
ret void
}
int __attribute__((no)) ngtu(unsigned a, unsigned b) { return -(a > b); }


x86 assembly (clang, -O0):
<ngtu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ngtu>:
cmp    %edi,%esi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ngtu(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 = icmp ugt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = sub nsw i32 0, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ngtu(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
scalar_t__ takePtrToPtr(int **);
void PassTheAddrOfAllocatedData(int f) {
  int *p = malloc(12);
  if (takePtrToPtr(&p))
    f++;
  free(p);
}


x86 assembly (clang, -O0):
<PassTheAddrOfAllocatedData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1050 <takePtrToPtr@plt>
cmp    $0x0,%rax
je     1165 <PassTheAddrOfAllocatedData+0x35>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PassTheAddrOfAllocatedData>:
push   %rax
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1050 <takePtrToPtr@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @PassTheAddrOfAllocatedData(i32 %0) {
%2 = alloca i32*
%3 = bitcast i32** %2 to i8*
%4 = tail call i32* @malloc(i32 12)
store i32* %4, i32** %2
%5 = call i64 @takePtrToPtr(i32** %2)
%6 = load i32*, i32** %2
%7 = call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_setVolume(int);
void event_volumeKnobMaxed(void) { display_setVolume(11); }


x86 assembly (clang, -O0):
<event_volumeKnobMaxed>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
call   1030 <display_setVolume@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_volumeKnobMaxed>:
mov    $0xb,%edi
jmp    1030 <display_setVolume@plt>

LLVM IR (-O0):
define void @event_volumeKnobMaxed() {
%1 = call i32 @display_setVolume(i32 11)
ret void
}

LLVM IR (-O2):
define void @event_volumeKnobMaxed() {
%1 = tail call i32 @display_setVolume(i32 11)
ret void
}
/* Variables and functions */
int add_int(int, int);
int wack_int(register int u, register int v) {
  register int l = u, r = v;
  l = add_int(l, r);
  return l + r;
}


x86 assembly (clang, -O0):
<wack_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <add_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @wack_int(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
%7 = load i32, i32* %3
store i32 %7, i32* %5
%8 = load i32, i32* %4
store i32 %8, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @add_int(i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @wack_int(i32 %0, i32 %1) {
%3 = tail call i32 @add_int(i32 %0, i32 %1)
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
size_t splitvexists_bit_LaceKVE_size();
size_t get_splitvexists_bit_LaceKVE_size(size_t x) {
  return x & splitvexists_bit_LaceKVE_size();
}


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

x86 assembly (clang, -O2):
<get_splitvexists_bit_LaceKVE_size>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <splitvexists_bit_LaceKVE_size@plt>
and    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_splitvexists_bit_LaceKVE_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 (...) @splitvexists_bit_LaceKVE_size()
%5 = and i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_splitvexists_bit_LaceKVE_size(i64 %0) {
%2 = tail call i64 (...) @splitvexists_bit_LaceKVE_size()
%3 = and i64 %2, %0
ret i64 %3
}
/* Variables and functions */
double airErfc(double);
double airErf(double x) { return 1.0 - airErfc(x); }


x86 assembly (clang, -O0):
<airErf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <airErfc@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<airErf>:
push   %rax
call   1030 <airErfc@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @airErf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @airErfc(double %3)
%5 = fsub double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @airErf(double %0) {
%2 = tail call double @airErfc(double %0)
%3 = fsub double 1.000000e+00, %2
ret double %3
}
/* Variables and functions */
scalar_t__ round(float);
float Point_trimAngle(float inputAngle) {
  int deg = (int)round(inputAngle);
  int degTrimmed = (int)round(inputAngle) % 360;
  float toremove = deg - degTrimmed;
  return inputAngle - toremove;
}


x86 assembly (clang, -O0):
<Point_trimAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <round@plt>
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <round@plt>
mov    $0x168,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Point_trimAngle>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <round@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <round@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x8,%ecx
add    %edx,%ecx
imul   $0x168,%ecx,%ecx
sub    %eax,%ecx
add    %ebx,%ecx
cvtsi2ss %ecx,%xmm1
movss  0xc(%rsp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @Point_trimAngle(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store float %0, float* %2
%6 = load float, float* %2
%7 = call i64 @round(float %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load float, float* %2
%10 = call i64 @round(float %9)
%11 = trunc i64 %10 to i32
%12 = srem i32 %11, 360
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = sitofp i32 %15 to float
store float %16, float* %5
%17 = load float, float* %2
%18 = load float, float* %5
%19 = fsub float %17, %18
ret float %19
}

LLVM IR (-O2):
define float @Point_trimAngle(float %0) {
%2 = tail call i64 @round(float %0)
%3 = trunc i64 %2 to i32
%4 = tail call i64 @round(float %0)
%5 = trunc i64 %4 to i32
%6 = srem i32 %5, 360
%7 = sub nsw i32 %3, %6
%8 = sitofp i32 %7 to float
%9 = fsub float %0, %8
ret float %9
}
/* Type definitions */
struct libusb_config_descriptor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_configuration(struct libusb_config_descriptor *);
int /*<<< orphan*/ free(struct libusb_config_descriptor *);
void libusb_free_config_descriptor(struct libusb_config_descriptor *config) {
  if (!config)
    return;
  clear_configuration(config);
  free(config);
}


x86 assembly (clang, -O0):
<libusb_free_config_descriptor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <libusb_free_config_descriptor+0x1c>
jmp    114e <libusb_free_config_descriptor+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <clear_configuration@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libusb_free_config_descriptor>:
test   %rdi,%rdi
je     1137 <libusb_free_config_descriptor+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_configuration@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.libusb_config_descriptor = type { i32 }
define void @libusb_free_config_descriptor(%struct.libusb_config_descriptor* %0) {
%2 = alloca %struct.libusb_config_descriptor*
store %struct.libusb_config_descriptor* %0, %struct.libusb_config_descriptor** %2
%3 = load %struct.libusb_config_descriptor*, %struct.libusb_config_descriptor** %2
%4 = icmp ne %struct.libusb_config_descriptor* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load %struct.libusb_config_descriptor*, %struct.libusb_config_descriptor** %2
%8 = call i32 @clear_configuration(%struct.libusb_config_descriptor* %7)
%9 = load %struct.libusb_config_descriptor*, %struct.libusb_config_descriptor** %2
%10 = call i32 @free(%struct.libusb_config_descriptor* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.libusb_config_descriptor = type { i32 }
define void @libusb_free_config_descriptor(%struct.libusb_config_descriptor* %0) {
%2 = icmp eq %struct.libusb_config_descriptor* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @clear_configuration(%struct.libusb_config_descriptor* %0)
%5 = tail call i32 @free(%struct.libusb_config_descriptor* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Type definitions */
struct list_lp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct list_lp *);
int /*<<< orphan*/ list_lp_delete(struct list_lp *);
void list_lp_destroy(struct list_lp *target) {
  list_lp_delete(target);
  free(target);
}


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

x86 assembly (clang, -O2):
<list_lp_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_lp_delete@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.list_lp = type { i32 }
define void @list_lp_destroy(%struct.list_lp* %0) {
%2 = alloca %struct.list_lp*
store %struct.list_lp* %0, %struct.list_lp** %2
%3 = load %struct.list_lp*, %struct.list_lp** %2
%4 = call i32 @list_lp_delete(%struct.list_lp* %3)
%5 = load %struct.list_lp*, %struct.list_lp** %2
%6 = call i32 @free(%struct.list_lp* %5)
ret void
}

LLVM IR (-O2):
%struct.list_lp = type { i32 }
define void @list_lp_destroy(%struct.list_lp* %0) {
%2 = tail call i32 @list_lp_delete(%struct.list_lp* %0)
%3 = tail call i32 @free(%struct.list_lp* %0)
ret void
}
/* Variables and functions */
unsigned int multiply(int, int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char **argv) {
  unsigned int result = multiply(5, 4);
  printf("result = %u\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
mov    $0x4,%esi
call   1030 <multiply@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x4,%esi
call   1030 <multiply@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"result = %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @multiply(i32 5, i32 4)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"result = %u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @multiply(i32 5, i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int is_quick_decrease(int d1, int d2) {
  if (d2 < 5)
    return d2 * 2 - 1 <= d1;
  return d2 * 1.5 <= d1;
}


x86 assembly (clang, -O0):
<is_quick_decrease>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1130 <is_quick_decrease+0x30>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <is_quick_decrease+0x55>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_quick_decrease>:
cmp    $0x4,%esi
jg     1114 <is_quick_decrease+0x14>
lea    (%rsi,%rsi,1),%eax
add    $0xffffffff,%eax
cmp    %edi,%eax
setle  %al
movzbl %al,%eax
ret
cvtsi2sd %esi,%xmm0
mulsd  0xee0(%rip),%xmm0
cvtsi2sd %edi,%xmm1
ucomisd %xmm0,%xmm1
setae  %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @is_quick_decrease(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 2
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %3
br label %23
15: ; preds = %2
%16 = load i32, i32* %5
%17 = sitofp i32 %16 to double
%18 = fmul double %17, 1.500000e+00
%19 = load i32, i32* %4
%20 = sitofp i32 %19 to double
%21 = fcmp ole double %18, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %15, %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_quick_decrease(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 5
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = shl nsw i32 %1, 1
%6 = add nsw i32 %5, -1
%7 = icmp sle i32 %6, %0
br label %13
8: ; preds = %2
%9 = sitofp i32 %1 to double
%10 = fmul double %9, 1.500000e+00
%11 = sitofp i32 %0 to double
%12 = fcmp ole double %10, %11
br label %13
13: ; preds = %8, %4
%14 = phi i1 [ %7, %4 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
library_function() { echo("Hello."); }


x86 assembly (clang, -O0):
<library_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <echo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello.\00"
define i32 @library_function() {
%1 = alloca i32
%2 = call i32 @echo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello.\00"
define i32 @library_function() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
                                      struct sk_buff *skb) {
  return;
}


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

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

LLVM IR (-O0):
%struct.batadv_priv = type opaque
%struct.sk_buff = type opaque
define void @batadv_nc_skb_store_for_decoding(%struct.batadv_priv* %0, %struct.sk_buff* %1) {
%3 = alloca %struct.batadv_priv*
%4 = alloca %struct.sk_buff*
store %struct.batadv_priv* %0, %struct.batadv_priv** %3
store %struct.sk_buff* %1, %struct.sk_buff** %4
ret void
}

LLVM IR (-O2):
%struct.batadv_priv = type opaque
%struct.sk_buff = type opaque
define void @batadv_nc_skb_store_for_decoding(%struct.batadv_priv* nocapture %0, %struct.sk_buff* nocapture %1) {
ret void
}
int main(void) {
  int a[4][3] = {};
  int z = a[0][4];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x44(%rbp)
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [3 x i32]]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x [3 x i32]]* %2 to i8*
%5 = getelementptr inbounds [4 x [3 x i32]], [4 x [3 x i32]]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 4
%7 = load i32, i32* %6
store i32 %7, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double min(double a, double b, double c) {
  double _min = a;
  if (_min > b)
    _min = b;
  if (_min > c)
    _min = c;
  return _min;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1137 <min+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1151 <min+0x51>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm0,%xmm1
minsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @min(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %1
%5 = select i1 %4, double %1, double %0
%6 = fcmp ogt double %5, %2
%7 = select i1 %6, double %2, double %5
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xe4() {
  Assert_real((ispunct(228) == 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_ispunct.c",
              1145, ("ispunct should be 0 for 0xe4"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xe4>:
push   %rax
mov    $0xe4,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x479,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xe4\00"
define void @t_ispunct_0xe4() {
%1 = call i64 @ispunct(i32 228)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xe4\00"
define void @t_ispunct_0xe4() {
%1 = tail call i64 @ispunct(i32 228)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __C_isdigit(int);
int isdigit(int c) { return __C_isdigit(c); }


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

x86 assembly (clang, -O2):
<isdigit>:
jmp    1030 <__C_isdigit@plt>

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = tail call i32 @__C_isdigit(i32 %0)
ret i32 %2
}
/* Variables and functions */
const size_t GetStringLength(const char *str) {
  size_t idx = 0;
  while (str[idx++] != 0)
    ;
  return idx - 1;
}


x86 assembly (clang, -O0):
<GetStringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1135 <GetStringLength+0x35>
jmp    1110 <GetStringLength+0x10>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetStringLength>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <GetStringLength+0x10>
ret

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

LLVM IR (-O2):
define i64 @GetStringLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int main() {
  time_t time_a = 0;
  struct tm *tm;
  tm = localtime(&time_a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call %struct.tm* @localtime(i32* %1)
ret i32 0
}
/* Variables and functions */
int xstrtoll(char const *, int);
int xstrtoi(const char *str, int b) { return xstrtoll(str, b); }


x86 assembly (clang, -O0):
<xstrtoi>:
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 <xstrtoll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrtoi>:
jmp    1030 <xstrtoll@plt>

LLVM IR (-O0):
define i32 @xstrtoi(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 @xstrtoll(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xstrtoi(i8* %0, i32 %1) {
%3 = tail call i32 @xstrtoll(i8* %0, i32 %1)
ret i32 %3
}
char *mount_config_opts(__attribute__((unused)) char *spec,
                        __attribute__((unused)) char *mount_point,
                        char *mount_opts) {
  return mount_opts;
}


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

x86 assembly (clang, -O2):
<mount_config_opts>:
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i8* @mount_config_opts(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @mount_config_opts(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* readnone returned %2) {
ret i8* %2
}
long get_sum_of_squares(int up_to) {
  long sum = 0;
  sum = (((2 * up_to + 3) * up_to) + 1) * up_to;
  sum /= 6;
  return sum;
}


x86 assembly (clang, -O0):
<get_sum_of_squares>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x3,%eax
imul   -0x4(%rbp),%eax
add    $0x1,%eax
imul   -0x4(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x6,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sum_of_squares>:
lea    (%rdi,%rdi,1),%eax
add    $0x3,%eax
imul   %edi,%eax
add    $0x1,%eax
imul   %edi,%eax
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
cltq
ret

LLVM IR (-O0):
define i64 @get_sum_of_squares(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 0, i64* %3
%4 = load i32, i32* %2
%5 = mul nsw i32 2, %4
%6 = add nsw i32 %5, 3
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = sext i32 %11 to i64
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = sdiv i64 %13, 6
store i64 %14, i64* %3
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @get_sum_of_squares(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 3
%4 = mul nsw i32 %3, %0
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %5, %0
%7 = sdiv i32 %6, 6
%8 = sext i32 %7 to i64
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x50() {
  Assert_real((isdigit(80) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              405, ("isdigit should be 0 for P"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x50>:
push   %rax
mov    $0x50,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x195,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for P\00"
define void @t_isdigit_0x50() {
%1 = call i64 @isdigit(i32 80)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for P\00"
define void @t_isdigit_0x50() {
%1 = tail call i64 @isdigit(i32 80)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *_nbt_strdup(const char *s) {
  char *r = malloc(strlen(s) + 1);
  if (r == NULL)
    return NULL;
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<_nbt_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <_nbt_strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <_nbt_strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @_nbt_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i8* null, i8** %2
br label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %12, %11
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @_nbt_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
void curl_easy_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @curl_easy_cleanup() {
ret void
}
int tolowers(int c) {
  if ('A' <= c && c <= 'Z') {
    c += 'a' - 'A';
  }
  return c;
}


x86 assembly (clang, -O0):
<tolowers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1128 <tolowers+0x28>
cmpl   $0x5a,-0x4(%rbp)
jg     1128 <tolowers+0x28>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolowers>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @tolowers(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int vsnprintf(char *, int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vsprintf(char *s, const char *fmt, va_list ap) {
  return vsnprintf(s, INT_MAX, fmt, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @INT_MAX
%5 = tail call i32 @vsnprintf(i8* %0, i32 %4, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int version() {
  printf("%s - Version %s\n", "Yaw", "0.0.1");
  return 0;
}


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

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xeef(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%s - Version %s\0A\00"
@.str.1 = [4 x i8] c"Yaw\00"
@.str.2 = [6 x i8] c"0.0.1\00"
define i32 @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s - Version %s\0A\00"
@.str.1 = [4 x i8] c"Yaw\00"
@.str.2 = [6 x i8] c"0.0.1\00"
define i32 @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void chat_done() {}


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

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

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

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