xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ value_buf;

/* Variables and functions */
int /*<<< orphan*/ ath10k_parse_param_list(char const *, char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char value_buf[128];
  const char *param_list = ";;;;;;test=1;product=570w;hello=test";
  ath10k_parse_param_list(param_list, "product", value_buf, sizeof(value_buf));
  printf("value_buf = %s\n", value_buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    0xece(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    0xeda(%rip),%rsi
mov    $0x80,%ecx
call   1040 <ath10k_parse_param_list@plt>
lea    -0x80(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xed1(%rip),%rdi
lea    0xeef(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdx
mov    $0x80,%ecx
call   1040 <ath10k_parse_param_list@plt>
lea    0xee0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c";;;;;;test=1;product=570w;hello=test\00"
@.str.1 = [8 x i8] c"product\00"
@.str.2 = [16 x i8] c"value_buf = %s\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca i8*
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%5 = call i32 @ath10k_parse_param_list(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 128)
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c";;;;;;test=1;product=570w;hello=test\00"
@.str.1 = [8 x i8] c"product\00"
@.str.2 = [16 x i8] c"value_buf = %s\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @ath10k_parse_param_list(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 128)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  char i;
  i = getchar();
  putchar(i);
  putchar(65);
  putchar(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 @putchar(i32 %5)
%7 = call i32 @putchar(i32 65)
%8 = call i32 @putchar(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = sext i8 %1 to i32
%3 = tail call i32 @putchar(i32 %2)
%4 = tail call i32 @putchar(i32 65)
%5 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_container_to_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(258, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_container_to_start_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x102,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_container_to_start_solutions>:
mov    $0x102,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @copy_dobldobl_container_to_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 258, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
long double __qsinh(long double);
long double intr_wrap_070(long double p1) { return __qsinh(p1); }


x86 assembly (clang, -O0):
<intr_wrap_070>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qsinh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_070>:
jmp    1030 <__qsinh@plt>

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

LLVM IR (-O2):
define x86_fp80 @intr_wrap_070(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qsinh(x86_fp80 %0)
ret x86_fp80 %2
}
int foo(int a) {
  if (a == 0)
    if (a == 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112c <foo+0x2c>
cmpl   $0x0,-0x8(%rbp)
jne    1127 <foo+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1133 <foo+0x33>
jmp    112c <foo+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ rhash_init_algorithms();
void rhash_library_init(void) { rhash_init_algorithms(); }


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

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

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

LLVM IR (-O2):
define void @rhash_library_init() {
%1 = tail call i32 (...) @rhash_init_algorithms()
ret void
}
/* Variables and functions */
int fsync(int);
__attribute__((__weak__, __always___)) int softboundcets_fsync(int fd) {
  return fsync(fd);
}


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

x86 assembly (clang, -O2):
<softboundcets_fsync>:
jmp    1030 <fsync@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_fsync(i32 %0) {
%2 = tail call i32 @fsync(i32 %0)
ret i32 %2
}
/* Variables and functions */
unsigned int random_rand();
_Bool random_boolean_prob(const double prob) {
  return (_Bool)(random_rand() <=
                 (unsigned int)(prob * (double)(unsigned int)0xFFFFFFFF));
}


x86 assembly (clang, -O0):
<random_boolean_prob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xor    %eax,%eax
call   1030 <random_rand@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
cmp    %ecx,%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_boolean_prob>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random_rand@plt>
movsd  (%rsp),%xmm0
mulsd  0xed6(%rip),%xmm0
cvttsd2si %xmm0,%rcx
cmp    %ecx,%eax
setbe  %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i1 @random_boolean_prob(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (...) @random_rand()
%4 = load double, double* %2
%5 = fmul double %4, 0x41EFFFFFFFE00000
%6 = fptoui double %5 to i32
%7 = icmp ule i32 %3, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @random_boolean_prob(double %0) {
%2 = tail call i32 (...) @random_rand()
%3 = fmul double %0, 0x41EFFFFFFFE00000
%4 = fptoui double %3 to i32
%5 = icmp ule i32 %2, %4
ret i1 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ eval(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  eval("printf(\"Hello, world!\\n\")");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <eval@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <eval@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"printf(\22Hello, world!\\n\22)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @eval(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"printf(\22Hello, world!\\n\22)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @eval(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void gtk_plug_construct_for_display() {}


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

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

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

LLVM IR (-O2):
define void @gtk_plug_construct_for_display() {
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void pn_timespec_check(struct timespec *a) {
  assert(a->tv_sec >= 0);
  assert(a->tv_nsec >= 0 && a->tv_nsec < 1000000000);
}


x86 assembly (clang, -O0):
<pn_timespec_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,0x8(%rcx)
mov    %al,-0x9(%rbp)
jl     1155 <pn_timespec_check+0x45>
mov    -0x8(%rbp),%rax
cmpl   $0x3b9aca00,0x8(%rax)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_timespec_check>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x3b9aca00,0x8(%rbx)
setb   %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
define void @pn_timespec_check(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp sge i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.timespec*, %struct.timespec** %2
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = load %struct.timespec*, %struct.timespec** %2
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = icmp slt i32 %16, 1000000000
br label %18
18: ; preds = %13, %1
%19 = phi i1 [ false, %1 ], [ %17, %13 ]
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
define void @pn_timespec_check(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
%7 = tail call i32 @assert(i32 %6)
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%9 = load i32, i32* %8
%10 = icmp ult i32 %9, 1000000000
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
void sighandler(int sig) {
  static int int_counter;
  int_counter++;
  if (int_counter == 3) {
    exit(0);
  }
  printf(
      "SIGINT (%d) pressed %d times, will print this and continue afterwards\n",
      sig, int_counter);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f03(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2efa(%rip)
cmpl   $0x3,0x2ef3(%rip)
jne    114e <sighandler+0x2e>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%esi
mov    0x2edd(%rip),%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
mov    0x2f0d(%rip),%edx
add    $0x1,%edx
mov    %edx,0x2f04(%rip)
cmp    $0x3,%edx
je     1144 <sighandler+0x24>
mov    %edi,%esi
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@sighandler.int_counter = internal global i32 0
@.str = [71 x i8] c"SIGINT (%d) pressed %d times, will print this and continue afterwards\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @sighandler.int_counter
%4 = add nsw i32 %3, 1
store i32 %4, i32* @sighandler.int_counter
%5 = load i32, i32* @sighandler.int_counter
%6 = icmp eq i32 %5, 3
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* @sighandler.int_counter
%12 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@sighandler.int_counter = internal unnamed_addr global i32 0
@.str = [71 x i8] c"SIGINT (%d) pressed %d times, will print this and continue afterwards\0A\00"
define void @sighandler(i32 %0) {
%2 = load i32, i32* @sighandler.int_counter
%3 = add nsw i32 %2, 1
store i32 %3, i32* @sighandler.int_counter
%4 = icmp eq i32 %3, 3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3)
ret void
}
void XkbAllocGeometry() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_param_values_cmp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_dec();
int /*<<< orphan*/ e_writeback();
int /*<<< orphan*/ e_zp();
void e_dec_zp() {
  e_zp();
  e_dec();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_dec_zp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <e_zp@plt>
mov    $0x0,%al
call   1050 <e_dec@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_dec_zp>:
push   %rax
xor    %eax,%eax
call   1040 <e_zp@plt>
xor    %eax,%eax
call   1050 <e_dec@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_dec_zp() {
%1 = call i32 (...) @e_zp()
%2 = call i32 (...) @e_dec()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_dec_zp() {
%1 = tail call i32 (...) @e_zp()
%2 = tail call i32 (...) @e_dec()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int rand();
int RoomConnections() { return (rand() % 4) + 3; }


x86 assembly (clang, -O0):
<RoomConnections>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoomConnections>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @RoomConnections() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 4
%3 = add nsw i32 %2, 3
ret i32 %3
}

LLVM IR (-O2):
define i32 @RoomConnections() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 4
%3 = add nsw i32 %2, 3
ret i32 %3
}
void put_unsigned_short_be(unsigned short data, unsigned char **bufptr) {
  *(*bufptr)++ = (unsigned char)((data >> 8) & 0xff);
  *(*bufptr)++ = (unsigned char)(data & 0xff);
}


x86 assembly (clang, -O0):
<put_unsigned_short_be>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_unsigned_short_be>:
mov    %edi,%eax
mov    (%rsi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rsi)
mov    %ah,(%rcx)
mov    (%rsi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rsi)
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define void @put_unsigned_short_be(i16 zeroext %0, i8** %1) {
%3 = alloca i16
%4 = alloca i8**
store i16 %0, i16* %3
store i8** %1, i8*** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
store i8 %9, i8* %11
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8**, i8*** %4
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %17
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @put_unsigned_short_be(i16 zeroext %0, i8** nocapture %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %1
store i8 %4, i8* %5
%7 = trunc i16 %0 to i8
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %1
store i8 %7, i8* %8
ret void
}
float vec3_dist(const float a[3], const float b[3]) {
  return sqrt(vec3_dist2(a, b));
}


x86 assembly (clang, -O0):
<vec3_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <vec3_dist2@plt>
cvtsi2sd %eax,%xmm0
call   1040 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_dist>:
push   %rax
xor    %eax,%eax
call   1030 <vec3_dist2@plt>
cvtsi2sd %eax,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113c <vec3_dist+0x1c>
sqrtsd %xmm0,%xmm0
jmp    1141 <vec3_dist+0x21>
call   1040 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @vec3_dist(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 (float*, float*, ...) bitcast (i32 (...)* @vec3_dist2 to i32 (float*, float*, ...)*)(float* %5, float* %6)
%8 = sitofp i32 %7 to double
%9 = call double @sqrt(double %8)
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @vec3_dist(float* %0, float* %1) {
%3 = tail call i32 (float*, float*, ...) bitcast (i32 (...)* @vec3_dist2 to i32 (float*, float*, ...)*)(float* %0, float* %1)
%4 = sitofp i32 %3 to double
%5 = tail call double @sqrt(double %4)
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
scalar_t__ nc_LINES();
int /*<<< orphan*/ nc_addch(char);
int /*<<< orphan*/ nc_set_yx(scalar_t__, int /*<<< orphan*/);
void ui_print(const char *s, size_t n) {
  nc_set_yx(nc_LINES() - 1, 0);
  while (n-- > 0)
    nc_addch(*s++);
  nc_addch('\n');
}


x86 assembly (clang, -O0):
<ui_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <nc_LINES@plt>
mov    %rax,%rdi
sub    $0x1,%rdi
xor    %esi,%esi
call   1040 <nc_set_yx@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    118a <ui_print+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <nc_addch@plt>
jmp    1155 <ui_print+0x25>
mov    $0xa,%edi
call   1030 <nc_addch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_print>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <nc_LINES@plt>
lea    -0x1(%rax),%rdi
xor    %esi,%esi
call   1040 <nc_set_yx@plt>
test   %r15,%r15
je     1173 <ui_print+0x43>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%r14,%rbx,1),%edi
call   1030 <nc_addch@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1160 <ui_print+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <nc_addch@plt>

LLVM IR (-O0):
define void @ui_print(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = call i64 (...) @nc_LINES()
%6 = sub nsw i64 %5, 1
%7 = call i32 @nc_set_yx(i64 %6, i32 0)
br label %8
8: ; preds = %12, %2
%9 = load i64, i64* %4
%10 = add i64 %9, -1
store i64 %10, i64* %4
%11 = icmp ugt i64 %9, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
%16 = call i32 @nc_addch(i8 signext %15)
br label %8
17: ; preds = %8
%18 = call i32 @nc_addch(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ui_print(i8* nocapture %0, i64 %1) {
%3 = tail call i64 (...) @nc_LINES()
%4 = add nsw i64 %3, -1
%5 = tail call i32 @nc_set_yx(i64 %4, i32 0)
%6 = icmp eq i64 %1, 0
br i1 %6, label %15, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ %1, %2 ]
%9 = phi i8* [ %11, %7 ], [ %0, %2 ]
%10 = add i64 %8, -1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = tail call i32 @nc_addch(i8 signext %12)
%14 = icmp eq i64 %10, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %2
%16 = tail call i32 @nc_addch(i8 signext 10)
ret void
}
void x_debug(char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @x_debug(i8* nocapture %0, ...) {
ret void
}
void av_lfg_init() {}


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

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

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

LLVM IR (-O2):
define void @av_lfg_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xbe() {
  Assert_real((isspace(190) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              955, ("isspace should be 0 for 0xbe"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xbe\00"
define void @t_isspace_0xbe() {
%1 = tail call i64 @isspace(i32 190)
%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 955, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int try_mtocrf(int x) {
  int base = 0x31415927;
  int res;
  res = 42;
  return res;
}


x86 assembly (clang, -O0):
<try_mtocrf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x31415927,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @try_mtocrf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 826366247, i32* %3
store i32 42, i32* %4
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @try_mtocrf(i32 %0) {
ret i32 42
}
int str_len(const char *s) {
  const char *p;
  for (p = s; *p >= ' '; p++)
    ;
  return p - s;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jl     1136 <str_len+0x36>
jmp    1125 <str_len+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <str_len+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x1f,(%rdi)
lea    0x1(%rdi),%rdi
jg     1110 <str_len+0x10>
ret

LLVM IR (-O0):
define i32 @str_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 32
br i1 %9, label %10, label %14
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
br label %5
14: ; preds = %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @str_len(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp sgt i8 %4, 31
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void _mesa_init_sparc_glapi_relocs(void) {}


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

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

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

LLVM IR (-O2):
define void @_mesa_init_sparc_glapi_relocs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dbgprintf(char *);
void PrefetchAbort(void) {
  dbgprintf("PrefetchAbort\n");
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<PrefetchAbort>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <dbgprintf@plt>
jmp    1120 <PrefetchAbort+0x10>

x86 assembly (clang, -O2):
<PrefetchAbort>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <dbgprintf@plt>
nopl   (%rax)
jmp    1120 <PrefetchAbort+0x10>

LLVM IR (-O0):
@.str = [15 x i8] c"PrefetchAbort\0A\00"
define void @PrefetchAbort() {
%1 = call i32 @dbgprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [15 x i8] c"PrefetchAbort\0A\00"
define void @PrefetchAbort() {
%1 = tail call i32 @dbgprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
void *shmat(int, void *, int /*<<< orphan*/);
void *simpleShmLink(int memId) { return shmat(memId, ((void *)0), 0); }


x86 assembly (clang, -O0):
<simpleShmLink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpleShmLink>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <shmat@plt>

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

LLVM IR (-O2):
define i8* @simpleShmLink(i32 %0) {
%2 = tail call i8* @shmat(i32 %0, i8* null, i32 0)
ret i8* %2
}
int test_imm_03uint16_reg(unsigned short val) {
  return ((val) & (0x03 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_03uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_03uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 3
%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_03uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 3
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void SDMMC1_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @SDMMC1_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @SDMMC1_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_error_undefined_while() {
  printf("Error: there's no defined action for this while loop.\n");
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"Error: there's no defined action for this while loop.\0A\00"
define void @msg_error_undefined_while() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [54 x i8] c"Error: there's no defined action for this while loop.\00"
define void @msg_error_undefined_while() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret void
}
void pause() { __asm__ __volatile__("pause" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @pause() {
tail call void asm sideeffect "pause", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char *);
void badcnt(char *s) { errx(1, "%s: bad byte count", s); }


x86 assembly (clang, -O0):
<badcnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xed4(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badcnt>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s: bad byte count\00"
define void @badcnt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @errx(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s: bad byte count\00"
define void @badcnt(i8* %0) {
%2 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void INT_Excep_PERIA_INTA222(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA222() {
ret void
}
/* Variables and functions */
int __popcntd(unsigned int);
int test__popcntd(unsigned int __X) { return __popcntd(__X); }


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

x86 assembly (clang, -O2):
<test__popcntd>:
jmp    1030 <__popcntd@plt>

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

LLVM IR (-O2):
define i32 @test__popcntd(i32 %0) {
%2 = tail call i32 @__popcntd(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_option() { printf("Options:....\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Options:....\0A\00"
define void @display_option() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Options:....\00"
define void @display_option() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int hex2int(char b) {
  if (('0' <= b && b <= '9') || ('a' <= b && b <= 'f')) {
    return (b >= 'a') ? (b - 'a' + 10) : (b - '0');
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<hex2int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1128 <hex2int+0x28>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1146 <hex2int+0x46>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     117a <hex2int+0x7a>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     117a <hex2int+0x7a>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1165 <hex2int+0x65>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    116f <hex2int+0x6f>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <hex2int+0x81>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2int>:
lea    -0x61(%rdi),%eax
lea    -0x30(%rdi),%ecx
lea    -0x57(%rdi),%edx
cmp    $0x61,%dil
cmovl  %ecx,%edx
cmp    $0x6,%al
mov    $0xffffffff,%eax
cmovb  %edx,%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%cl
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @hex2int(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 48, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sle i32 97, %13
br i1 %14, label %15, label %34
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 102
br i1 %18, label %19, label %34
19: ; preds = %15, %7
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 97
%27 = add nsw i32 %26, 10
br label %32
28: ; preds = %19
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %30, 48
br label %32
32: ; preds = %28, %23
%33 = phi i32 [ %27, %23 ], [ %31, %28 ]
store i32 %33, i32* %2
br label %35
34: ; preds = %15, %11
store i32 -1, i32* %2
br label %35
35: ; preds = %34, %32
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
define i32 @hex2int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 6
%7 = or i1 %4, %6
%8 = icmp sgt i8 %0, 96
%9 = select i1 %8, i32 -87, i32 -48
%10 = add nsw i32 %9, %2
%11 = select i1 %7, i32 %10, i32 -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x8e() {
  Assert_real((isgraph(142) == 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",
              715, ("isgraph should be 0 for 0x8e"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x8e>:
push   %rax
mov    $0x8e,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2cb,%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 0x8e\00"
define void @t_isgraph_0x8e() {
%1 = call i64 @isgraph(i32 142)
%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 715, 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 0x8e\00"
define void @t_isgraph_0x8e() {
%1 = tail call i64 @isgraph(i32 142)
%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 715, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void iswap(int *pa, int *pb) {
  int a, b, t;
  a = *pa;
  b = *pb;
  t = b;
  b = a;
  a = t;
  *pa = a;
  *pb = b;
}


x86 assembly (clang, -O0):
<iswap>:
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),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @iswap(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
}
char *read_token_no_eof(void) {
  char *token = read_token();
  if (token == ((void *)0))
    bad_eof();
  return token;
}


x86 assembly (clang, -O0):
<read_token_no_eof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <read_token@plt>
cltq
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1147 <read_token_no_eof+0x27>
mov    $0x0,%al
call   1030 <bad_eof@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_token_no_eof>:
push   %rbx
xor    %eax,%eax
call   1040 <read_token@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1135 <read_token_no_eof+0x15>
xor    %eax,%eax
call   1030 <bad_eof@plt>
movslq %ebx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @read_token_no_eof() {
%1 = alloca i8*
%2 = call i32 (...) @read_token()
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @bad_eof()
br label %9
9: ; preds = %7, %0
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
define i8* @read_token_no_eof() {
%1 = tail call i32 (...) @read_token()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @bad_eof()
br label %5
5: ; preds = %3, %0
%6 = sext i32 %1 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int tiger_exit(int i) { exit(i); }


x86 assembly (clang, -O0):
<tiger_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<tiger_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @tiger_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ release_conversion_table();
int /*<<< orphan*/ release_std_conversion_table();
void r_destroy_conversion_tables(void) {
  release_conversion_table();
  release_std_conversion_table();
}


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

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

LLVM IR (-O0):
define void @r_destroy_conversion_tables() {
%1 = call i32 (...) @release_conversion_table()
%2 = call i32 (...) @release_std_conversion_table()
ret void
}

LLVM IR (-O2):
define void @r_destroy_conversion_tables() {
%1 = tail call i32 (...) @release_conversion_table()
%2 = tail call i32 (...) @release_std_conversion_table()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ id_t;
typedef enum __priority_which {
  ____Placeholder___priority_which
} __priority_which;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setpriority(enum __priority_which which, id_t who, int prio) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setpriority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setpriority>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setpriority(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setpriority(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
void BN_mod_lshift1(void) {}


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

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

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

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