xunge/DecIR huggingface dataset:
int len_uchar(unsigned char *s) {
  int i;
  for (i = 0;; i++)
    if (s[i] == '\0')
      return i;
}


x86 assembly (clang, -O0):
<len_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1129 <len_uchar+0x29>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    112e <len_uchar+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len_uchar+0xf>

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

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

LLVM IR (-O2):
define i32 @len_uchar(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void gtk_scale_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scale_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void int_handler() { printf("SIGINT invoked\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"SIGINT invoked\00"
define void @int_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ range(long, int);
int change(long a, int b, long c, int d, char *s) {
  range(a, b);
  printf("%s", s);
  range(c, d);
  printf("\n");
}


x86 assembly (clang, -O0):
<change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <range@plt>
mov    -0x30(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <range@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change>:
push   %rbp
push   %r14
push   %rbx
mov    %r8,%rbx
mov    %ecx,%r14d
mov    %rdx,%rbp
call   1050 <range@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1050 <range@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @change(i64 %0, i32 %1, i64 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
%11 = alloca i8*
store i64 %0, i64* %7
store i32 %1, i32* %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = call i32 @range(i64 %12, i32 %13)
%15 = load i8*, i8** %11
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i64, i64* %9
%18 = load i32, i32* %10
%19 = call i32 @range(i64 %17, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @change(i64 %0, i32 %1, i64 %2, i32 %3, i8* %4) {
%6 = tail call i32 @range(i64 %0, i32 %1)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = tail call i32 @range(i64 %2, i32 %3)
%9 = tail call i32 @putchar(i32 10)
ret i32 undef
}
void g_slist_find() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_find() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait_100_msec();
void wait_100_n_msec(long n) {
  long i;
  for (i = 0; i < n; i++)
    wait_100_msec();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    114a <wait_100_n_msec+0x3a>
mov    $0x0,%al
call   1030 <wait_100_msec@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <wait_100_n_msec+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
test   %rdi,%rdi
jle    112d <wait_100_n_msec+0x1d>
mov    %rdi,%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <wait_100_msec@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <wait_100_n_msec+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @wait_100_n_msec(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @wait_100_msec()
%6 = add nuw nsw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
float __nv_erfcxf(float);
float erfcxf(float __a) { return __nv_erfcxf(__a); }


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

x86 assembly (clang, -O2):
<erfcxf>:
jmp    1030 <__nv_erfcxf@plt>

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

LLVM IR (-O2):
define float @erfcxf(float %0) {
%2 = tail call float @__nv_erfcxf(float %0)
ret float %2
}
/* Variables and functions */
int func1_in_obj();
int func2_in_obj();
int func3_in_obj();
int main(void) { return func1_in_obj() + func2_in_obj() + func3_in_obj(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <func1_in_obj@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <func2_in_obj@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <func3_in_obj@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <func1_in_obj@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <func2_in_obj@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <func3_in_obj@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @func1_in_obj()
%3 = call i32 (...) @func2_in_obj()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @func3_in_obj()
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func1_in_obj()
%2 = tail call i32 (...) @func2_in_obj()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @func3_in_obj()
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
struct daemon_session {
  int dummy;
};

/* Variables and functions */
int serve_reg_write(struct daemon_session *);
int serve_gpio_write(struct daemon_session *dsess) {
  return serve_reg_write(dsess);
}


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

x86 assembly (clang, -O2):
<serve_gpio_write>:
jmp    1030 <serve_reg_write@plt>

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

LLVM IR (-O2):
%struct.daemon_session = type { i32 }
define i32 @serve_gpio_write(%struct.daemon_session* %0) {
%2 = tail call i32 @serve_reg_write(%struct.daemon_session* %0)
ret i32 %2
}
double _COM_CONVfd(float a) { return a; }


x86 assembly (clang, -O0):
<_COM_CONVfd>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_COM_CONVfd>:
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @_COM_CONVfd(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
ret double %4
}

LLVM IR (-O2):
define double @_COM_CONVfd(float %0) {
%2 = fpext float %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ enc_read_reg(int, unsigned long *);
int /*<<< orphan*/ enc_write_reg(int, unsigned long);
void vgatv_colorbars(int on) {
  unsigned long reg;
  enc_read_reg(0x85, &reg);
  if (on)
    reg |= 0x02;
  else
    reg &= ~0x02;
  enc_write_reg(0x85, reg);
}


x86 assembly (clang, -O0):
<vgatv_colorbars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x85,%edi
lea    -0x10(%rbp),%rsi
call   1030 <enc_read_reg@plt>
cmpl   $0x0,-0x4(%rbp)
je     1154 <vgatv_colorbars+0x34>
mov    -0x10(%rbp),%rax
or     $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    1160 <vgatv_colorbars+0x40>
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffffd,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x85,%edi
call   1040 <enc_write_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vgatv_colorbars>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
test   %edi,%edi
setne  %bl
lea    0x8(%rsp),%rsi
mov    $0x85,%edi
call   1030 <enc_read_reg@plt>
mov    0x8(%rsp),%rax
and    $0xfffffffffffffffd,%rax
lea    (%rax,%rbx,2),%rsi
mov    %rsi,0x8(%rsp)
mov    $0x85,%edi
call   1040 <enc_write_reg@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @vgatv_colorbars(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i32 @enc_read_reg(i32 133, i64* %3)
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = or i64 %8, 2
store i64 %9, i64* %3
br label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = and i64 %11, -3
store i64 %12, i64* %3
br label %13
13: ; preds = %10, %7
%14 = load i64, i64* %3
%15 = call i32 @enc_write_reg(i32 133, i64 %14)
ret void
}

LLVM IR (-O2):
define void @vgatv_colorbars(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @enc_read_reg(i32 133, i64* %2)
%5 = icmp eq i32 %0, 0
%6 = load i64, i64* %2
%7 = and i64 %6, -3
%8 = select i1 %5, i64 0, i64 2
%9 = or i64 %7, %8
store i64 %9, i64* %2
%10 = call i32 @enc_write_reg(i32 133, i64 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ namechange(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char name[1000];
  scanf("%[^\n]s", name);
  namechange(name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
lea    -0x3f0(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
call   1030 <namechange@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <namechange@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%5 = call i32 @namechange(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @namechange(i8* %2)
ret i32 0
}
int ranz(range)
int range;
{ return (rand() % range); }


x86 assembly (clang, -O0):
<ranz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranz>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ranz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @ranz(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void HoloStor_TableFree(void *p) { free(p); }


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

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

LLVM IR (-O2):
define void @HoloStor_TableFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int g_oper_and(int s, int d) { return (s && d); }


x86 assembly (clang, -O0):
<g_oper_and>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <g_oper_and+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_oper_and>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @g_oper_and(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @g_oper_and(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void stillmore(void) {
  int a = 10, b;
  asm("movl %1, %%eax\n\t"
      "movl %%eax, %0\n\t"
      : "=r"(b)
      : "r"(a)
      : "%eax");
  printf("a = %d and b = %d\n", a, b);
}


x86 assembly (clang, -O0):
<stillmore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stillmore>:
mov    $0xa,%ecx
mov    %ecx,%eax
mov    %eax,%edx
lea    0xee0(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"a = %d and b = %d\0A\00"
define void @stillmore() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
%3 = load i32, i32* %1
%4 = call i32 asm "movl $1, %eax\0A\09movl %eax, $0\0A\09", "=r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"a = %d and b = %d\0A\00"
define void @stillmore() {
%1 = tail call i32 asm "movl $1, %eax\0A\09movl %eax, $0\0A\09", "=r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 10, i32 %1)
ret void
}
int san_square(const char *str) { return 8 * (str[1] - '1') + (str[0] - 'a'); }


x86 assembly (clang, -O0):
<san_square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
sub    $0x31,%eax
shl    $0x3,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x61,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<san_square>:
movsbl 0x1(%rdi),%eax
movsbl (%rdi),%ecx
lea    (%rcx,%rax,8),%eax
add    $0xfffffe17,%eax
ret

LLVM IR (-O0):
define i32 @san_square(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 49
%8 = mul nsw i32 8, %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 97
%14 = add nsw i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @san_square(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = shl nsw i32 %4, 3
%6 = load i8, i8* %0
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, -489
%9 = add nsw i32 %8, %5
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ dumpMem(int);
void dumpMemoryImage(void) { dumpMem(1); }


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

x86 assembly (clang, -O2):
<dumpMemoryImage>:
mov    $0x1,%edi
jmp    1030 <dumpMem@plt>

LLVM IR (-O0):
define void @dumpMemoryImage() {
%1 = call i32 @dumpMem(i32 1)
ret void
}

LLVM IR (-O2):
define void @dumpMemoryImage() {
%1 = tail call i32 @dumpMem(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *dupstr(const char *str) {
  char *ret;
  ret = malloc(strlen(str) + 1);
  if (!ret)
    errx(3, "memory allocation error");
  strcpy(ret, str);
  return (ret);
}


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1181 <dupstr+0x41>
mov    $0x3,%edi
lea    0xe84(%rip),%rsi
call   1050 <errx@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116e <dupstr+0x2e>
lea    0xe9c(%rip),%rsi
mov    $0x3,%edi
call   1050 <errx@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"memory allocation error\00"
define i8* @dupstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 @errx(i32 3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [24 x i8] c"memory allocation error\00"
define i8* @dupstr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @errx(i32 3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void boot_memory_test(void) {}


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

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

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

LLVM IR (-O2):
define void @boot_memory_test() {
ret void
}
/* Variables and functions */
int circular_queue_pop();
int keyboard_get_key(void) { return circular_queue_pop(); }


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

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

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

LLVM IR (-O2):
define i32 @keyboard_get_key() {
%1 = tail call i32 (...) @circular_queue_pop()
ret i32 %1
}
/* Variables and functions */
unsigned int R32(int);
unsigned int gpio_get0to31() { return R32(((0x3F000000 + 0x200000) + 0x34)); }


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

x86 assembly (clang, -O2):
<gpio_get0to31>:
mov    $0x3f200034,%edi
jmp    1030 <R32@plt>

LLVM IR (-O0):
define i32 @gpio_get0to31() {
%1 = call i32 @R32(i32 1059061812)
ret i32 %1
}

LLVM IR (-O2):
define i32 @gpio_get0to31() {
%1 = tail call i32 @R32(i32 1059061812)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ putpkt(char *);
void remote_continue(void) { putpkt("c"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"c\00"
define void @remote_continue() {
%1 = tail call i32 @putpkt(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sunxi_gpio_input(unsigned int);
int /*<<< orphan*/ sunxi_gpio_set_cfgpin(unsigned int, int /*<<< orphan*/);
int gpio_direction_input(unsigned gpio) {
  sunxi_gpio_set_cfgpin(gpio, (0));
  return sunxi_gpio_input(gpio);
}


x86 assembly (clang, -O0):
<gpio_direction_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <sunxi_gpio_set_cfgpin@plt>
mov    -0x4(%rbp),%edi
call   1040 <sunxi_gpio_input@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_direction_input>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <sunxi_gpio_set_cfgpin@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <sunxi_gpio_input@plt>

LLVM IR (-O0):
define i32 @gpio_direction_input(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sunxi_gpio_set_cfgpin(i32 %3, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @sunxi_gpio_input(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @gpio_direction_input(i32 %0) {
%2 = tail call i32 @sunxi_gpio_set_cfgpin(i32 %0, i32 0)
%3 = tail call i32 @sunxi_gpio_input(i32 %0)
ret i32 %3
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime;
int weak_gettime(int /*<<< orphan*/, struct timespec *);
int main() {
  if (!clock_gettime)
    return 0;
  struct timespec ts;
  return weak_gettime(CLOCK_MONOTONIC, &ts);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
cmpl   $0x0,(%rax)
jne    113b <main+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1150 <main+0x40>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <weak_gettime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
cmpl   $0x0,(%rax)
je     1130 <main+0x20>
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <weak_gettime@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@clock_gettime = global i32 0
@CLOCK_MONOTONIC = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = load i32, i32* @clock_gettime
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 0, i32* %1
br label %9
6: ; preds = %0
%7 = load i32, i32* @CLOCK_MONOTONIC
%8 = call i32 @weak_gettime(i32 %7, %struct.timespec* %2)
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@clock_gettime = global i32 0
@CLOCK_MONOTONIC = global i32 0
define i32 @main() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @clock_gettime
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = bitcast %struct.timespec* %1 to i8*
%6 = load i32, i32* @CLOCK_MONOTONIC
%7 = call i32 @weak_gettime(i32 %6, %struct.timespec* %1)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ %7, %4 ], [ 0, %0 ]
ret i32 %9
}
void write_local_electron_density() {}


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

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

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

LLVM IR (-O2):
define void @write_local_electron_density() {
ret void
}
void _vDispAt(unsigned int uiLine, unsigned int uiCol,
              const unsigned char *puszTxt) {}


x86 assembly (clang, -O0):
<_vDispAt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_vDispAt(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
struct stfl_form {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stfl_form_free(struct stfl_form *);
void stfl_free(struct stfl_form *f) { stfl_form_free(f); }


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

x86 assembly (clang, -O2):
<stfl_free>:
jmp    1030 <stfl_form_free@plt>

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

LLVM IR (-O2):
%struct.stfl_form = type { i32 }
define void @stfl_free(%struct.stfl_form* %0) {
%2 = tail call i32 @stfl_form_free(%struct.stfl_form* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
void Dico_String_Start(int nb_consts) {
  Inst_Printf(".section", ".rodata.str1.1,\"aMS\",@progbits,1");
}


x86 assembly (clang, -O0):
<Dico_String_Start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c".section\00"
@.str.1 = [33 x i8] c".rodata.str1.1,\22aMS\22,@progbits,1\00"
define void @Dico_String_Start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Inst_Printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c".section\00"
@.str.1 = [33 x i8] c".rodata.str1.1,\22aMS\22,@progbits,1\00"
define void @Dico_String_Start(i32 %0) {
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned char uint8_t;
typedef int uint32_t;

/* Variables and functions */
void ADI8BitsSet(uint32_t ui32Base, uint32_t ui32Reg, uint8_t ui8Val) {
  uint32_t ui32RegOffset;
  ;
  ;
  ui32RegOffset = 0x00000010;
  (*((volatile unsigned char *)(ui32Base + ui32RegOffset + ui32Reg))) = ui8Val;
}


x86 assembly (clang, -O0):
<ADI8BitsSet>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x10,-0x10(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADI8BitsSet>:
movslq %edi,%rax
movslq %esi,%rcx
mov    %dl,0x10(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @ADI8BitsSet(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
store i32 16, i32* %7
%8 = load i8, i8* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %7
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
store volatile i8 %8, i8* %15
ret void
}

LLVM IR (-O2):
define void @ADI8BitsSet(i32 %0, i32 %1, i8 zeroext %2) {
%4 = add nsw i32 %0, 16
%5 = add nsw i32 %4, %1
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store volatile i8 %2, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x17() {
  Assert_real((isalnum(23) == 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_isalnum.c",
              120, ("isalnum should be 0 for 0x17"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x17>:
push   %rax
mov    $0x17,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x78,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x17\00"
define void @t_isalnum_0x17() {
%1 = call i64 @isalnum(i32 23)
%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 120, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x17\00"
define void @t_isalnum_0x17() {
%1 = tail call i64 @isalnum(i32 23)
%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 120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int Magicheski(int **);
int /*<<< orphan*/ printf(char *);
void main() {
  int a[3][3] = {{2, 6, 8}, {9, 6, 1}, {5, 4, 7}};
  if (Magicheski(a) == 1)
    printf("Chislata obrazuvat magicheski kvadrat \n");
  else
    printf("Chislata ne obrazuvat magicheski kvadrat \n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1050 <Magicheski@plt>
cmp    $0x1,%eax
jne    1170 <main+0x40>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x4c>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <Magicheski@plt>
cmp    $0x1,%eax
lea    0xef7(%rip),%rax
lea    0xec6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x [3 x i32]] [[3 x i32] [i32 2, i32 6, i32 8], [3 x i32] [i32 9, i32 6, i32 1], [3 x i32] [i32 5, i32 4, i32 7]]
@.str = [40 x i8] c"Chislata obrazuvat magicheski kvadrat \0A\00"
@.str.1 = [43 x i8] c"Chislata ne obrazuvat magicheski kvadrat \0A\00"
define void @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 0
%4 = bitcast [3 x i32]* %3 to i32**
%5 = call i32 @Magicheski(i32** %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@__const.main.a = [3 x [3 x i32]] [[3 x i32] [i32 2, i32 6, i32 8], [3 x i32] [i32 9, i32 6, i32 1], [3 x i32] [i32 5, i32 4, i32 7]]
@str = [42 x i8] c"Chislata ne obrazuvat magicheski kvadrat \00"
@str.2 = [39 x i8] c"Chislata obrazuvat magicheski kvadrat \00"
define void @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = bitcast [3 x [3 x i32]]* %1 to i32**
%4 = call i32 @Magicheski(i32** %3)
%5 = icmp eq i32 %4, 1
%6 = select i1 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getAddress();
int /*<<< orphan*/ printf(char *);
void entry_to() {
  printf("Factory status: SHIPPING\n");
  getAddress();
}


x86 assembly (clang, -O0):
<entry_to>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getAddress@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<entry_to>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getAddress@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Factory status: SHIPPING\0A\00"
define void @entry_to() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getAddress()
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Factory status: SHIPPING\00"
define void @entry_to() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getAddress()
ret void
}
/* Type definitions */
typedef int u_int8_t;

/* Variables and functions */
int first_digit() {
  u_int8_t d = 0xef;
  u_int8_t d1 = (d >> 4);
  return d1;
}


x86 assembly (clang, -O0):
<first_digit>:
push   %rbp
mov    %rsp,%rbp
movl   $0xef,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @first_digit() {
%1 = alloca i32
%2 = alloca i32
store i32 239, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 4
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @first_digit() {
ret i32 14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
main() {
  char buffer[20];
  strcpy(buffer, "1234567899876543210012345678998765432100");
  printf("%s\n", buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rsi
lea    0xee6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeeb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"1234567899876543210012345678998765432100\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"1234567899876543210012345678998765432100\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct parameter {
  int dummy;
};

/* Variables and functions */
int com_xmatch(int, struct parameter *, int);
int com_goematch(int p, struct parameter *param) {
  return com_xmatch(p, param, 2);
}


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

x86 assembly (clang, -O2):
<com_goematch>:
mov    $0x2,%edx
jmp    1030 <com_xmatch@plt>

LLVM IR (-O0):
%struct.parameter = type { i32 }
define i32 @com_goematch(i32 %0, %struct.parameter* %1) {
%3 = alloca i32
%4 = alloca %struct.parameter*
store i32 %0, i32* %3
store %struct.parameter* %1, %struct.parameter** %4
%5 = load i32, i32* %3
%6 = load %struct.parameter*, %struct.parameter** %4
%7 = call i32 @com_xmatch(i32 %5, %struct.parameter* %6, i32 2)
ret i32 %7
}

LLVM IR (-O2):
%struct.parameter = type { i32 }
define i32 @com_goematch(i32 %0, %struct.parameter* %1) {
%3 = tail call i32 @com_xmatch(i32 %0, %struct.parameter* %1, i32 2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DFSortInternal(void *, size_t, size_t, void *,
                                  int (*)(void *, void const *, void const *),
                                  void *);
int /*<<< orphan*/ free(void *);
void *xmalloc(size_t);
void DFSort(void *base, size_t nel, size_t width, void *thunk,
            int (*compar)(void *, const void *, const void *)) {
  void *work = xmalloc(nel * width);
  DFSortInternal(base, nel, width, thunk, compar, work);
  free(work);
}


x86 assembly (clang, -O0):
<DFSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1050 <DFSortInternal@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DFSort>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%r13
mov    %rdx,%rdi
imul   %rsi,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbp
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
mov    %rax,%r9
call   1050 <DFSortInternal@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @DFSort(i8* %0, i64 %1, i64 %2, i8* %3, i32 (i8*, i8*, i8*)* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32 (i8*, i8*, i8*)*
%11 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i32 (i8*, i8*, i8*)* %4, i32 (i8*, i8*, i8*)** %10
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = mul i64 %12, %13
%15 = call i8* @xmalloc(i64 %14)
store i8* %15, i8** %11
%16 = load i8*, i8** %6
%17 = load i64, i64* %7
%18 = load i64, i64* %8
%19 = load i8*, i8** %9
%20 = load i32 (i8*, i8*, i8*)*, i32 (i8*, i8*, i8*)** %10
%21 = load i8*, i8** %11
%22 = call i32 @DFSortInternal(i8* %16, i64 %17, i64 %18, i8* %19, i32 (i8*, i8*, i8*)* %20, i8* %21)
%23 = load i8*, i8** %11
%24 = call i32 @free(i8* %23)
ret void
}

LLVM IR (-O2):
define void @DFSort(i8* %0, i64 %1, i64 %2, i8* %3, i32 (i8*, i8*, i8*)* %4) {
%6 = mul i64 %2, %1
%7 = tail call i8* @xmalloc(i64 %6)
%8 = tail call i32 @DFSortInternal(i8* %0, i64 %1, i64 %2, i8* %3, i32 (i8*, i8*, i8*)* %4, i8* %7)
%9 = tail call i32 @free(i8* %7)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int fls32(int);
int fls64(uint64_t x) {
  uint32_t h = x >> 32;
  if (h)
    return fls32(h) + 32;
  return fls32(x);
}


x86 assembly (clang, -O0):
<fls64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1145 <fls64+0x35>
mov    -0xc(%rbp),%edi
call   1030 <fls32@plt>
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <fls64+0x40>
mov    -0x8(%rbp),%edi
call   1030 <fls32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls64>:
jmp    1030 <fls32@plt>

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

LLVM IR (-O2):
define i32 @fls64(i32 %0) {
%2 = tail call i32 @fls32(i32 %0)
ret i32 %2
}
int compare_ptr(const void *aptr, const void *bptr) {
  const void *a = *(const void **)aptr;
  const void *b = *(const void **)bptr;
  if (a > b)
    return 1;
  else if (a < b)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    113c <compare_ptr+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115d <compare_ptr+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1156 <compare_ptr+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <compare_ptr+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ptr>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
cmp    %rcx,%rax
sbb    %edx,%edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_ptr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = icmp ugt i8* %4, %6
%8 = icmp ult i8* %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}