xunge/DecIR huggingface dataset:
/* Variables and functions */
int CHAR_BIT;
unsigned int rightrot(unsigned int x, unsigned int n) {
  return (unsigned int)((x >> n) |
                        ((~(~0 << n) & x) << (sizeof(int) * CHAR_BIT - n)));
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
and    -0x4(%rbp),%edx
mov    0x2eb7(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
mov    -0x8(%rbp),%esi
sub    %rsi,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
mov    %esi,%ecx
mov    %edi,%esi
shr    %cl,%esi
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
mov    0x2ec8(%rip),%rdx
mov    (%rdx),%edx
shl    $0x2,%edx
sub    %ecx,%edx
mov    %edx,%ecx
shl    %cl,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @rightrot(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 = lshr i32 %5, %6
%8 = load i32, i32* %4
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %3
%12 = and i32 %10, %11
%13 = load i32, i32* @CHAR_BIT
%14 = sext i32 %13 to i64
%15 = mul i64 4, %14
%16 = load i32, i32* %4
%17 = zext i32 %16 to i64
%18 = sub i64 %15, %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %12, %19
%21 = or i32 %7, %20
ret i32 %21
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @rightrot(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = shl nsw i32 -1, %1
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
%7 = load i32, i32* @CHAR_BIT
%8 = shl i32 %7, 2
%9 = sub i32 %8, %1
%10 = shl i32 %6, %9
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void abrt(int i) {
  printf("abrt(%d)\n", i);
  exit(1);
}


x86 assembly (clang, -O0):
<abrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<abrt>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"abrt(%d)\0A\00"
define void @abrt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"abrt(%d)\0A\00"
define void @abrt(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
double diameter(double radius) { return 2 * radius; }


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

x86 assembly (clang, -O2):
<diameter>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @diameter(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 2.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @diameter(double %0) {
%2 = fmul double %0, 2.000000e+00
ret double %2
}
float foo(float x, float y) {
  volatile int i = 0;
  return i >= 0 ? x : y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
jl     1130 <foo+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    113a <foo+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jns    1112 <foo+0x12>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @foo(float %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp sgt i32 %5, -1
%7 = select i1 %6, float %0, float %1
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_33() {
  Assert_real((isqrt(33) == 5),
              "/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/stdlib/isqrt.c",
              170, ("Integer square root of 33 should be 5"));
}


x86 assembly (clang, -O0):
<t_sqrt_33>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
call   1030 <isqrt@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xaa,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_33>:
push   %rax
mov    $0x21,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xaa,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 33 should be 5\00"
define void @t_sqrt_33() {
%1 = call i32 @isqrt(i32 33)
%2 = icmp eq i32 %1, 5
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 33 should be 5\00"
define void @t_sqrt_33() {
%1 = tail call i32 @isqrt(i32 33)
%2 = icmp eq i32 %1, 5
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double give_a_nan(double x) { return (float)1.0 / 0.0; }


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

x86 assembly (clang, -O2):
<give_a_nan>:
movsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @give_a_nan(double %0) {
ret double 0x7FF0000000000000
}
float interp_linear(float v0, float v1, float v2, float v3, float t) {
  return v1 + (v2 - v1) * t;
}


x86 assembly (clang, -O0):
<interp_linear>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp_linear>:
movaps %xmm2,%xmm0
subss  %xmm1,%xmm0
mulss  %xmm4,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @interp_linear(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %7
%12 = load float, float* %8
%13 = load float, float* %7
%14 = fsub float %12, %13
%15 = load float, float* %10
%16 = call float @llvm.fmuladd.f32(float %14, float %15, float %11)
ret float %16
}

LLVM IR (-O2):
define float @interp_linear(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %2, %1
%7 = tail call float @llvm.fmuladd.f32(float %6, float %4, float %1)
ret float %7
}
int test_imm_06int16_mem(short *val) {
  return ((*val) & (0x06 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_06int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_06int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 6
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void vpx_usec_timer_start(struct vpx_usec_timer *t) {}


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

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

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

LLVM IR (-O2):
%struct.vpx_usec_timer = type opaque
define void @vpx_usec_timer_start(%struct.vpx_usec_timer* nocapture %0) {
ret void
}
void ff_hevc_put_hevc_bi_pel_pixels64_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels64_8_avx2() {
ret void
}
/* Variables and functions */
size_t strcspn(char const *, char const *);
size_t htx_strcspn(const char *s, const char *reject) {
  return strcspn(s, reject);
}


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

x86 assembly (clang, -O2):
<htx_strcspn>:
jmp    1030 <strcspn@plt>

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

LLVM IR (-O2):
define i64 @htx_strcspn(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcspn(i8* %0, i8* %1)
ret i64 %3
}
int long_double_int_overflow(long double ld) { return ld; }


x86 assembly (clang, -O0):
<long_double_int_overflow>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x16(%rbp)
movzwl -0x16(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x18(%rbp)
fldcw  -0x18(%rbp)
fistpl -0x14(%rbp)
fldcw  -0x16(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_double_int_overflow>:
fldt   0x8(%rsp)
fnstcw -0x8(%rsp)
movzwl -0x8(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x6(%rsp)
fldcw  -0x6(%rsp)
fistpl -0x4(%rsp)
fldcw  -0x8(%rsp)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @long_double_int_overflow(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptosi x86_fp80 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @long_double_int_overflow(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i32
ret i32 %2
}
int HTTPWrapperSSLClose(int s) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @HTTPWrapperSSLClose(i32 %0) {
ret i32 -1
}
int get_absolute_num(int i, int j, int k, int N, int M) {
  return 1 + k * (N * M) * (N * M) + j * (N * M) + i;
}


x86 assembly (clang, -O0):
<get_absolute_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
imul   %ecx,%eax
add    $0x1,%eax
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%edx
imul   -0x14(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_absolute_num>:
imul   %r8d,%ecx
imul   %ecx,%edx
add    %esi,%edx
imul   %ecx,%edx
lea    (%rdi,%rdx,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_absolute_num(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %8
%12 = load i32, i32* %9
%13 = load i32, i32* %10
%14 = mul nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = mul nsw i32 %16, %17
%19 = mul nsw i32 %15, %18
%20 = add nsw i32 1, %19
%21 = load i32, i32* %7
%22 = load i32, i32* %9
%23 = load i32, i32* %10
%24 = mul nsw i32 %22, %23
%25 = mul nsw i32 %21, %24
%26 = add nsw i32 %20, %25
%27 = load i32, i32* %6
%28 = add nsw i32 %26, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @get_absolute_num(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul nsw i32 %4, %3
%7 = mul i32 %6, %2
%8 = add i32 %7, %1
%9 = mul i32 %8, %6
%10 = add i32 %0, 1
%11 = add i32 %10, %9
ret i32 %11
}
int main() {
  int x;
  int y;
  ({
    x = 1;
    x;
  });
  assert(x == 1);
  x = ({
    y = 1;
    2;
  });
  assert(x == 2);
  assert(y == 1);
  int a = ({
    int b = (long int)&a;
    b;
  });
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
lea    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%9 = load i32, i32* %2
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %13)
store i32 1, i32* %3
store i32 2, i32* %5
%15 = load i32, i32* %5
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 2
%18 = zext i1 %17 to i32
%19 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %18)
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 1
%22 = zext i1 %21 to i32
%23 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %22)
%24 = ptrtoint i32* %6 to i64
%25 = trunc i64 %24 to i32
store i32 %25, i32* %7
%26 = load i32, i32* %7
store i32 %26, i32* %8
%27 = load i32, i32* %8
store i32 %27, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
int test_imm_09uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x09 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_09uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 589824
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ system(char *);
double get_wager_amount(void) {
  double wager = 0.0;
  printf("What do you want to wager? ");
  scanf(" %lf", &wager);
  system("cls");
  return wager;
}


x86 assembly (clang, -O0):
<get_wager_amount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1030 <system@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_wager_amount>:
push   %rax
movq   $0x0,(%rsp)
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
lea    0xec6(%rip),%rdi
call   1030 <system@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"What do you want to wager? \00"
@.str.1 = [5 x i8] c" %lf\00"
@.str.2 = [4 x i8] c"cls\00"
define double @get_wager_amount() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = load double, double* %1
ret double %5
}

LLVM IR (-O2):
@.str = [28 x i8] c"What do you want to wager? \00"
@.str.1 = [5 x i8] c" %lf\00"
@.str.2 = [4 x i8] c"cls\00"
define double @get_wager_amount() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = load double, double* %1
ret double %6
}
char *skip(char *s, char c) {
  while (*s != c && *s != '\0')
    ++s;
  if (*s != '\0')
    *s++ = '\0';
  return s;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xa(%rbp)
je     1136 <skip+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1146 <skip+0x46>
jmp    1157 <skip+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <skip+0xe>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1179 <skip+0x79>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
cmp    %sil,%cl
je     1120 <skip+0x20>
test   %cl,%cl
jne    1110 <skip+0x10>
lea    -0x1(%rax),%rdx
test   %cl,%cl
je     112c <skip+0x2c>
movb   $0x0,(%rdx)
ret
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i8* @skip(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
br label %5
5: ; preds = %19, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br label %17
17: ; preds = %12, %5
%18 = phi i1 [ false, %5 ], [ %16, %12 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %5
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
store i8 0, i8* %28
br label %30
30: ; preds = %27, %22
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @skip(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
%7 = icmp eq i8 %5, 0
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
br i1 %7, label %12, label %11
11: ; preds = %10
store i8 0, i8* %4
br label %12
12: ; preds = %11, %10
%13 = phi i8* [ %9, %11 ], [ %4, %10 ]
ret i8* %13
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
void cvmx_dvprintf(const char *format, va_list ap) {}


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

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

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

LLVM IR (-O2):
define void @cvmx_dvprintf(i8* nocapture %0, i32 %1) {
ret void
}
int security_inode_listxattr(struct dentry *dentry) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @security_inode_listxattr(%struct.dentry* nocapture readnone %0) {
ret i32 0
}
int foo(int x) { return x * 4; }


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

x86 assembly (clang, -O2):
<foo>:
lea    0x0(,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ basicDrive(int, int);
void driveNoStall(int leftPower, int rightPower, int stallPower) {
  if (abs(leftPower) <= stallPower)
    leftPower = 0;
  if (abs(rightPower) <= stallPower)
    rightPower = 0;
  basicDrive(leftPower, rightPower);
}


x86 assembly (clang, -O0):
<driveNoStall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
cmp    -0xc(%rbp),%eax
jg     1149 <driveNoStall+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
cmp    -0xc(%rbp),%eax
jg     1161 <driveNoStall+0x41>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <basicDrive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<driveNoStall>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
xor    %ecx,%ecx
cmp    %edx,%eax
cmovle %ecx,%edi
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
cmp    %edx,%eax
cmovle %ecx,%esi
jmp    1030 <basicDrive@plt>

LLVM IR (-O0):
define void @driveNoStall(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 = call i32 @abs(i32 %7)
%9 = load i32, i32* %6
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %12
12: ; preds = %11, %3
%13 = load i32, i32* %5
%14 = call i32 @abs(i32 %13)
%15 = load i32, i32* %6
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %5
br label %18
18: ; preds = %17, %12
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i32 @basicDrive(i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
define void @driveNoStall(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%5 = icmp sgt i32 %4, %2
%6 = select i1 %5, i32 %0, i32 0
%7 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%8 = icmp sgt i32 %7, %2
%9 = select i1 %8, i32 %1, i32 0
%10 = tail call i32 @basicDrive(i32 %6, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_191() {
  Assert_real((isqrt(191) == 13),
              "/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/stdlib/isqrt.c",
              960, ("Integer square root of 191 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_191>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3c0,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_191>:
push   %rax
mov    $0xbf,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3c0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 191 should be 13\00"
define void @t_sqrt_191() {
%1 = call i32 @isqrt(i32 191)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 960, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 191 should be 13\00"
define void @t_sqrt_191() {
%1 = tail call i32 @isqrt(i32 191)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 960, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int keyScan_nobloca();
char keyScan() {
  char c;
  do
    c = keyScan_nobloca();
  while (c == 0x80);
  while (keyScan_nobloca() != 0x80)
    ;
  return c;
}


x86 assembly (clang, -O0):
<keyScan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <keyScan_nobloca@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x80,%eax
je     1118 <keyScan+0x8>
jmp    1136 <keyScan+0x26>
mov    $0x0,%al
call   1030 <keyScan_nobloca@plt>
cmp    $0x80,%eax
je     114d <keyScan+0x3d>
jmp    1136 <keyScan+0x26>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyScan>:
push   %rbx
xor    %eax,%eax
call   1030 <keyScan_nobloca@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <keyScan_nobloca@plt>
cmp    $0x80,%eax
jne    1120 <keyScan+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @keyScan() {
%1 = alloca i8
br label %2
2: ; preds = %5, %0
%3 = call i32 (...) @keyScan_nobloca()
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
br label %5
5: ; preds = %2
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 128
br i1 %8, label %2, label %9
9: ; preds = %5
br label %10
10: ; preds = %13, %9
%11 = call i32 (...) @keyScan_nobloca()
%12 = icmp ne i32 %11, 128
br i1 %12, label %13, label %14
13: ; preds = %10
br label %10
14: ; preds = %10
%15 = load i8, i8* %1
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @keyScan() {
%1 = tail call i32 (...) @keyScan_nobloca()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @keyScan_nobloca()
%4 = icmp eq i32 %3, 128
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = trunc i32 %1 to i8
ret i8 %6
}
/* Variables and functions */
void *malloc(size_t);
void *ntfs_alloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<ntfs_alloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @ntfs_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void RTAvlrUIntPtrInsert(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrUIntPtrInsert() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int logger_get_mtime(const char *filename, time_t *m_time) {
  struct stat sb;
  if (stat(filename, &sb)) {
    return 1;
  }
  *m_time = sb.st_mtime;
  return 0;
}


x86 assembly (clang, -O0):
<logger_get_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     1143 <logger_get_mtime+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1153 <logger_get_mtime+0x43>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_get_mtime>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1137 <logger_get_mtime+0x27>
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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

/* Variables and functions */
int parse_stockholm_alignment(int /*<<< orphan*/ *, char ***, char ***, char **,
                              char **, int);
int parse_aln_stockholm(FILE *fp, char ***names, char ***aln, char **id,
                        char **structure, int verbosity) {
  return parse_stockholm_alignment(fp, names, aln, id, structure, verbosity);
}


x86 assembly (clang, -O0):
<parse_aln_stockholm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <parse_stockholm_alignment@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_aln_stockholm>:
jmp    1030 <parse_stockholm_alignment@plt>

LLVM IR (-O0):
define i32 @parse_aln_stockholm(i32* %0, i8*** %1, i8*** %2, i8** %3, i8** %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i8***
%9 = alloca i8***
%10 = alloca i8**
%11 = alloca i8**
%12 = alloca i32
store i32* %0, i32** %7
store i8*** %1, i8**** %8
store i8*** %2, i8**** %9
store i8** %3, i8*** %10
store i8** %4, i8*** %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i8***, i8**** %8
%15 = load i8***, i8**** %9
%16 = load i8**, i8*** %10
%17 = load i8**, i8*** %11
%18 = load i32, i32* %12
%19 = call i32 @parse_stockholm_alignment(i32* %13, i8*** %14, i8*** %15, i8** %16, i8** %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @parse_aln_stockholm(i32* %0, i8*** %1, i8*** %2, i8** %3, i8** %4, i32 %5) {
%7 = tail call i32 @parse_stockholm_alignment(i32* %0, i8*** %1, i8*** %2, i8** %3, i8** %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xd4() {
  Assert_real((ispunct(212) == 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",
              1065, ("ispunct should be 0 for 0xd4"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xd4\00"
define void @t_ispunct_0xd4() {
%1 = call i64 @ispunct(i32 212)
%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 1065, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xd4\00"
define void @t_ispunct_0xd4() {
%1 = tail call i64 @ispunct(i32 212)
%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 1065, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_genes(char genes[16], int len) {
  for (int i = 0; i < len; ++i) {
    printf("%2i:", genes[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_genes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <print_genes+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_genes+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_genes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <print_genes+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_genes+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%2i:\00"
define void @print_genes(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Variables and functions */
long square_of_sum(int);
long sum_of_squares(int);
long difference_of_squares(int n) {
  return square_of_sum(n) - sum_of_squares(n);
}


x86 assembly (clang, -O0):
<difference_of_squares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <square_of_sum@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sum_of_squares@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<difference_of_squares>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <square_of_sum@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1040 <sum_of_squares@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @difference_of_squares(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @square_of_sum(i32 %3)
%5 = load i32, i32* %2
%6 = call i64 @sum_of_squares(i32 %5)
%7 = sub nsw i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @difference_of_squares(i32 %0) {
%2 = tail call i64 @square_of_sum(i32 %0)
%3 = tail call i64 @sum_of_squares(i32 %0)
%4 = sub nsw i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ spnav_close();
void fgSpaceballClose(void) { spnav_close(); }


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

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

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

LLVM IR (-O2):
define void @fgSpaceballClose() {
%1 = tail call i32 (...) @spnav_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getsym();
int /*<<< orphan*/ readfactor();
void get_() {
  getsym();
  readfactor();
}


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

x86 assembly (clang, -O2):
<get_>:
push   %rax
xor    %eax,%eax
call   1040 <getsym@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <readfactor@plt>

LLVM IR (-O0):
define void @get_() {
%1 = call i32 (...) @getsym()
%2 = call i32 (...) @readfactor()
ret void
}

LLVM IR (-O2):
define void @get_() {
%1 = tail call i32 (...) @getsym()
%2 = tail call i32 (...) @readfactor()
ret void
}
/* Variables and functions */
scalar_t__ my_is_prime(int);
int my_find_prime_sup(int nb) {
  int i;
  for (i = 0; my_is_prime(nb + i) == 0; i++)
    ;
  return (nb + i);
}


x86 assembly (clang, -O0):
<my_find_prime_sup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
call   1030 <my_is_prime@plt>
cmp    $0x0,%rax
jne    114a <my_find_prime_sup+0x3a>
jmp    113c <my_find_prime_sup+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <my_find_prime_sup+0x12>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_find_prime_sup>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <my_is_prime@plt>
add    $0x1,%ebx
test   %rax,%rax
je     1120 <my_find_prime_sup+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @my_find_prime_sup(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %7, %2 ]
%4 = add nsw i32 %3, %0
%5 = tail call i64 @my_is_prime(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = add nuw nsw i32 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i32 %4
}
int chealpix_nside2order(int nside) {
  int index = nside;
  int targetlevel = 0;
  while (index >>= 1)
    ++targetlevel;
  return targetlevel;
}


x86 assembly (clang, -O0):
<chealpix_nside2order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1134 <chealpix_nside2order+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <chealpix_nside2order+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chealpix_nside2order>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <chealpix_nside2order+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <chealpix_nside2order+0x10>
ret

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

LLVM IR (-O2):
define i32 @chealpix_nside2order(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void engine_set_result(const char *result) {}


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

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

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

LLVM IR (-O2):
define void @engine_set_result(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int __ocml_signbit_f64(double);
int __signbit(double x) { return __ocml_signbit_f64(x); }


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

x86 assembly (clang, -O2):
<__signbit>:
jmp    1030 <__ocml_signbit_f64@plt>

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

LLVM IR (-O2):
define i32 @__signbit(double %0) {
%2 = tail call i32 @__ocml_signbit_f64(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void user_delete(const void *key, void **value, const void *other) {
  free(*value);
}


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

x86 assembly (clang, -O2):
<user_delete>:
mov    (%rsi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @user_delete(i8* nocapture readnone %0, i8** nocapture %1, i8* nocapture readnone %2) {
%4 = load i8*, i8** %1
%5 = tail call i32 @free(i8* %4)
ret void
}
void register_handlers() { ; }


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

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

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

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