xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ expr();
int /*<<< orphan*/ get_lexval();
int /*<<< orphan*/ variable();
int yyselect();
assignment_expr() {
  switch (yyselect()) {
  case 77: {
    variable();
    get_lexval();
    expr();
  } break;
  }
}


x86 assembly (clang, -O0):
<assignment_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
sub    $0x4d,%eax
jne    1172 <assignment_expr+0x32>
jmp    115d <assignment_expr+0x1d>
mov    $0x0,%al
call   1050 <variable@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
mov    $0x0,%al
call   1060 <expr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assignment_expr>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x4d,%eax
jne    1162 <assignment_expr+0x22>
xor    %eax,%eax
call   1050 <variable@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
xor    %eax,%eax
call   1060 <expr@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @assignment_expr() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %7 [
i32 77, label %3
]
3: ; preds = %0
%4 = call i32 (...) @variable()
%5 = call i32 (...) @get_lexval()
%6 = call i32 (...) @expr()
br label %7
7: ; preds = %0, %3
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @assignment_expr() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 77
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @variable()
%5 = tail call i32 (...) @get_lexval()
%6 = tail call i32 (...) @expr()
br label %7
7: ; preds = %0, %3
ret i32 undef
}
void check_options_udp_stream(struct options *opts, struct callbacks *cb) {}


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

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

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

LLVM IR (-O2):
%struct.options = type opaque
%struct.callbacks = type opaque
define void @check_options_udp_stream(%struct.options* nocapture %0, %struct.callbacks* nocapture %1) {
ret void
}
/* Variables and functions */
int recursive_unlink_helper(int, char const *);
int recursive_unlink(const char *path) {
  return recursive_unlink_helper(-1, path);
}


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

x86 assembly (clang, -O2):
<recursive_unlink>:
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <recursive_unlink_helper@plt>

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

LLVM IR (-O2):
define i32 @recursive_unlink(i8* %0) {
%2 = tail call i32 @recursive_unlink_helper(i32 -1, i8* %0)
ret i32 %2
}
/* Variables and functions */
void *realloc(void *, size_t);
void *VdsRealloc(void *ptr, size_t size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<VdsRealloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @VdsRealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Type definitions */
struct oscap_htable_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct oscap_htable_iterator *);
void oscap_htable_iterator_free(struct oscap_htable_iterator *hit) {
  free(hit);
}


x86 assembly (clang, -O0):
<oscap_htable_iterator_free>:
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):
<oscap_htable_iterator_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.oscap_htable_iterator = type { i32 }
define void @oscap_htable_iterator_free(%struct.oscap_htable_iterator* nocapture %0) {
%2 = tail call i32 @free(%struct.oscap_htable_iterator* %0)
ret void
}
__attribute__((always_)) const long double xfabsl(long double x) {
  return x >= 0 ? x : -x;
}


x86 assembly (clang, -O0):
<xfabsl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     112b <xfabsl+0x2b>
jmp    1120 <xfabsl+0x20>
fldt   -0x10(%rbp)
fstpt  -0x1c(%rbp)
jmp    1133 <xfabsl+0x33>
fldt   -0x10(%rbp)
fchs
fstpt  -0x1c(%rbp)
fldt   -0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfabsl>:
fldt   0x8(%rsp)
fldz
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
fld    %st(0)
fchs
fcmovnb %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @xfabsl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp oge x86_fp80 %3, 0xK00000000000000000000
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load x86_fp80, x86_fp80* %2
br label %10
7: ; preds = %1
%8 = load x86_fp80, x86_fp80* %2
%9 = fneg x86_fp80 %8
br label %10
10: ; preds = %7, %5
%11 = phi x86_fp80 [ %6, %5 ], [ %9, %7 ]
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @xfabsl(x86_fp80 %0) {
%2 = fcmp oge x86_fp80 %0, 0xK00000000000000000000
%3 = fneg x86_fp80 %0
%4 = select i1 %2, x86_fp80 %0, x86_fp80 %3
ret x86_fp80 %4
}
double f(double x, double y) { return (2 * x + y); }


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),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
addsd  %xmm0,%xmm0
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 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @f(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;
typedef int GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ gluPerspective(double, int, double, double);
void skaliraj(int w, int h) {
  glViewport(0, 0, (GLsizei)w, (GLsizei)h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(30.0, (GLfloat)w / (GLfloat)h, 1.0, 100.0);
}


x86 assembly (clang, -O0):
<skaliraj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
movsd  0xe7d(%rip),%xmm0
movsd  0xe7d(%rip),%xmm1
movsd  0xe7d(%rip),%xmm2
call   1040 <gluPerspective@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skaliraj>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
movsd  0xe8a(%rip),%xmm0
movsd  0xe8a(%rip),%xmm1
movsd  0xe8a(%rip),%xmm2
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <gluPerspective@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @skaliraj(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sdiv i32 %11, %12
%14 = call i32 @gluPerspective(double 3.000000e+01, i32 %13, double 1.000000e+00, double 1.000000e+02)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @skaliraj(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = sdiv i32 %0, %1
%8 = tail call i32 @gluPerspective(double 3.000000e+01, i32 %7, double 1.000000e+00, double 1.000000e+02)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interpo(unsigned int, unsigned int, unsigned int,
                           unsigned int);
void cur_plo(unsigned int *cal_res) {
  unsigned int i, past_y, pres_y;
  pres_y = cal_res[0];
  for (i = 1; i < 128; i++) {
    past_y = pres_y;
    pres_y = cal_res[i];
    interpo((i - 1), i, past_y, pres_y);
  }
}


x86 assembly (clang, -O0):
<cur_plo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jae    116e <cur_plo+0x5e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <interpo@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <cur_plo+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cur_plo>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%edx
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
lea    0x1(%rdi),%rbx
mov    0x4(%r14,%rdi,4),%ebp
mov    %ebx,%esi
mov    %ebp,%ecx
call   1030 <interpo@plt>
mov    %rbx,%rdi
mov    %ebp,%edx
cmp    $0x7f,%rbx
jne    1120 <cur_plo+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @cur_plo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
store i32 %8, i32* %5
store i32 1, i32* %3
br label %9
9: ; preds = %25, %1
%10 = load i32, i32* %3
%11 = icmp ult i32 %10, 128
br i1 %11, label %12, label %28
12: ; preds = %9
%13 = load i32, i32* %5
store i32 %13, i32* %4
%14 = load i32*, i32** %2
%15 = load i32, i32* %3
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = sub i32 %19, 1
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = call i32 @interpo(i32 %20, i32 %21, i32 %22, i32 %23)
br label %25
25: ; preds = %12
%26 = load i32, i32* %3
%27 = add i32 %26, 1
store i32 %27, i32* %3
br label %9
28: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @cur_plo(i32* nocapture %0) {
%2 = load i32, i32* %0
br label %3
3: ; preds = %1, %3
%4 = phi i64 [ 1, %1 ], [ %11, %3 ]
%5 = phi i32 [ %2, %1 ], [ %8, %3 ]
%6 = trunc i64 %4 to i32
%7 = getelementptr inbounds i32, i32* %0, i64 %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, -1
%10 = tail call i32 @interpo(i32 %9, i32 %6, i32 %5, i32 %8)
%11 = add nuw nsw i64 %4, 1
%12 = icmp eq i64 %11, 128
br i1 %12, label %13, label %3
13: ; preds = %3
ret void
}
long long rtapi_get_clocks(void) {
  long long int retval;
  ((retval) = __builtin_ia32_rdtsc());
  return retval;
}


x86 assembly (clang, -O0):
<rtapi_get_clocks>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtapi_get_clocks>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rtapi_get_clocks() {
%1 = alloca i64
%2 = call i64 @llvm.x86.rdtsc()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @rtapi_get_clocks() {
%1 = tail call i64 @llvm.x86.rdtsc()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_creds_get_pid_starttime(void *c, uint64_t *usec) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_creds_get_pid_starttime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_creds_get_pid_starttime>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_pid_starttime(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_pid_starttime(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
scalar_t__ snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
char *xmalloc(scalar_t__);
char *int2str(int d, int width) {
  char *s = xmalloc(snprintf(NULL, 0, "%*d", width, d) + 1);
  sprintf(s, "%*d", width, d);
  return s;
}


x86 assembly (clang, -O0):
<int2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xeae(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xe88(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2str>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %edi,%ebp
lea    0xebd(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
mov    %ebp,%r8d
call   1030 <snprintf@plt>
lea    0x1(%rax),%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
mov    %ebp,%ecx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%*d\00"
define i8* @int2str(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @xmalloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*d\00"
define i8* @int2str(i32 %0, i32 %1) {
%3 = tail call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @xmalloc(i64 %4)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret i8* %5
}
int f_1_d() { return 2; }


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

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

LLVM IR (-O0):
define i32 @f_1_d() {
ret i32 2
}

LLVM IR (-O2):
define i32 @f_1_d() {
ret i32 2
}
/* Variables and functions */
unsigned int __builtin_arm_cls64(unsigned long);
unsigned int clsl(unsigned long v) { return __builtin_arm_cls64(v); }


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

x86 assembly (clang, -O2):
<clsl>:
jmp    1030 <__builtin_arm_cls64@plt>

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

LLVM IR (-O2):
define i32 @clsl(i64 %0) {
%2 = tail call i32 @__builtin_arm_cls64(i64 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ cosh(double);
int /*<<< orphan*/ link_failure_cosh();
void test_cosh(double d) {
  if (cosh(d) != cosh(d))
    link_failure_cosh();
}


x86 assembly (clang, -O0):
<test_cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cosh@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cosh@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_cosh+0x3c>
mov    $0x0,%al
call   1040 <link_failure_cosh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cosh>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <cosh@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <cosh@plt>
cmp    %rax,%rbx
jne    1149 <test_cosh+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_cosh@plt>

LLVM IR (-O0):
define void @test_cosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @cosh(double %3)
%5 = load double, double* %2
%6 = call i64 @cosh(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_cosh()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_cosh(double %0) {
%2 = tail call i64 @cosh(double %0)
%3 = tail call i64 @cosh(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_cosh()
br label %7
7: ; preds = %5, %1
ret void
}
int test_imm_46int8_reg(signed char val) {
  return ((val) & (0x46 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_46int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x46,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_46int8_reg>:
test   $0x46,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_46int8_reg(i8 signext %0) {
%2 = and i8 %0, 70
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x8d() {
  Assert_real((isalpha(141) == 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",
              710, ("isalpha should be 0 for 0x8d"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x8d>:
push   %rax
mov    $0x8d,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2c6,%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 0x8d\00"
define void @t_isalpha_0x8d() {
%1 = call i64 @isalpha(i32 141)
%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 710, 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 0x8d\00"
define void @t_isalpha_0x8d() {
%1 = tail call i64 @isalpha(i32 141)
%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 710, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void bzero(void *p, size_t n) { memset(p, 0, n); }


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

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

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

LLVM IR (-O2):
define void @bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
int increment(int ptr) {
  if (ptr + 1 >= 4096) {
    ptr = 0;
  } else {
    ++ptr;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x1000,%eax
jl     1124 <increment+0x24>
movl   $0x0,-0x4(%rbp)
jmp    112d <increment+0x2d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0xfff,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @increment(i32 %0) {
%2 = icmp sgt i32 %0, 4094
%3 = add nsw i32 %0, 1
%4 = select i1 %2, i32 0, i32 %3
ret i32 %4
}
int test_imm_51uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x51 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_51uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 81
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gmx_bond(int, char **);
int main(int argc, char *argv[]) {
  gmx_bond(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_bond(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int checkerrormsg(const char *buf) { return strcmp(buf, "%%FAIL\n") == 0; }


x86 assembly (clang, -O0):
<checkerrormsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkerrormsg>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%%FAIL\0A\00"
define i32 @checkerrormsg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"%%FAIL\0A\00"
define i32 @checkerrormsg(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
char *getenv(char const *);
int /*<<< orphan*/ strtoul(char *, char **, int /*<<< orphan*/);
bool getenv_int(const char *name, uint64_t *value) {
  char *s, *t;
  s = getenv(name);
  if (s == NULL)
    return (false);
  *value = strtoul(s, &t, 0);
  if (*t != '\0')
    return (false);
  return (true);
}


x86 assembly (clang, -O0):
<getenv_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <getenv_int+0x34>
movl   $0x0,-0x4(%rbp)
jmp    118e <getenv_int+0x6e>
mov    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1187 <getenv_int+0x67>
movl   $0x0,-0x4(%rbp)
jmp    118e <getenv_int+0x6e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1152 <getenv_int+0x32>
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,(%rbx)
mov    0x8(%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
jmp    1154 <getenv_int+0x34>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getenv_int(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
%8 = load i8*, i8** %4
%9 = call i8* @getenv(i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %23
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = call i32 @strtoul(i8* %14, i8** %7, i32 0)
%16 = load i32*, i32** %5
store i32 %15, i32* %16
%17 = load i8*, i8** %7
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 0, i32* %3
br label %23
22: ; preds = %13
store i32 1, i32* %3
br label %23
23: ; preds = %22, %21, %12
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @getenv_int(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i8* @getenv(i8* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = call i32 @strtoul(i8* %5, i8** %3, i32 0)
store i32 %8, i32* %1
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %2
%14 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %14
}
int valueOfBit(int n) { return 1 << n; }


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

x86 assembly (clang, -O2):
<valueOfBit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @valueOfBit(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int main() {
  char *args[] = {"ls", NULL};
  execvp("ls", args);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2cf1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cee(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <execvp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeda(%rip),%rdi
mov    %rsp,%rsi
call   1030 <execvp@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xa1() {
  Assert_real((isgraph(161) == 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_isgraph.c",
              810, ("isgraph should be 0 for 0xa1"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xa1>:
push   %rax
mov    $0xa1,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x32a,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xa1\00"
define void @t_isgraph_0xa1() {
%1 = call i64 @isgraph(i32 161)
%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 810, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xa1\00"
define void @t_isgraph_0xa1() {
%1 = tail call i64 @isgraph(i32 161)
%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 810, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_push() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_push"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_memblockq_push\0A\00"
define i32 @pa_memblockq_push() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_memblockq_push\00"
define i32 @pa_memblockq_push() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __syscall(int);
void sync(void) { __syscall(36); }


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

x86 assembly (clang, -O2):
<sync>:
mov    $0x24,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define void @sync() {
%1 = call i32 @__syscall(i32 36)
ret void
}

LLVM IR (-O2):
define void @sync() {
%1 = tail call i32 @__syscall(i32 36)
ret void
}
/* Variables and functions */
int cos(double);
double func(double x) { return 34 * cos(x * x); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
imul   $0x22,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mulsd  %xmm0,%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
shl    $0x5,%ecx
lea    (%rcx,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @func(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = call i32 @cos(double %5)
%7 = mul nsw i32 34, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @func(double %0) {
%2 = fmul double %0, %0
%3 = tail call i32 @cos(double %2)
%4 = mul nsw i32 %3, 34
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int /*<<< orphan*/ type();
int yyselect();
extern_dcl() {
  switch (yyselect()) {
  case 17: {
    get_lexval();
    type();
    get_lexval();
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<extern_dcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <yyselect@plt>
sub    $0x11,%eax
jne    1169 <extern_dcl+0x39>
jmp    114d <extern_dcl+0x1d>
mov    $0x0,%al
call   1050 <get_lexval@plt>
mov    $0x0,%al
call   1030 <type@plt>
mov    $0x0,%al
call   1050 <get_lexval@plt>
mov    $0x0,%al
call   1050 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extern_dcl>:
push   %rax
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x11,%eax
jne    1159 <extern_dcl+0x29>
xor    %eax,%eax
call   1050 <get_lexval@plt>
xor    %eax,%eax
call   1030 <type@plt>
xor    %eax,%eax
call   1050 <get_lexval@plt>
xor    %eax,%eax
call   1050 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @extern_dcl() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %8 [
i32 17, label %3
]
3: ; preds = %0
%4 = call i32 (...) @get_lexval()
%5 = call i32 (...) @type()
%6 = call i32 (...) @get_lexval()
%7 = call i32 (...) @get_lexval()
br label %8
8: ; preds = %0, %3
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @extern_dcl() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 17
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 (...) @get_lexval()
%5 = tail call i32 (...) @type()
%6 = tail call i32 (...) @get_lexval()
%7 = tail call i32 (...) @get_lexval()
br label %8
8: ; preds = %0, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgstorlb(int n) { ngen("%s\t%%al,%d(%%rbp)", "movb", n); }


x86 assembly (clang, -O0):
<cgstorlb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstorlb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s\09%%al,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorlb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s\09%%al,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorlb(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void __gnat_finalize(void) {}


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

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

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

LLVM IR (-O2):
define void @__gnat_finalize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t size) {
  void *r = realloc(p, size);
  if (!r) {
    perror("realloc()");
    abort();
  }
  return r;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <xrealloc+0x3f>
lea    0xe9d(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"realloc()\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rdram_dram_address(uint32_t address) {
  return (address & 0xffffff) >> 2;
}


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

x86 assembly (clang, -O2):
<rdram_dram_address>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x3fffff,%eax
ret

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

LLVM IR (-O2):
define i32 @rdram_dram_address(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 4194303
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ InitCheck();
double GetWindowWidth(void) {
  InitCheck();
  return (8.5);
}


x86 assembly (clang, -O0):
<GetWindowWidth>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <InitCheck@plt>
movsd  0xedd(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetWindowWidth>:
push   %rax
xor    %eax,%eax
call   1030 <InitCheck@plt>
movsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @GetWindowWidth() {
%1 = call i32 (...) @InitCheck()
ret double 8.500000e+00
}

LLVM IR (-O2):
define double @GetWindowWidth() {
%1 = tail call i32 (...) @InitCheck()
ret double 8.500000e+00
}
void stop(void) {}


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

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

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

LLVM IR (-O2):
define void @stop() {
ret void
}
int ft_isupper(int c) { return ((c >= 'A' && c <= 'Z') ? 1 : 0); }


x86 assembly (clang, -O0):
<ft_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t add(uint8_t a, uint8_t b, uint8_t carry_in) {
  uint16_t res;
  res = a;
  res += b;
  res += carry_in ? 1 : 0;
  return res;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @add(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* %4
store i32 %8, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = add nsw i32 %10, %9
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
%16 = load i32, i32* %7
%17 = add nsw i32 %16, %15
store i32 %17, i32* %7
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = icmp ne i32 %2, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %4, %6
ret i32 %7
}
void *__typesafe_io(unsigned long addr) { return (void *)addr; }


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

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

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

LLVM IR (-O2):
define i8* @__typesafe_io(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
int fib(int n) { return n < 2 ? n : fib(n - 1) + fib(n - 2); }


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1130 <fib+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <fib+0x43>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}