xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i = 10;
  for (; i-- > 5; i = (i < 5 ? i : i - 1))
    printf("\n%d", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x5,%eax
jle    1172 <main+0x62>
mov    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,-0x8(%rbp)
jge    115e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1167 <main+0x57>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
br label %3
3: ; preds = %18, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 5
br i1 %6, label %7, label %20
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %2
br label %18
15: ; preds = %10
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
br label %18
18: ; preds = %15, %13
%19 = phi i32 [ %14, %13 ], [ %17, %15 ]
store i32 %19, i32* %2
br label %3
20: ; preds = %3
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ bsd_syscall_sendto(int, char *, size_t, int, char *,
                                      int /*<<< orphan*/);
ssize_t uptcp_sendto(int s, const void *buf, size_t len, int flags,
                     const struct sockaddr *to, socklen_t tolen) {
  return bsd_syscall_sendto(s, (char *)buf, len, flags, (char *)to, tolen);
}


x86 assembly (clang, -O0):
<uptcp_sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <bsd_syscall_sendto@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptcp_sendto>:
jmp    1030 <bsd_syscall_sendto@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @uptcp_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32, i32* %10
%17 = load %struct.sockaddr*, %struct.sockaddr** %11
%18 = bitcast %struct.sockaddr* %17 to i8*
%19 = load i32, i32* %12
%20 = call i32 @bsd_syscall_sendto(i32 %13, i8* %14, i64 %15, i32 %16, i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @uptcp_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = bitcast %struct.sockaddr* %4 to i8*
%8 = tail call i32 @bsd_syscall_sendto(i32 %0, i8* %1, i64 %2, i32 %3, i8* %7, i32 %5)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int get_lock_index(int mem_index) {
  return ((mem_index * sizeof(uint32_t)) / (4096 * 1));
}


x86 assembly (clang, -O0):
<get_lock_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
shr    $0xc,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lock_index>:
mov    %edi,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @get_lock_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 4
%6 = udiv i64 %5, 4096
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_lock_index(i32 %0) {
%2 = ashr i32 %0, 10
ret i32 %2
}
int ChkOptionalArcCtxLen(unsigned long len) {
  return len != (259) && len != 0 ? (0) : (1);
}


x86 assembly (clang, -O0):
<ChkOptionalArcCtxLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x103,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1126 <ChkOptionalArcCtxLen+0x26>
cmpq   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkOptionalArcCtxLen>:
cmp    $0x103,%rdi
sete   %al
test   %rdi,%rdi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ChkOptionalArcCtxLen(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 259
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 0
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @ChkOptionalArcCtxLen(i64 %0) {
%2 = icmp eq i64 %0, 259
%3 = icmp eq i64 %0, 0
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void motion_test9(int *data) {
  int i = 0;
  int j = data[0];
loop:
  if (i >= data[2])
    return;
  data[i] = 21 * j + i;
  i++;
  goto loop;
}


x86 assembly (clang, -O0):
<motion_test9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%eax
jl     112a <motion_test9+0x2a>
pop    %rbp
ret
imul   $0x15,-0x10(%rbp),%edx
add    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <motion_test9+0x18>

x86 assembly (clang, -O2):
<motion_test9>:
cmpl   $0x0,0x8(%rdi)
jle    1123 <motion_test9+0x23>
mov    (%rdi),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%eax
xor    %ecx,%ecx
lea    (%rax,%rcx,1),%edx
mov    %edx,(%rdi,%rcx,4)
add    $0x1,%rcx
movslq 0x8(%rdi),%rdx
cmp    %rdx,%rcx
jl     1110 <motion_test9+0x10>
ret

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

LLVM IR (-O2):
define void @motion_test9(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %0
%7 = mul nsw i32 %6, 21
br label %9
8: ; preds = %9, %1
ret void
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %14, %9 ]
%11 = trunc i64 %10 to i32
%12 = add nsw i32 %7, %11
%13 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 %12, i32* %13
%14 = add nuw nsw i64 %10, 1
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %14, %16
br i1 %17, label %9, label %8
}
/* Variables and functions */
int do_u_strncase_equal(char const *, char const *, size_t, int);
int u_strncase_equal_base(const char *a, const char *b, size_t len) {
  return do_u_strncase_equal(a, b, len, 1);
}


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

x86 assembly (clang, -O2):
<u_strncase_equal_base>:
mov    $0x1,%ecx
jmp    1030 <do_u_strncase_equal@plt>

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

LLVM IR (-O2):
define i32 @u_strncase_equal_base(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @do_u_strncase_equal(i8* %0, i8* %1, i64 %2, i32 1)
ret i32 %4
}
void OPA_read_barrier(void) {
  int a = 0;
  __asm__ __volatile__("lock orl $0, %0" : "+m"(a));
}


x86 assembly (clang, -O0):
<OPA_read_barrier>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lock orl $0x0,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPA_read_barrier>:
movl   $0x0,-0x4(%rsp)
lock orl $0x0,-0x4(%rsp)
ret

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

LLVM IR (-O2):
define void @OPA_read_barrier() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
ret void
}
int MAIN__(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MAIN__() {
ret i32 0
}
void pci_disable_ats(struct pci_dev *d) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_disable_ats(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ avpriv_atomic_lock();
int /*<<< orphan*/ avpriv_atomic_unlock();
intptr_t atomic_load(intptr_t *object) {
  intptr_t ret;
  avpriv_atomic_lock();
  ret = *object;
  avpriv_atomic_unlock();
  return ret;
}


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

x86 assembly (clang, -O2):
<atomic_load>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <avpriv_atomic_lock@plt>
mov    (%rbx),%rbx
xor    %eax,%eax
call   1040 <avpriv_atomic_unlock@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @atomic_load(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = call i32 (...) @avpriv_atomic_lock()
%5 = load i64*, i64** %2
%6 = load i64, i64* %5
store i64 %6, i64* %3
%7 = call i32 (...) @avpriv_atomic_unlock()
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @atomic_load(i64* nocapture %0) {
%2 = tail call i32 (...) @avpriv_atomic_lock()
%3 = load i64, i64* %0
%4 = tail call i32 (...) @avpriv_atomic_unlock()
ret i64 %3
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getdtime(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)t.tv_sec + (double)t.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<getdtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @getdtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @getdtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int getrand();
unsigned getrnum(void) { return ((getrand()) >> (getrand() % 17)); }


x86 assembly (clang, -O0):
<getrnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getrand@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getrand@plt>
mov    $0x11,%ecx
cltd
idiv   %ecx
mov    -0x4(%rbp),%eax
mov    %edx,%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrnum>:
push   %rbx
xor    %eax,%eax
call   1030 <getrand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getrand@plt>
movslq %eax,%rcx
imul   $0x78787879,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x23,%rax
add    %edx,%eax
mov    %eax,%edx
shl    $0x4,%edx
add    %eax,%edx
sub    %edx,%ecx
sar    %cl,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getrnum() {
%1 = call i32 (...) @getrand()
%2 = call i32 (...) @getrand()
%3 = srem i32 %2, 17
%4 = ashr i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @getrnum() {
%1 = tail call i32 (...) @getrand()
%2 = tail call i32 (...) @getrand()
%3 = srem i32 %2, 17
%4 = ashr i32 %1, %3
ret i32 %4
}
/* Variables and functions */
double acos(int);
int glmComputeVectorLength3d(double const *);
int glmDotProduct3d(double const *, double const *);
double glmComputeVectorAngle3dRad(const double v1[3], const double v2[3]) {
  return acos(glmDotProduct3d(v1, v2) /
              (glmComputeVectorLength3d(v1) * glmComputeVectorLength3d(v2)));
}


x86 assembly (clang, -O0):
<glmComputeVectorAngle3dRad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <glmDotProduct3d@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <glmComputeVectorLength3d@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <glmComputeVectorLength3d@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <acos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeVectorAngle3dRad>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <glmDotProduct3d@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <glmComputeVectorLength3d@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <glmComputeVectorLength3d@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <acos@plt>

LLVM IR (-O0):
define double @glmComputeVectorAngle3dRad(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @glmDotProduct3d(double* %5, double* %6)
%8 = load double*, double** %3
%9 = call i32 @glmComputeVectorLength3d(double* %8)
%10 = load double*, double** %4
%11 = call i32 @glmComputeVectorLength3d(double* %10)
%12 = mul nsw i32 %9, %11
%13 = sdiv i32 %7, %12
%14 = call double @acos(i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @glmComputeVectorAngle3dRad(double* %0, double* %1) {
%3 = tail call i32 @glmDotProduct3d(double* %0, double* %1)
%4 = tail call i32 @glmComputeVectorLength3d(double* %0)
%5 = tail call i32 @glmComputeVectorLength3d(double* %1)
%6 = mul nsw i32 %5, %4
%7 = sdiv i32 %3, %6
%8 = tail call double @acos(i32 %7)
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
off_t lseek(int fd, off_t offset, int whence) {
  return (fseek((FILE *)fd, offset, whence));
}


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

x86 assembly (clang, -O2):
<lseek>:
movslq %edi,%rdi
jmp    1030 <fseek@plt>

LLVM IR (-O0):
define i32 @lseek(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 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @fseek(i32* %9, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @fseek(i32* %5, i32 %1, i32 %2)
ret i32 %6
}
int GetRFromRGB(const int nRGB) { return nRGB & 0x000000FF; }


x86 assembly (clang, -O0):
<GetRFromRGB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRFromRGB>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @GetRFromRGB(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
void handle_EMT(sig) int sig;
{}


x86 assembly (clang, -O0):
<handle_EMT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @handle_EMT(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ done(int);
void onintr(int x) {
  done(1);
  x = x;
}


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

x86 assembly (clang, -O2):
<onintr>:
mov    $0x1,%edi
jmp    1030 <done@plt>

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

LLVM IR (-O2):
define void @onintr(i32 %0) {
%2 = tail call i32 @done(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  float result = (a + b + c) / 3.0;
  printf("%.1f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
add    0x14(%rsp),%eax
add    0xc(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xea9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 3.000000e+00
%14 = fptrunc double %13 to float
store float %14, float* %5
%15 = load float, float* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = sitofp i32 %12 to double
%14 = fdiv double %13, 3.000000e+00
%15 = fptrunc double %14 to float
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_copyright(void) {
  printf("Welcome to toke - FCode tokenizer v"
         "1.0.3"
         "\n"
         "(C) Copyright 2001-2010 Stefan Reinauer.\n"
         "(C) Copyright 2006 coresystems GmbH"
         "\n"
         "(C) Copyright 2005 IBM Corporation.  All Rights Reserved."
         "\n"
         "This program is free software; you may redistribute it "
         "under the terms of\nthe GNU General Public License v2. "
         "This program has absolutely no warranty.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [328 x i8] c"Welcome to toke - FCode tokenizer v1.0.3\0A(C) Copyright 2001-2010 Stefan Reinauer.\0A(C) Copyright 2006 coresystems GmbH\0A(C) Copyright 2005 IBM Corporation. All Rights Reserved.\0AThis program is free software; you may redistribute it under the terms of\0Athe GNU General Public License v2. This program has absolutely no warranty.\0A\0A\00"
define void @print_copyright() {
%1 = call i32 @printf(i8* getelementptr inbounds ([328 x i8], [328 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [327 x i8] c"Welcome to toke - FCode tokenizer v1.0.3\0A(C) Copyright 2001-2010 Stefan Reinauer.\0A(C) Copyright 2006 coresystems GmbH\0A(C) Copyright 2005 IBM Corporation. All Rights Reserved.\0AThis program is free software; you may redistribute it under the terms of\0Athe GNU General Public License v2. This program has absolutely no warranty.\0A\00"
define void @print_copyright() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([327 x i8], [327 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ setupSignalHandlers();
int main(int argc, char *argv[]) {
  setupSignalHandlers();
  foo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @setupSignalHandlers()
%4 = tail call i32 (...) @foo()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void __psh_seek_back(FILE *file) {
  while (fgetc(file) != '\n') {
    fseek(file, -2, SEEK_CUR);
  }
}


x86 assembly (clang, -O0):
<__psh_seek_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     115d <__psh_seek_back+0x3d>
mov    -0x8(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    $0xfffffffe,%esi
call   1040 <fseek@plt>
jmp    112c <__psh_seek_back+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__psh_seek_back>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
cmp    $0xa,%al
je     115c <__psh_seek_back+0x3c>
mov    0x2eb1(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0xfffffffe,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1140 <__psh_seek_back+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define void @__psh_seek_back(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %8, %1
%4 = load i32*, i32** %2
%5 = call signext i8 @fgetc(i32* %4)
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_CUR
%11 = call i32 @fseek(i32* %9, i32 -2, i32 %10)
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define void @__psh_seek_back(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = icmp eq i8 %2, 10
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = load i32, i32* @SEEK_CUR
%6 = tail call i32 @fseek(i32* %0, i32 -2, i32 %5)
%7 = tail call signext i8 @fgetc(i32* %0)
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
main() {
  const __typeof("hi") str = "yo";
  typedef __typeof(1) volatile *pone;
  int i;
  pone p = &i;
  printf("%s\n", str);
  *p = 2;
  assert(i == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x3(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x2(%rsp)
movw   $0x6f79,(%rsp)
mov    %rsp,%rdi
call   1030 <puts@plt>
movl   $0x2,0x4(%rsp)
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.str = [3 x i8] c"yo\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 @puts(i8* %3)
store volatile i32 2, i32* %2
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Type definitions */
struct DHCPSingleOption {
  int dummy;
};

/* Variables and functions */
size_t DHCP_ptrdiff(struct DHCPSingleOption const *a,
                    struct DHCPSingleOption const *b) {
  return ((uintptr_t)(a)) - ((uintptr_t)(b));
}


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

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

LLVM IR (-O0):
%struct.DHCPSingleOption = type { i32 }
define i64 @DHCP_ptrdiff(%struct.DHCPSingleOption* %0, %struct.DHCPSingleOption* %1) {
%3 = alloca %struct.DHCPSingleOption*
%4 = alloca %struct.DHCPSingleOption*
store %struct.DHCPSingleOption* %0, %struct.DHCPSingleOption** %3
store %struct.DHCPSingleOption* %1, %struct.DHCPSingleOption** %4
%5 = load %struct.DHCPSingleOption*, %struct.DHCPSingleOption** %3
%6 = ptrtoint %struct.DHCPSingleOption* %5 to i64
%7 = load %struct.DHCPSingleOption*, %struct.DHCPSingleOption** %4
%8 = ptrtoint %struct.DHCPSingleOption* %7 to i64
%9 = sub i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.DHCPSingleOption = type { i32 }
define i64 @DHCP_ptrdiff(%struct.DHCPSingleOption* %0, %struct.DHCPSingleOption* %1) {
%3 = ptrtoint %struct.DHCPSingleOption* %0 to i64
%4 = ptrtoint %struct.DHCPSingleOption* %1 to i64
%5 = sub i64 %3, %4
ret i64 %5
}
/* Variables and functions */
bool nrf52_errata_101(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_101() {
ret i32 0
}
void foo560() {}


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

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

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

LLVM IR (-O2):
define void @foo560() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setcursor(int, int);
void j_setcursor(int arg0, int arg1) { japi_setcursor(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_setcursor>:
jmp    1030 <japi_setcursor@plt>

LLVM IR (-O0):
define void @j_setcursor(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 @japi_setcursor(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_setcursor(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setcursor(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x67() {
  Assert_real((ispunct(103) == 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",
              520, ("ispunct should be 0 for g"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x67>:
push   %rax
mov    $0x67,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x208,%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 = [26 x i8] c"ispunct should be 0 for g\00"
define void @t_ispunct_0x67() {
%1 = call i64 @ispunct(i32 103)
%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 520, 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for g\00"
define void @t_ispunct_0x67() {
%1 = tail call i64 @ispunct(i32 103)
%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 520, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int _EndianSwapInt(int val) {
  val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
  return (val << 16) | ((val >> 16) & 0xFFFF);
}


x86 assembly (clang, -O0):
<_EndianSwapInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EndianSwapInt>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @_EndianSwapInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, -16711936
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 16711935
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = shl i32 %10, 16
%12 = load i32, i32* %2
%13 = ashr i32 %12, 16
%14 = and i32 %13, 65535
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @_EndianSwapInt(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void __attribute__((weak)) lcd_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<lcd_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.lcd_isr = [8 x i8] c"lcd_isr\00"
define weak void @lcd_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.lcd_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.lcd_isr = [8 x i8] c"lcd_isr\00"
define weak void @lcd_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.lcd_isr, i64 0, i64 0))
ret void
}
/* Type definitions */
struct i40e_ring {
  int dummy;
};

/* Variables and functions */
int I40E_DESC_UNUSED(struct i40e_ring *);
int __i40e_maybe_stop_tx(struct i40e_ring *, int);
scalar_t__ likely(int);
int i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size) {
  if (likely(I40E_DESC_UNUSED(tx_ring) >= size))
    return 0;
  return __i40e_maybe_stop_tx(tx_ring, size);
}


x86 assembly (clang, -O0):
<i40e_maybe_stop_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <I40E_DESC_UNUSED@plt>
cmp    -0x14(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <likely@plt>
cmp    $0x0,%rax
je     116e <i40e_maybe_stop_tx+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    117d <i40e_maybe_stop_tx+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <__i40e_maybe_stop_tx@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i40e_maybe_stop_tx>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <I40E_DESC_UNUSED@plt>
xor    %edi,%edi
cmp    %ebp,%eax
setge  %dil
call   1040 <likely@plt>
test   %rax,%rax
je     1158 <i40e_maybe_stop_tx+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <__i40e_maybe_stop_tx@plt>

LLVM IR (-O0):
%struct.i40e_ring = type { i32 }
define i32 @i40e_maybe_stop_tx(%struct.i40e_ring* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.i40e_ring*
%5 = alloca i32
store %struct.i40e_ring* %0, %struct.i40e_ring** %4
store i32 %1, i32* %5
%6 = load %struct.i40e_ring*, %struct.i40e_ring** %4
%7 = call i32 @I40E_DESC_UNUSED(%struct.i40e_ring* %6)
%8 = load i32, i32* %5
%9 = icmp sge i32 %7, %8
%10 = zext i1 %9 to i32
%11 = call i64 @likely(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %18
14: ; preds = %2
%15 = load %struct.i40e_ring*, %struct.i40e_ring** %4
%16 = load i32, i32* %5
%17 = call i32 @__i40e_maybe_stop_tx(%struct.i40e_ring* %15, i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %13
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.i40e_ring = type { i32 }
define i32 @i40e_maybe_stop_tx(%struct.i40e_ring* %0, i32 %1) {
%3 = tail call i32 @I40E_DESC_UNUSED(%struct.i40e_ring* %0)
%4 = icmp sge i32 %3, %1
%5 = zext i1 %4 to i32
%6 = tail call i64 @likely(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @__i40e_maybe_stop_tx(%struct.i40e_ring* %0, i32 %1)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ]
ret i32 %11
}
int s_typeissem(struct stat *p) { return 0; }


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @s_typeissem(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @s_typeissem(%struct.stat* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgldgb(char *s) { sgen("%s\tal,%s", "mov", s); }


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

x86 assembly (clang, -O2):
<cgldgb>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <sgen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s\09al,%s\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldgb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sgen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s\09al,%s\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldgb(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int bin_count(int n) {
  int counter = 0;
  while (n--) {
    counter++;
    n >>= 1;
  }
  return counter;
}


x86 assembly (clang, -O0):
<bin_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1139 <bin_count+0x39>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bin_count+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_count>:
xor    %eax,%eax
test   %edi,%edi
je     1121 <bin_count+0x21>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffff,%edi
add    $0x1,%eax
mov    %edi,%ecx
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bin_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @bin_count(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = add nuw nsw i32 %4, 1
%8 = ashr i32 %6, 1
%9 = icmp ult i32 %6, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int write(int, char *, int);
void send_over_socket(int sockfd, char user_input[1024], int size) {
  int numbytes;
  numbytes = write(sockfd, user_input, size);
  if (numbytes < 0)
    perror("send");
}


x86 assembly (clang, -O0):
<send_over_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115a <send_over_socket+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_over_socket>:
push   %rax
call   1030 <write@plt>
test   %eax,%eax
js     112c <send_over_socket+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"send\00"
define void @send_over_socket(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"send\00"
define void @send_over_socket(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ feed_sig(char);
void do_sighup(int signo) { feed_sig('H'); }


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

x86 assembly (clang, -O2):
<do_sighup>:
mov    $0x48,%edi
jmp    1030 <feed_sig@plt>

LLVM IR (-O0):
define void @do_sighup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @feed_sig(i8 signext 72)
ret void
}

LLVM IR (-O2):
define void @do_sighup(i32 %0) {
%2 = tail call i32 @feed_sig(i8 signext 72)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  printf("hello atomic world\n%d\n%d\n", 0, 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [26 x i8] c"hello atomic world\0A%d\0A%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
uint32_t ntohl(uint32_t n) { return htonl(n); }


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

x86 assembly (clang, -O2):
<ntohl>:
jmp    1030 <htonl@plt>

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

LLVM IR (-O2):
define i32 @ntohl(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ os_taskProcessing();
void osRun() {
  while (1) {
    os_taskProcessing();
  }
}


x86 assembly (clang, -O0):
<osRun>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <osRun+0x9>
mov    $0x0,%al
call   1030 <os_taskProcessing@plt>
jmp    1119 <osRun+0x9>

x86 assembly (clang, -O2):
<osRun>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <os_taskProcessing@plt>
jmp    1120 <osRun+0x10>

LLVM IR (-O0):
define void @osRun() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @os_taskProcessing()
br label %1
}

LLVM IR (-O2):
define void @osRun() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @os_taskProcessing()
br label %1
}