xunge/DecIR huggingface dataset:
/* Type definitions */
struct mntent {
  int /*<<< orphan*/ mnt_opts;
};

/* Variables and functions */
char *strstr(int /*<<< orphan*/, char const *);
char *hasmntopt(const struct mntent *mnt, const char *opt) {
  return strstr(mnt->mnt_opts, opt);
}


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

x86 assembly (clang, -O2):
<hasmntopt>:
mov    (%rdi),%edi
jmp    1030 <strstr@plt>

LLVM IR (-O0):
%struct.mntent = type { i32 }
define i8* @hasmntopt(%struct.mntent* %0, i8* %1) {
%3 = alloca %struct.mntent*
%4 = alloca i8*
store %struct.mntent* %0, %struct.mntent** %3
store i8* %1, i8** %4
%5 = load %struct.mntent*, %struct.mntent** %3
%6 = getelementptr inbounds %struct.mntent, %struct.mntent* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = call i8* @strstr(i32 %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.mntent = type { i32 }
define i8* @hasmntopt(%struct.mntent* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.mntent, %struct.mntent* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i8* @strstr(i32 %4, i8* %1)
ret i8* %5
}
/* Variables and functions */
double atof(char *);
char *opts_gets(char const);
double opts_getf(const char opt) {
  char *str = opts_gets(opt);
  return (str ? atof(str) : 0.0);
}


x86 assembly (clang, -O0):
<opts_getf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <opts_gets@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1159 <opts_getf+0x39>
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    1166 <opts_getf+0x46>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1166 <opts_getf+0x46>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opts_getf>:
push   %rax
call   1040 <opts_gets@plt>
test   %rax,%rax
je     1134 <opts_getf+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atof@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @opts_getf(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i8* @opts_gets(i8 signext %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call double @atof(i8* %9)
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %8
%13 = phi double [ %10, %8 ], [ 0.000000e+00, %11 ]
ret double %13
}

LLVM IR (-O2):
define double @opts_getf(i8 signext %0) {
%2 = tail call i8* @opts_gets(i8 signext %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call double @atof(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi double [ %5, %4 ], [ 0.000000e+00, %1 ]
ret double %7
}
/* Variables and functions */
int error(int, char *);
int /*<<< orphan*/ executecmd(char *, char **);
int b_exec(int argc, char *argv[]) {
  if (argc < 2)
    return error(0, argv[0]);
  executecmd(argv[1], argv + 1);
  return error(4, argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<b_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114f <b_exec+0x2f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
xor    %edi,%edi
call   1040 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1179 <b_exec+0x59>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <executecmd@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x4,%edi
call   1040 <error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_exec>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%eax
xor    %edi,%edi
cmp    $0x2,%eax
jl     1142 <b_exec+0x22>
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
mov    %rbx,%rsi
call   1030 <executecmd@plt>
mov    $0x4,%edi
mov    (%rbx),%rsi
pop    %rbx
jmp    1040 <error@plt>

LLVM IR (-O0):
define i32 @b_exec(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @error(i32 0, i8* %11)
store i32 %12, i32* %3
br label %24
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = call i32 @executecmd(i8* %16, i8** %18)
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @error(i32 4, i8* %22)
store i32 %23, i32* %3
br label %24
24: ; preds = %13, %8
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @b_exec(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @executecmd(i8* %6, i8** %5)
br label %8
8: ; preds = %2, %4
%9 = phi i8** [ %5, %4 ], [ %1, %2 ]
%10 = phi i32 [ 4, %4 ], [ 0, %2 ]
%11 = load i8*, i8** %9
%12 = tail call i32 @error(i32 %10, i8* %11)
ret i32 %12
}
int test_imm_CBint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xCB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CBint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 203
%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_CBint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13303808
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct ss_encryptor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ss_encryptor *);
void ss_release_encryptor(struct ss_encryptor *encryptor) { free(encryptor); }


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

x86 assembly (clang, -O2):
<ss_release_encryptor>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ss_encryptor = type { i32 }
define void @ss_release_encryptor(%struct.ss_encryptor* nocapture %0) {
%2 = tail call i32 @free(%struct.ss_encryptor* %0)
ret void
}
double delay_from_dm(double dm, double freq_emitted) {
  return dm / (0.000241 * freq_emitted * freq_emitted);
}


x86 assembly (clang, -O0):
<delay_from_dm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_from_dm>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @delay_from_dm(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double 2.410000e-04, %6
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = fdiv double %5, %9
ret double %10
}

LLVM IR (-O2):
define double @delay_from_dm(double %0, double %1) {
%3 = fmul double %1, 2.410000e-04
%4 = fmul double %3, %1
%5 = fdiv double %0, %4
ret double %5
}
void ps() { asm volatile("int $0x30" ::"a"(9)); }


x86 assembly (clang, -O0):
<ps>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%eax
int    $0x30
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps>:
mov    $0x9,%eax
int    $0x30
ret

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

LLVM IR (-O2):
define void @ps() {
tail call void asm sideeffect "int $$0x30", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash32_hsieh(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
uint32_t strhashf(const char **a) { return hash32_hsieh(*a, strlen(*a)); }


x86 assembly (clang, -O0):
<strhashf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <hash32_hsieh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhashf>:
push   %rbx
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <hash32_hsieh@plt>

LLVM IR (-O0):
define i32 @strhashf(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @hash32_hsieh(i8* %4, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @strhashf(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @strlen(i8* %2)
%4 = tail call i32 @hash32_hsieh(i8* %2, i32 %3)
ret i32 %4
}
void f(unsigned char *p, short s, int c, int *z) {
  if (c)
    *z = 0;
  *p ^= (unsigned char)s;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     112a <f+0x2a>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0xa(%rbp),%ax
movzbl %al,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edx,%edx
je     110a <f+0xa>
movl   $0x0,(%rcx)
xor    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @f(i8* %0, i16 signext %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i16 %1, i16* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %8
store i32 0, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i16, i16* %6
%15 = trunc i16 %14 to i8
%16 = zext i8 %15 to i32
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = xor i32 %19, %16
%21 = trunc i32 %20 to i8
store i8 %21, i8* %17
ret void
}

LLVM IR (-O2):
define void @f(i8* nocapture %0, i16 signext %1, i32 %2, i32* nocapture writeonly %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 0, i32* %3
br label %7
7: ; preds = %6, %4
%8 = trunc i16 %1 to i8
%9 = load i8, i8* %0
%10 = xor i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configurePropPatch();
int /*<<< orphan*/ enterPropCpeHdPatch();
void refreshPropPatch(void) {
  enterPropCpeHdPatch();
  configurePropPatch();
}


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

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

LLVM IR (-O0):
define void @refreshPropPatch() {
%1 = call i32 (...) @enterPropCpeHdPatch()
%2 = call i32 (...) @configurePropPatch()
ret void
}

LLVM IR (-O2):
define void @refreshPropPatch() {
%1 = tail call i32 (...) @enterPropCpeHdPatch()
%2 = tail call i32 (...) @configurePropPatch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lmrexp_(double *, double *, int *);
void clmrexp(double *para, double *xmom, int nmom) {
  lmrexp_(para, xmom, &nmom);
}


x86 assembly (clang, -O0):
<clmrexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <lmrexp_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clmrexp>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <lmrexp_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @clmrexp(double* %0, double* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @lmrexp_(double* %0, double* %1, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Vec3_init(void) {
  _hmt_register_covercase("HMM_Vec3", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_Vec3_init>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"HMM_Vec3\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Vec3_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_Vec3\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Vec3_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
enum { Anon3_member1 } function() { return Anon3_member1; }


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

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

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

LLVM IR (-O2):
define i32 @function() {
ret i32 0
}
void genmfhi() {}


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

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

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

LLVM IR (-O2):
define void @genmfhi() {
ret void
}
int es_primo(int x) {
  int b = 1;
  int c;
  for (c = 2; c < x && b == 1; c += 2) {
    if (x % c == 0)
      b = 0;
  }
  return b;
}


x86 assembly (clang, -O0):
<es_primo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    1130 <es_primo+0x30>
cmpl   $0x1,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <es_primo+0x40>
jmp    116a <es_primo+0x6a>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1157 <es_primo+0x57>
movl   $0x0,-0x8(%rbp)
jmp    115c <es_primo+0x5c>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <es_primo+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_primo>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     112c <es_primo+0x2c>
mov    $0x4,%ecx
nop
lea    -0x2(%rcx),%esi
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1125 <es_primo+0x25>
lea    0x2(%rcx),%eax
cmp    %edi,%ecx
mov    %eax,%ecx
jl     1110 <es_primo+0x10>
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

LLVM IR (-O0):
define i32 @es_primo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 1
br label %12
12: ; preds = %9, %5
%13 = phi i1 [ false, %5 ], [ %11, %9 ]
br i1 %13, label %14, label %24
14: ; preds = %12
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %20
20: ; preds = %19, %14
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 2
store i32 %23, i32* %4
br label %5
24: ; preds = %12
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @es_primo(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp ne i32 %5, 0
%7 = add nuw nsw i32 %4, 2
%8 = icmp slt i32 %7, %0
%9 = and i1 %6, %8
br i1 %9, label %3, label %10
10: ; preds = %3
%11 = zext i1 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 1, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x0f() {
  Assert_real((isalpha(15) == 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_isalpha.c",
              80, ("isalpha should be 0 for 0x0f"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x0f>:
push   %rax
mov    $0xf,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x50,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x0f\00"
define void @t_isalpha_0x0f() {
%1 = call i64 @isalpha(i32 15)
%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 80, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x0f\00"
define void @t_isalpha_0x0f() {
%1 = tail call i64 @isalpha(i32 15)
%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 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int foo(int b) {
  int a = (b > 1) ? 1 : 2;
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x2,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmovg  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
cmp    $0x2,%edi
setge  %cl
mov    $0x2,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = select i1 %2, i32 1, i32 2
ret i32 %3
}
void init_mem_comm() {}


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ tcomplain();
void tdefault_disconnect(struct target_ops *self, const char *arg1, int arg2) {
  tcomplain();
}


x86 assembly (clang, -O0):
<tdefault_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <tcomplain@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.target_ops = type { i32 }
define void @tdefault_disconnect(%struct.target_ops* %0, i8* %1, i32 %2) {
%4 = alloca %struct.target_ops*
%5 = alloca i8*
%6 = alloca i32
store %struct.target_ops* %0, %struct.target_ops** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (...) @tcomplain()
ret void
}

LLVM IR (-O2):
%struct.target_ops = type { i32 }
define void @tdefault_disconnect(%struct.target_ops* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (...) @tcomplain()
ret void
}
void swapp(int *a, int *b) {
  int t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<swapp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swapp(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swapp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void Int24_To_Int8_Dither(
    void *destinationBuffer, signed int destinationStride, void *sourceBuffer,
    signed int sourceStride, unsigned int count,
    struct PaUtilTriangularDitherGenerator *ditherGenerator) {
  (void)destinationBuffer;
  (void)destinationStride;
  (void)sourceBuffer;
  (void)sourceStride;
  (void)count;
  (void)ditherGenerator;
}


x86 assembly (clang, -O0):
<Int24_To_Int8_Dither>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.PaUtilTriangularDitherGenerator = type opaque
define void @Int24_To_Int8_Dither(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, %struct.PaUtilTriangularDitherGenerator* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.PaUtilTriangularDitherGenerator*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store %struct.PaUtilTriangularDitherGenerator* %5, %struct.PaUtilTriangularDitherGenerator** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load %struct.PaUtilTriangularDitherGenerator*, %struct.PaUtilTriangularDitherGenerator** %12
ret void
}

LLVM IR (-O2):
%struct.PaUtilTriangularDitherGenerator = type opaque
define void @Int24_To_Int8_Dither(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3, i32 %4, %struct.PaUtilTriangularDitherGenerator* nocapture %5) {
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quickSortSeq(int *arr, int left, int right) {
  int mid;
  if (left < right) {
    mid = partition(arr, left, right);
    quickSortSeq(arr, left, mid - 1);
    quickSortSeq(arr, mid + 1, right);
  }
}


x86 assembly (clang, -O0):
<quickSortSeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSortSeq+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSortSeq@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSortSeq@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSortSeq>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSortSeq+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSortSeq@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSortSeq+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSortSeq(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSortSeq(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int spi_n(int, int *, int *, int);
int spi(int fd, uint8_t tx) {
  uint8_t rx;
  int ret;
  if ((ret = spi_n(fd, &tx, &rx, 1)) < 0)
    return ret;
  return 0xff & rx;
}


x86 assembly (clang, -O0):
<spi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <spi_n@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    114a <spi+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <spi+0x45>
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x1,%ecx
call   1030 <spi_n@plt>
test   %eax,%eax
movzbl (%rsp),%ecx
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @spi(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %1, i32* %3
%5 = bitcast i32* %4 to i8*
%6 = call i32 @spi_n(i32 %0, i32* %3, i32* %4, i32 1)
%7 = icmp slt i32 %6, 0
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = select i1 %7, i32 %6, i32 %9
ret i32 %10
}
int kl_str_match_len(const char *s1, const char *s2) {
  int r = 0;
  while (s1[r] == s2[r] && s1[r]) {
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<kl_str_match_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rdx
movsbl (%rax,%rdx,1),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
jne    114d <kl_str_match_len+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    115d <kl_str_match_len+0x5d>
jmp    116b <kl_str_match_len+0x6b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <kl_str_match_len+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kl_str_match_len>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
test   %dl,%dl
je     1124 <kl_str_match_len+0x24>
cmp    (%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <kl_str_match_len+0x10>
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @kl_str_match_len(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %12, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %6, %8
%10 = icmp eq i8 %6, 0
%11 = or i1 %10, %9
%12 = add nuw i64 %4, 1
br i1 %11, label %13, label %3
13: ; preds = %3
%14 = trunc i64 %4 to i32
ret i32 %14
}
int test_imm_64int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x64 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_64int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 100
%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_64int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 429496729600
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int INT_MIN;
int test3(int x) { return x - INT_MIN; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @INT_MIN
%5 = sub nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test3(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = sub nsw i32 %0, %2
ret i32 %3
}
void XSyncValueLow32() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ub_dentry_alloc_end() {
ret void
}
/* Variables and functions */
int getch();
int getKey() { return getch(); }


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

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

LLVM IR (-O0):
define i32 @getKey() {
%1 = call i32 (...) @getch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getKey() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
double f(double x, double y) { return (x * y + x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double %5, double %6, double %7)
ret double %8
}

LLVM IR (-O2):
define double @f(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %0)
ret double %3
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ u_int;
struct TYPE_3__ {
  scalar_t__ x_private;
};
typedef TYPE_1__ XDR;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ftell(int /*<<< orphan*/ *);
u_int xdrstdio_getpos(XDR *xdrs) {
  return ((u_int)ftell((FILE *)xdrs->x_private));
}


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

x86 assembly (clang, -O2):
<xdrstdio_getpos>:
mov    (%rdi),%rdi
jmp    1030 <ftell@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i32 @xdrstdio_getpos(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i32*
%7 = call i64 @ftell(i32* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define i32 @xdrstdio_getpos(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = tail call i64 @ftell(i32* %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int bbm_long_write(void *, unsigned short, unsigned int);
int bbm_com_long_write(void *handle, unsigned short addr, unsigned int data) {
  int res;
  res = bbm_long_write(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_long_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x10(%rbp),%edx
movzwl %ax,%esi
call   1030 <bbm_long_write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_long_write>:
jmp    1030 <bbm_long_write@plt>

LLVM IR (-O0):
define i32 @bbm_com_long_write(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i16, i16* %5
%10 = load i32, i32* %6
%11 = call i32 @bbm_long_write(i8* %8, i16 zeroext %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @bbm_com_long_write(i8* %0, i16 zeroext %1, i32 %2) {
%4 = tail call i32 @bbm_long_write(i8* %0, i16 zeroext %1, i32 %2)
ret i32 %4
}
struct tree_node_t *_avl_del(struct tree_t *bst, struct tree_node_t **parent,
                             struct tree_node_t **node, void *data, int depth) {
}


x86 assembly (clang, -O0):
<_avl_del>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tree_node_t = type opaque
%struct.tree_t = type opaque
define %struct.tree_node_t* @_avl_del(%struct.tree_t* %0, %struct.tree_node_t** %1, %struct.tree_node_t** %2, i8* %3, i32 %4) {
%6 = alloca %struct.tree_node_t*
%7 = alloca %struct.tree_t*
%8 = alloca %struct.tree_node_t**
%9 = alloca %struct.tree_node_t**
%10 = alloca i8*
%11 = alloca i32
store %struct.tree_t* %0, %struct.tree_t** %7
store %struct.tree_node_t** %1, %struct.tree_node_t*** %8
store %struct.tree_node_t** %2, %struct.tree_node_t*** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
%12 = load %struct.tree_node_t*, %struct.tree_node_t** %6
ret %struct.tree_node_t* %12
}

LLVM IR (-O2):
%struct.tree_node_t = type opaque
%struct.tree_t = type opaque
define noalias %struct.tree_node_t* @_avl_del(%struct.tree_t* nocapture readnone %0, %struct.tree_node_t** nocapture readnone %1, %struct.tree_node_t** nocapture readnone %2, i8* nocapture readnone %3, i32 %4) {
ret %struct.tree_node_t* undef
}
int SoundStateNull(struct SoundDriverNull *object) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.SoundDriverNull = type opaque
define i32 @SoundStateNull(%struct.SoundDriverNull* nocapture readnone %0) {
ret i32 0
}
void copia(void) {
  int i;
  extern char linea[], linea_max[];
  i = 0;
  while (i >= 0) {
    linea_max[i] = linea[i];
    if (linea_max[i++] == '\0')
      i = -1;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     115f <copia+0x5f>
movslq -0x4(%rbp),%rcx
mov    0x2ed0(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2eaa(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
movslq %eax,%rcx
mov    0x2e92(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    115a <copia+0x5a>
movl   $0xffffffff,-0x4(%rbp)
jmp    110b <copia+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
xor    %eax,%eax
mov    0x2ee7(%rip),%rdi
mov    0x2ec8(%rip),%rdx
mov    %eax,%esi
movzbl (%rdi,%rsi,1),%ecx
mov    %cl,(%rdx,%rsi,1)
add    $0x1,%eax
cmp    $0x1,%cl
sbb    %ecx,%ecx
or     %ecx,%eax
jns    1110 <copia+0x10>
ret

LLVM IR (-O0):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %21, %0
%3 = load i32, i32* %1
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %22
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %11
store i8 %9, i8* %12
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %5
store i32 -1, i32* %1
br label %21
21: ; preds = %20, %5
br label %2
22: ; preds = %2
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %3
store i8 %5, i8* %6
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i8 %5, 0
%9 = select i1 %8, i32 -1, i32 %7
%10 = icmp sgt i32 %9, -1
br i1 %10, label %1, label %11
11: ; preds = %1
ret void
}
void _usb_stor_dbg(const struct us_data *us, const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
%struct.us_data = type opaque
define void @_usb_stor_dbg(%struct.us_data* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xfd() {
  Assert_real((isxdigit(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_isxdigit.c",
              1270, ("isxdigit should be 0 for 0xfd"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xfd>:
push   %rax
mov    $0xfd,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4f6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xfd\00"
define void @t_isxdigit_0xfd() {
%1 = tail call i64 @isxdigit(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 ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1270, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap32(int /*<<< orphan*/);
uint16_t fetch16(char *data, bool swap) {
  uint16_t tmp = *(uint16_t *)data;
  if (swap)
    tmp = bswap32(tmp);
  return tmp;
}


x86 assembly (clang, -O0):
<fetch16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113d <fetch16+0x2d>
mov    -0x10(%rbp),%edi
call   1030 <bswap32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch16>:
mov    (%rdi),%edi
test   %esi,%esi
je     111b <fetch16+0xb>
jmp    1030 <bswap32@plt>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fetch16(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @bswap32(i32 %4)
br label %8
8: ; preds = %6, %2
%9 = phi i32 [ %7, %6 ], [ %4, %2 ]
ret i32 %9
}