xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void safe_zero_memory(void *pointer, size_t number, size_t sizeOfElement) {
  memset(pointer, 0, number * sizeOfElement);
}


x86 assembly (clang, -O0):
<safe_zero_memory>:
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),%rdx
imul   -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_zero_memory>:
imul   %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @safe_zero_memory(i8* %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i32 @memset(i8* %0, i32 0, i64 %4)
ret void
}
int vrt_rdev_lock_sectors(struct vrt_realdev *rdev, unsigned long start,
                          unsigned long end) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.vrt_realdev = type opaque
define i32 @vrt_rdev_lock_sectors(%struct.vrt_realdev* %0, i64 %1, i64 %2) {
%4 = alloca %struct.vrt_realdev*
%5 = alloca i64
%6 = alloca i64
store %struct.vrt_realdev* %0, %struct.vrt_realdev** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
%struct.vrt_realdev = type opaque
define i32 @vrt_rdev_lock_sectors(%struct.vrt_realdev* nocapture readnone %0, i64 %1, i64 %2) {
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_current_time(void) {
  struct timeval tv;
  double t;
  gettimeofday(&tv, NULL);
  t = (double)tv.tv_sec;
  t += (double)tv.tv_usec / 1.0e6;
  return t;
}


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

x86 assembly (clang, -O2):
<get_current_time>:
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 @get_current_time() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
store double %6, double* %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = load double, double* %2
%12 = fadd double %11, %10
store double %12, double* %2
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @get_current_time() {
%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 /*<<< orphan*/ register_dips_function_list();
void dips_init() { register_dips_function_list(); }


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

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

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

LLVM IR (-O2):
define void @dips_init() {
%1 = tail call i32 (...) @register_dips_function_list()
ret void
}
int CAbs(int x) {
  if (x < 0)
    return (0 - x);
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @CAbs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void updateCount(int *val, int *count) {
  if ((*val > 2) && (*val < 7)) {
    *count += 1;
  } else if (*val == 10) {
    *count -= 1;
  }
}


x86 assembly (clang, -O0):
<updateCount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x2,(%rax)
jle    1136 <updateCount+0x36>
mov    -0x8(%rbp),%rax
cmpl   $0x7,(%rax)
jge    1136 <updateCount+0x36>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1153 <updateCount+0x53>
mov    -0x8(%rbp),%rax
cmpl   $0xa,(%rax)
jne    114e <updateCount+0x4e>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1153 <updateCount+0x53>
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateCount>:
mov    (%rdi),%ecx
lea    -0x3(%rcx),%edx
mov    $0x1,%eax
cmp    $0x4,%edx
jb     1119 <updateCount+0x19>
mov    $0xffffffff,%eax
cmp    $0xa,%ecx
jne    111b <updateCount+0x1b>
add    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @updateCount(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* %5
%7 = icmp sgt i32 %6, 2
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, 7
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
br label %25
16: ; preds = %8, %2
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 10
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i32*, i32** %4
%22 = load i32, i32* %21
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %21
br label %24
24: ; preds = %20, %16
br label %25
25: ; preds = %24, %12
ret void
}

LLVM IR (-O2):
define void @updateCount(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, -3
%5 = icmp ult i32 %4, 4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = icmp eq i32 %3, 10
br i1 %7, label %8, label %12
8: ; preds = %6, %2
%9 = phi i32 [ 1, %2 ], [ -1, %6 ]
%10 = load i32, i32* %1
%11 = add nsw i32 %10, %9
store i32 %11, i32* %1
br label %12
12: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
void syscall_halt(void) { _syscall(0x001, 0, 0, 0); }


x86 assembly (clang, -O0):
<syscall_halt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <_syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_halt>:
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <_syscall@plt>

LLVM IR (-O0):
define void @syscall_halt() {
%1 = call i32 @_syscall(i32 1, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @syscall_halt() {
%1 = tail call i32 @_syscall(i32 1, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pair_p_stuff();
int /*<<< orphan*/ pair_stuff();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ secondone();
int /*<<< orphan*/ vcl_stuff();
int main() {
  printf("Hello from subdirectory\n");
  secondone();
  pair_stuff();
  pair_p_stuff();
  vcl_stuff();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <secondone@plt>
mov    $0x0,%al
call   1030 <pair_stuff@plt>
mov    $0x0,%al
call   1070 <pair_p_stuff@plt>
mov    $0x0,%al
call   1050 <vcl_stuff@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <secondone@plt>
xor    %eax,%eax
call   1040 <pair_stuff@plt>
xor    %eax,%eax
call   1070 <pair_p_stuff@plt>
xor    %eax,%eax
call   1050 <vcl_stuff@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Hello from subdirectory\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @secondone()
%4 = call i32 (...) @pair_stuff()
%5 = call i32 (...) @pair_p_stuff()
%6 = call i32 (...) @vcl_stuff()
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Hello from subdirectory\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @secondone()
%3 = tail call i32 (...) @pair_stuff()
%4 = tail call i32 (...) @pair_p_stuff()
%5 = tail call i32 (...) @vcl_stuff()
ret i32 0
}
unsigned int _hrt_align_up_p2(unsigned int a, unsigned int b) {
  return (a + b - 1) & -b;
}


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

x86 assembly (clang, -O2):
<_hrt_align_up_p2>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
neg    %esi
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @_hrt_align_up_p2(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 = add i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %4
%10 = sub i32 0, %9
%11 = and i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_hrt_align_up_p2(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %4, %5
ret i32 %6
}
unsigned int hweight16(unsigned short w) {
  unsigned short res = (w & 0x5555) + ((w >> 1) & 0x5555);
  res = (res & 0x3333) + ((res >> 2) & 0x3333);
  res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F);
  return (res & 0x00FF) + ((res >> 8) & 0x00FF);
}


x86 assembly (clang, -O0):
<hweight16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x5555,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x1,%ecx
and    $0x5555,%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0x3333,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x3333,%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xf0f,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf0f,%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight16>:
mov    %edi,%eax
mov    %edi,%ecx
and    $0x5555,%ecx
shr    %eax
and    $0x5555,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x3333,%ecx
shr    $0x2,%eax
and    $0x3333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x707,%ecx
shr    $0x4,%eax
and    $0x707,%eax
add    %ecx,%eax
movzbl %al,%ecx
movzbl %ah,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hweight16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = and i32 %5, 21845
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 1
%10 = and i32 %9, 21845
%11 = add nsw i32 %6, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %3
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = and i32 %14, 13107
%16 = load i16, i16* %3
%17 = zext i16 %16 to i32
%18 = ashr i32 %17, 2
%19 = and i32 %18, 13107
%20 = add nsw i32 %15, %19
%21 = trunc i32 %20 to i16
store i16 %21, i16* %3
%22 = load i16, i16* %3
%23 = zext i16 %22 to i32
%24 = and i32 %23, 3855
%25 = load i16, i16* %3
%26 = zext i16 %25 to i32
%27 = ashr i32 %26, 4
%28 = and i32 %27, 3855
%29 = add nsw i32 %24, %28
%30 = trunc i32 %29 to i16
store i16 %30, i16* %3
%31 = load i16, i16* %3
%32 = zext i16 %31 to i32
%33 = and i32 %32, 255
%34 = load i16, i16* %3
%35 = zext i16 %34 to i32
%36 = ashr i32 %35, 8
%37 = and i32 %36, 255
%38 = add nsw i32 %33, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @hweight16(i16 zeroext %0) {
%2 = and i16 %0, 21845
%3 = lshr i16 %0, 1
%4 = and i16 %3, 21845
%5 = add nuw i16 %4, %2
%6 = and i16 %5, 13107
%7 = lshr i16 %5, 2
%8 = and i16 %7, 13107
%9 = add nuw nsw i16 %8, %6
%10 = and i16 %9, 1799
%11 = lshr i16 %9, 4
%12 = and i16 %11, 1799
%13 = add nuw nsw i16 %12, %10
%14 = zext i16 %13 to i32
%15 = and i32 %14, 15
%16 = lshr i32 %14, 8
%17 = add nuw nsw i32 %15, %16
ret i32 %17
}
int get_mins(int hour, int min) { return (hour * 60) + min; }


x86 assembly (clang, -O0):
<get_mins>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mins>:
imul   $0x3c,%edi,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_mins(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 60
%4 = add nsw i32 %3, %1
ret i32 %4
}
void USART1_IRQHandler() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @fa_network_close() {
ret void
}
/* Type definitions */
struct buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bufput(struct buf *, char *, int);
int man_linebreak(struct buf *ob, void *opaque) {
  bufput(ob, ".br", sizeof ".br" - 1);
  return 1;
}


x86 assembly (clang, -O0):
<man_linebreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x3,%edx
call   1030 <bufput@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<man_linebreak>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3,%edx
call   1030 <bufput@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.buf = type { i32 }
@.str = [4 x i8] c".br\00"
define i32 @man_linebreak(%struct.buf* %0, i8* %1) {
%3 = alloca %struct.buf*
%4 = alloca i8*
store %struct.buf* %0, %struct.buf** %3
store i8* %1, i8** %4
%5 = load %struct.buf*, %struct.buf** %3
%6 = call i32 @bufput(%struct.buf* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 1
}

LLVM IR (-O2):
%struct.buf = type { i32 }
@.str = [4 x i8] c".br\00"
define i32 @man_linebreak(%struct.buf* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @bufput(%struct.buf* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x34() {
  Assert_real((isspace(52) == 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_isspace.c",
              265, ("isspace should be 0 for 4"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x34>:
push   %rax
mov    $0x34,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x109,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for 4\00"
define void @t_isspace_0x34() {
%1 = call i64 @isspace(i32 52)
%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 265, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for 4\00"
define void @t_isspace_0x34() {
%1 = tail call i64 @isspace(i32 52)
%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 265, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage:\tarpy\t-d <networking device>\n\t\t-t <target IP> -T <target "
         "MAC>\n\t\t-r <router IP> -R <router MAC>\n");
}


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

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

LLVM IR (-O0):
@.str = [102 x i8] c"Usage:\09arpy\09-d <networking device>\0A\09\09-t <target IP> -T <target MAC>\0A\09\09-r <router IP> -R <router MAC>\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [101 x i8] c"Usage:\09arpy\09-d <networking device>\0A\09\09-t <target IP> -T <target MAC>\0A\09\09-r <router IP> -R <router MAC>\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
void millisleep(int millisecs) {
  clock_t beg;
  beg = clock();
  while ((1000. * (clock() - beg)) / CLOCKS_PER_SEC < millisecs)
    continue;
}


x86 assembly (clang, -O0):
<millisleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm0,%xmm1
mov    0x2ea2(%rip),%rax
cvtsi2sdl (%rax),%xmm0
divsd  %xmm0,%xmm1
cvtsi2sdl -0x4(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1162 <millisleep+0x52>
jmp    1125 <millisleep+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millisleep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ebx
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,(%rsp)
mov    0x2eba(%rip),%rbp
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <clock@plt>
sub    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x0(%rbp),%xmm1
mulsd  0xeb0(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     1130 <millisleep+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @millisleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @clock()
store i32 %4, i32* %3
br label %5
5: ; preds = %17, %1
%6 = call i32 (...) @clock()
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fmul double 1.000000e+03, %9
%11 = load i32, i32* @CLOCKS_PER_SEC
%12 = sitofp i32 %11 to double
%13 = fdiv double %10, %12
%14 = load i32, i32* %2
%15 = sitofp i32 %14 to double
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %5
br label %5
18: ; preds = %5
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @millisleep(i32 %0) {
%2 = tail call i32 (...) @clock()
%3 = sitofp i32 %0 to double
br label %4
4: ; preds = %4, %1
%5 = tail call i32 (...) @clock()
%6 = sub nsw i32 %5, %2
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 1.000000e+03
%9 = load i32, i32* @CLOCKS_PER_SEC
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = fcmp olt double %11, %3
br i1 %12, label %4, label %13
13: ; preds = %4
ret void
}
/* Variables and functions */
unsigned int alarm(unsigned int);
int test(void) {
  unsigned int seconds;
  unsigned int result;
  seconds = 10;
  result = alarm(seconds);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alarm@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    $0xa,%edi
jmp    1030 <alarm@plt>

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @alarm(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @alarm(i32 10)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void foo(void) { usleep(100); }


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x64,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @usleep(i32 100)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @usleep(i32 100)
ret void
}
isalpha(c) char c;
{
  if ((c >= 'a' & c <= 'z') | (c >= 'A' & c <= 'Z'))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0x7a,%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0x41,%ecx
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
movsbl -0x5(%rbp),%edx
cmp    $0x5a,%edx
setle  %dl
and    $0x1,%dl
movzbl %dl,%edx
and    %edx,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     1164 <isalpha+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <isalpha+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
shl    $0x18,%edi
add    $0xbfffffff,%edi
xor    %eax,%eax
cmp    $0x1affffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
%8 = zext i1 %7 to i32
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
%12 = zext i1 %11 to i32
%13 = and i32 %8, %12
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 65
%17 = zext i1 %16 to i32
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 90
%21 = zext i1 %20 to i32
%22 = and i32 %17, %21
%23 = or i32 %13, %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %1
store i32 1, i32* %2
br label %27
26: ; preds = %1
store i32 0, i32* %2
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = shl i32 %0, 24
%3 = and i32 %2, -553648128
%4 = add i32 %3, -1073741825
%5 = icmp ult i32 %4, 452984831
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int atoi(char const *);
char *om_sysfs_get(char *);
int om_screen_brightness_get_max() {
  const char *res = om_sysfs_get("max_brightness");
  if (res == NULL)
    return -1;
  return atoi(res);
}


x86 assembly (clang, -O0):
<om_screen_brightness_get_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <om_sysfs_get@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <om_screen_brightness_get_max+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <om_screen_brightness_get_max+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_screen_brightness_get_max>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <om_sysfs_get@plt>
test   %rax,%rax
je     113b <om_screen_brightness_get_max+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"max_brightness\00"
define i32 @om_screen_brightness_get_max() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @om_sysfs_get(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %10
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"max_brightness\00"
define i32 @om_screen_brightness_get_max() {
%1 = tail call i8* @om_sysfs_get(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @atoi(i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
int ext2_test_bit(void *addr, unsigned int i) {
  unsigned char *v = addr;
  v += i >> 3;
  return (*v & (1 << (7 - (i % 8)))) != 0;
}


x86 assembly (clang, -O0):
<ext2_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    -0xc(%rbp),%edx
and    $0x7,%edx
mov    $0x7,%ecx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2_test_bit>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%eax
not    %cl
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ext2_test_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
%9 = load i8*, i8** %5
%10 = zext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = load i32, i32* %4
%16 = urem i32 %15, 8
%17 = sub i32 7, %16
%18 = shl i32 1, %17
%19 = and i32 %14, %18
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @ext2_test_bit(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = xor i32 %8, 7
%10 = lshr i32 %7, %9
%11 = and i32 %10, 1
ret i32 %11
}
int sign_bitwise(int v) { return v >> (sizeof(int) * 8 - 1); }


x86 assembly (clang, -O0):
<sign_bitwise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sign_bitwise(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}
int trapp(int a, int b) {
  int c;
  c = (a + b) / 2;
  return c;
}


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

x86 assembly (clang, -O2):
<trapp>:
lea    (%rdi,%rsi,1),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @trapp(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xfd() {
  Assert_real((isspace(253) == 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_isspace.c",
              1270, ("isspace should be 0 for 0xfd"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xfd>:
push   %rax
mov    $0xfd,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4f6,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xfd\00"
define void @t_isspace_0xfd() {
%1 = call i64 @isspace(i32 253)
%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 1270, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xfd\00"
define void @t_isspace_0xfd() {
%1 = tail call i64 @isspace(i32 253)
%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 1270, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int send(int, char *, long, int);
int apr_send(int sock, const void *buf, long size, int mode) {
  return send(sock, (char *)buf, size, mode);
}


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

x86 assembly (clang, -O2):
<apr_send>:
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @apr_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 %3)
ret i32 %5
}
int count(int n) {
  int c;
  c = 0;
  while (c < n)
    c = c + 1;
  return c;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <count+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <count+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @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* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @count(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
ret i32 %2
}
int fun(int n) {
  int sum = 0, i;
  if (n < 4)
    return 1;
  for (i = 1; i <= n; i++) {
    if (i < 4)
      sum = 1;
    else
      sum = sum + fun(n - i + 1);
  }
  return sum;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1138 <fun+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1198 <fun+0x88>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1192 <fun+0x82>
cmpl   $0x4,-0x10(%rbp)
jge    1161 <fun+0x51>
movl   $0x1,-0xc(%rbp)
jmp    117f <fun+0x6f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x10(%rbp),%edi
add    $0x1,%edi
call   1030 <fun@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1184 <fun+0x74>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <fun+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x4,%edi
jl     113e <fun+0x2e>
mov    %edi,%ebx
add    $0xfffffffd,%ebx
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <fun@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
jne    1130 <fun+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = add nuw i32 %0, 1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 4, %3 ], [ %11, %5 ]
%7 = phi i32 [ 1, %3 ], [ %10, %5 ]
%8 = sub i32 %4, %6
%9 = tail call i32 @fun(i32 %8)
%10 = add nsw i32 %9, %7
%11 = add nuw i32 %6, 1
%12 = icmp eq i32 %6, %0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 1, %1 ], [ %10, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M300_f(char *s) {
  debug("M300_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M300_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M300_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M300_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M300_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void handle_51(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_51(i32 %0) {
ret void
}
__attribute__((no, noclone)) unsigned __int128 t151_2add(unsigned __int128 y) {
  unsigned __int128 x = (-1);
  unsigned __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t151_2add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0xffffffffffffffff,-0x38(%rbp)
ff
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
add    %rsi,%rdx
adc    %rax,%rcx
setb   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t151_2add+0x5e>
jmp    1175 <t151_2add+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t151_2add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
adc    $0xffffffffffffffff,%r14
jae    112b <t151_2add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t151_2add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 -1, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t151_2add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %6, i128 -1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
void XtIsTransientShell() {}


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

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

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

LLVM IR (-O2):
define void @XtIsTransientShell() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(unsigned char *, char *, int *);
unsigned char tp_hextoint(unsigned char byte1, unsigned char byte2) {
  unsigned char bytes[3];
  int result;
  bytes[0] = byte1;
  bytes[1] = byte2;
  bytes[2] = '\0';
  sscanf(bytes, "%x", &result);
  return result;
}


x86 assembly (clang, -O0):
<tp_hextoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x4(%rbp)
movb   $0x0,-0x3(%rbp)
lea    -0x5(%rbp),%rdi
lea    0xec1(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_hextoint>:
push   %rax
mov    %dil,0x1(%rsp)
mov    %sil,0x2(%rsp)
movb   $0x0,0x3(%rsp)
lea    0xed9(%rip),%rsi
lea    0x1(%rsp),%rdi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define zeroext i8 @tp_hextoint(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca [3 x i8]
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i8, i8* %4
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 0, i8* %11
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%13 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%14 = load i32, i32* %6
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define zeroext i8 @tp_hextoint(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca [3 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
store i8 %0, i8* %5
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %1, i8* %7
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %8
%9 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
ret i8 %11
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int write_doubles_to_defined_output_file(int n, double *a) {
  int i, *b, fail;
  fail = _ada_use_c2phc(160, &n, b, a);
  return fail;
}


x86 assembly (clang, -O0):
<write_doubles_to_defined_output_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0xa0,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_doubles_to_defined_output_file>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xa0,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_doubles_to_defined_output_file(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%8 = load i32*, i32** %6
%9 = load double*, double** %4
%10 = call i32 @_ada_use_c2phc(i32 160, i32* %3, i32* %8, double* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
define i32 @write_doubles_to_defined_output_file(i32 %0, double* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 160, i32* %3, i32* undef, double* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f1(int init) {
  static int a;
  a = (init == 0) ? ++a : init;
  printf("\n%d,", a);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113c <f1+0x2c>
mov    0x2f01(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef8(%rip)
mov    %eax,-0x8(%rbp)
jmp    1142 <f1+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,0x2ee1(%rip)
mov    0x2edb(%rip),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    0x2f16(%rip),%esi
add    $0x1,%esi
test   %edi,%edi
cmovne %edi,%esi
mov    %esi,0x2f08(%rip)
lea    0xed5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@f1.a = internal global i32 0
@.str = [5 x i8] c"\0A%d,\00"
define void @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @f1.a
%7 = add nsw i32 %6, 1
store i32 %7, i32* @f1.a
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
store i32 %11, i32* @f1.a
%12 = load i32, i32* @f1.a
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@f1.a = internal unnamed_addr global i32 0
@.str = [5 x i8] c"\0A%d,\00"
define void @f1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @f1.a
%4 = add nsw i32 %3, 1
%5 = select i1 %2, i32 %4, i32 %0
store i32 %5, i32* @f1.a
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}