xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ erase();
int /*<<< orphan*/ nocbreak();
int /*<<< orphan*/ refresh();
void curses_stop(void) {
  erase();
  refresh();
  echo();
  nocbreak();
  endwin();
}


x86 assembly (clang, -O0):
<curses_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <erase@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x0,%al
call   1070 <nocbreak@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<curses_stop>:
push   %rax
xor    %eax,%eax
call   1040 <erase@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1030 <echo@plt>
xor    %eax,%eax
call   1070 <nocbreak@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <endwin@plt>

LLVM IR (-O0):
define void @curses_stop() {
%1 = call i32 (...) @erase()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @echo()
%4 = call i32 (...) @nocbreak()
%5 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @curses_stop() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @echo()
%4 = tail call i32 (...) @nocbreak()
%5 = tail call i32 (...) @endwin()
ret void
}
int is_nan(float v) {
  volatile float d = v;
  return d != d;
}


x86 assembly (clang, -O0):
<is_nan>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_nan>:
movss  %xmm0,-0x4(%rsp)
movss  -0x4(%rsp),%xmm0
cmpneqss -0x4(%rsp),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_nan(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
store volatile float %4, float* %3
%5 = load volatile float, float* %3
%6 = load volatile float, float* %3
%7 = fcmp une float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_nan(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
store volatile float %0, float* %2
%4 = load volatile float, float* %2
%5 = load volatile float, float* %2
%6 = fcmp une float %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int const sum_of_divisors(int const);
int is_perfect(const int num) { return num == sum_of_divisors(num); }


x86 assembly (clang, -O0):
<is_perfect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sum_of_divisors@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_perfect>:
push   %rbx
mov    %edi,%ebx
call   1030 <sum_of_divisors@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_perfect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sum_of_divisors(i32 %4)
%6 = icmp eq i32 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_perfect(i32 %0) {
%2 = tail call i32 @sum_of_divisors(i32 %0)
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
void FIQ_ISR(void) {
  for (;;) {
    ;
  }
}


x86 assembly (clang, -O0):
<FIQ_ISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <FIQ_ISR+0x9>
jmp    1109 <FIQ_ISR+0x9>

x86 assembly (clang, -O2):
<FIQ_ISR>:
jmp    1100 <FIQ_ISR>

LLVM IR (-O0):
define void @FIQ_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @FIQ_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}
void free_cookies(char **dynamic_cookies, int n_dynamic_cookies) {
  int index = 0;
  for (index = 0; index < n_dynamic_cookies; index++)
    free(dynamic_cookies[index]);
  free(dynamic_cookies);
}


x86 assembly (clang, -O0):
<free_cookies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <free_cookies+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <free_cookies+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_cookies>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_cookies+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_cookies+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_cookies(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *);
char *strdup(char *);
char *measurement_primary_where(char *station, char *datatype,
                                char *measurement_date,
                                char *measurement_time) {
  char where[512];
  sprintf(where,
          "station = '%s' and		"
          "datatype = '%s' and		"
          "measurement_date = '%s' and	"
          "measurement_time = '%s'	",
          station, datatype, measurement_date, measurement_time);
  return strdup(where);
}


x86 assembly (clang, -O0):
<measurement_primary_where>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xea7(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x220(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measurement_primary_where>:
push   %rbx
sub    $0x200,%rsp
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xec5(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [94 x i8] c"station = '%s' and\09\09datatype = '%s' and\09\09measurement_date = '%s' and\09measurement_time = '%s'\09\00"
define i8* @measurement_primary_where(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [512 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i8* %13, i8* %14)
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%17 = call i8* @strdup(i8* %16)
ret i8* %17
}

LLVM IR (-O2):
@.str = [94 x i8] c"station = '%s' and\09\09datatype = '%s' and\09\09measurement_date = '%s' and\09measurement_time = '%s'\09\00"
define noalias i8* @measurement_primary_where(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [512 x i8]
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %3)
%8 = call i8* @strdup(i8* %6)
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGSTOP;
int /*<<< orphan*/ thread_signal(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void thread_stop(pid_t pid, pid_t tid) { thread_signal(pid, tid, SIGSTOP); }


x86 assembly (clang, -O0):
<thread_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
call   1030 <thread_signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_stop>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <thread_signal@plt>

LLVM IR (-O0):
@SIGSTOP = global i32 0
define void @thread_stop(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* @SIGSTOP
%8 = call i32 @thread_signal(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@SIGSTOP = global i32 0
define void @thread_stop(i32 %0, i32 %1) {
%3 = load i32, i32* @SIGSTOP
%4 = tail call i32 @thread_signal(i32 %0, i32 %1, i32 %3)
ret void
}
int func(int *array, int *other) { return array[7] + other[5]; }


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

x86 assembly (clang, -O2):
<func>:
mov    0x14(%rsi),%eax
add    0x1c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @func(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 = getelementptr inbounds i32, i32* %5, i64 7
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 5
%10 = load i32, i32* %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @func(i32* nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 7
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %1, i64 5
%6 = load i32, i32* %5
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
char *skip_padding(char *);
void skip128(char **ptr) { *ptr = skip_padding(*ptr); }


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

x86 assembly (clang, -O2):
<skip128>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <skip_padding@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @skip128(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i8* @skip_padding(i8* %4)
%6 = load i8**, i8*** %2
store i8* %5, i8** %6
ret void
}

LLVM IR (-O2):
define void @skip128(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @skip_padding(i8* %2)
store i8* %3, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long);
char *dc_ltoa(long val) {
  static char buf[64];
  sprintf(buf, "%ld", val);
  if (*buf == '-')
    *buf = '_';
  return buf;
}


x86 assembly (clang, -O0):
<dc_ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
movsbl 0x2f06(%rip),%eax
cmp    $0x2d,%eax
jne    114a <dc_ltoa+0x3a>
movb   $0x5f,0x2ef6(%rip)
lea    0x2eef(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dc_ltoa>:
push   %rax
mov    %rdi,%rdx
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <sprintf@plt>
cmpb   $0x2d,0x2f12(%rip)
jne    1137 <dc_ltoa+0x27>
movb   $0x5f,0x2f09(%rip)
lea    0x2f02(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@dc_ltoa.buf = internal global [64 x i8] zeroinitializer
@.str = [4 x i8] c"%ld\00"
define i8* @dc_ltoa(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dc_ltoa.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = load i8, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dc_ltoa.buf, i64 0, i64 0)
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 45
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 95, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dc_ltoa.buf, i64 0, i64 0)
br label %9
9: ; preds = %8, %1
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dc_ltoa.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@dc_ltoa.buf = internal global [64 x i8] zeroinitializer
@.str = [4 x i8] c"%ld\00"
define i8* @dc_ltoa(i64 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @dc_ltoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = load i8, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dc_ltoa.buf, i64 0, i64 0)
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %6
5: ; preds = %1
store i8 95, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dc_ltoa.buf, i64 0, i64 0)
br label %6
6: ; preds = %5, %1
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dc_ltoa.buf, i64 0, i64 0)
}
int gpio_debug_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_debug_init() {
ret i32 0
}
/* Variables and functions */
float tf3(int a) { return a; }


x86 assembly (clang, -O0):
<tf3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf3>:
cvtsi2ss %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @tf3(i32 %0) {
%2 = sitofp i32 %0 to float
ret float %2
}
/* Type definitions */
struct GA4d {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct GA4d *);
freeGA4d(struct GA4d *im) { free(im); }


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

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

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

LLVM IR (-O2):
%struct.GA4d = type { i32 }
define i32 @freeGA4d(%struct.GA4d* nocapture %0) {
%2 = tail call i32 @free(%struct.GA4d* %0)
ret i32 undef
}
/* Variables and functions */
int zaxisInqLtype(int);
int zaxisInqType(int);
int ztype2ltype(int);
int zaxis2ltype(int zaxisID) {
  int ltype;
  int zaxistype;
  zaxistype = zaxisInqType(zaxisID);
  ltype = zaxisInqLtype(zaxisID);
  if (ltype <= 0)
    ltype = ztype2ltype(zaxistype);
  return (ltype);
}


x86 assembly (clang, -O0):
<zaxis2ltype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <zaxisInqType@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <zaxisInqLtype@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1166 <zaxis2ltype+0x36>
mov    -0xc(%rbp),%edi
call   1040 <ztype2ltype@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zaxis2ltype>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <zaxisInqType@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <zaxisInqLtype@plt>
test   %eax,%eax
jle    114e <zaxis2ltype+0x1e>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ztype2ltype@plt>

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

LLVM IR (-O2):
define i32 @zaxis2ltype(i32 %0) {
%2 = tail call i32 @zaxisInqType(i32 %0)
%3 = tail call i32 @zaxisInqLtype(i32 %0)
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @ztype2ltype(i32 %2)
br label %7
7: ; preds = %5, %1
%8 = phi i32 [ %6, %5 ], [ %3, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int);
int /*<<< orphan*/ scanf(char *, int *, char *, int *);
test_scanf() {
  int day, year;
  char monthname[20];
  scanf("%d %s %d", &day, monthname, &year);
  printf("%d %s %d\n", day, monthname, year);
}


x86 assembly (clang, -O0):
<test_scanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdx
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    -0x20(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scanf>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%ecx
lea    0xeb7(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %s %d\00"
@.str.1 = [10 x i8] c"%d %s %d\0A\00"
define i32 @test_scanf() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i8* %5, i32* %3)
%7 = load i32, i32* %2
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %s %d\00"
@.str.1 = [10 x i8] c"%d %s %d\0A\00"
define i32 @test_scanf() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %6, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %8, i8* %6, i32 %9)
ret i32 undef
}
void __bb_init_func(void) { return; }


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

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

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

LLVM IR (-O2):
define void @__bb_init_func() {
ret void
}
int isDalvikExecute(int opcode) {
  return ((opcode == (0xEE)) || (opcode == (0xEF)));
}


x86 assembly (clang, -O0):
<isDalvikExecute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xee,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1126 <isDalvikExecute+0x26>
cmpl   $0xef,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDalvikExecute>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0xee,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isDalvikExecute(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 238
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 239
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isDalvikExecute(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 238
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetRedVideoGain(void *, int);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPRenderingControl_GetRedVideoGain(void *upnptoken,
                                          unsigned int InstanceID) {
  printf("Invoke: UPnPRenderingControl_GetRedVideoGain(%u);\r\n", InstanceID);
  UPnPResponse_RenderingControl_GetRedVideoGain(upnptoken, 250);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetRedVideoGain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfa,%esi
call   1040 <UPnPResponse_RenderingControl_GetRedVideoGain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_GetRedVideoGain>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_GetRedVideoGain@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Invoke: UPnPRenderingControl_GetRedVideoGain(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetRedVideoGain(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_RenderingControl_GetRedVideoGain(i8* %7, i32 250)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Invoke: UPnPRenderingControl_GetRedVideoGain(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetRedVideoGain(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_RenderingControl_GetRedVideoGain(i8* %0, i32 250)
ret void
}
void MigrateMem(long *start, long length, long home) {}


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

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

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

LLVM IR (-O2):
define void @MigrateMem(i64* nocapture %0, i64 %1, i64 %2) {
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *start = str;
  while (*str)
    str++;
  return str - start;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(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 = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int main_flush(int argc, char **argv) {
  (void)argc, (void)argv;
  return 0;
}


x86 assembly (clang, -O0):
<main_flush>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main_flush(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void glGenRenderbuffers(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGenRenderbuffers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_str(int, char *);
int send_content_type(int socket, char *content_type) {
  send_str(socket, "Content-type: ");
  send_str(socket, content_type);
  send_str(socket, "\r\n");
}


x86 assembly (clang, -O0):
<send_content_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    0xed7(%rip),%rsi
call   1030 <send_str@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <send_str@plt>
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1030 <send_str@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_content_type>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xee1(%rip),%rsi
call   1030 <send_str@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <send_str@plt>
lea    0xeda(%rip),%rsi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <send_str@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Content-type: \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define i32 @send_content_type(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = call i32 @send_str(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = call i32 @send_str(i32 %8, i8* %9)
%11 = load i32, i32* %4
%12 = call i32 @send_str(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"Content-type: \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define i32 @send_content_type(i32 %0, i8* %1) {
%3 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @send_str(i32 %0, i8* %1)
%5 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
int mdp4_writeback_queue_buffer(struct fb_info *info, struct msmfb_data *data) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.fb_info = type opaque
%struct.msmfb_data = type opaque
define i32 @mdp4_writeback_queue_buffer(%struct.fb_info* %0, %struct.msmfb_data* %1) {
%3 = alloca %struct.fb_info*
%4 = alloca %struct.msmfb_data*
store %struct.fb_info* %0, %struct.fb_info** %3
store %struct.msmfb_data* %1, %struct.msmfb_data** %4
ret i32 0
}

LLVM IR (-O2):
%struct.fb_info = type opaque
%struct.msmfb_data = type opaque
define i32 @mdp4_writeback_queue_buffer(%struct.fb_info* nocapture readnone %0, %struct.msmfb_data* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sm_free(void *p) { free(p); }


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

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

LLVM IR (-O0):
define void @sm_free(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 @sm_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xe6() {
  Assert_real((isalpha(230) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1155, ("isalpha should be 0 for 0xe6"));
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_RD_BITS_PER_WORD;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int SPI_getBitsPerWord(int spidev_fd) {
  uint8_t bits_per_word;
  if (ioctl(spidev_fd, SPI_IOC_RD_BITS_PER_WORD, &bits_per_word) < 0) {
    return -1;
  }
  return bits_per_word == 0 ? 8 : bits_per_word;
}


x86 assembly (clang, -O0):
<SPI_getBitsPerWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1146 <SPI_getBitsPerWord+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <SPI_getBitsPerWord+0x59>
cmpl   $0x0,-0xc(%rbp)
jne    115d <SPI_getBitsPerWord+0x4d>
mov    $0x8,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <SPI_getBitsPerWord+0x53>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_getBitsPerWord>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
mov    $0x8,%edx
cmovne %ecx,%edx
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SPI_IOC_RD_BITS_PER_WORD = global i32 0
define i32 @SPI_getBitsPerWord(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @SPI_IOC_RD_BITS_PER_WORD
%7 = call i64 @ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %18
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %16
14: ; preds = %10
%15 = load i32, i32* %4
br label %16
16: ; preds = %14, %13
%17 = phi i32 [ 8, %13 ], [ %15, %14 ]
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@SPI_IOC_RD_BITS_PER_WORD = global i32 0
define i32 @SPI_getBitsPerWord(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @SPI_IOC_RD_BITS_PER_WORD
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 8, i32 %7
%10 = select i1 %6, i32 -1, i32 %9
ret i32 %10
}
int fft_bitlength(int x) {
  int n = 0;
  for (; x; x >>= 1)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<fft_bitlength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <fft_bitlength+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <fft_bitlength+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fft_bitlength(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = ashr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ nmstermio_set_clearscr(int);
void nmseffect_set_clearscr(int setting) { nmstermio_set_clearscr(setting); }


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

x86 assembly (clang, -O2):
<nmseffect_set_clearscr>:
jmp    1030 <nmstermio_set_clearscr@plt>

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

LLVM IR (-O2):
define void @nmseffect_set_clearscr(i32 %0) {
%2 = tail call i32 @nmstermio_set_clearscr(i32 %0)
ret void
}
/* Variables and functions */
float gb_round(float);
float gb_remainder(float x, float y) { return x - (gb_round(x / y) * y); }


x86 assembly (clang, -O0):
<gb_remainder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <gb_round@plt>
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_remainder>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
divss  %xmm1,%xmm0
call   1030 <gb_round@plt>
mulss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @gb_remainder(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* %3
%7 = load float, float* %4
%8 = fdiv float %6, %7
%9 = call float @gb_round(float %8)
%10 = load float, float* %4
%11 = fneg float %9
%12 = call float @llvm.fmuladd.f32(float %11, float %10, float %5)
ret float %12
}

LLVM IR (-O2):
define float @gb_remainder(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = tail call float @gb_round(float %3)
%5 = fneg float %4
%6 = tail call float @llvm.fmuladd.f32(float %5, float %1, float %0)
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ filepos;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ pm_tell2(int /*<<< orphan*/ *const, long *, int);
unsigned int pm_tell(FILE *const fileP) {
  long filepos;
  pm_tell2(fileP, &filepos, sizeof(filepos));
  return filepos;
}


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

x86 assembly (clang, -O2):
<pm_tell>:
push   %rax
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <pm_tell2@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pm_tell(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pm_tell2(i32* %4, i64* %3, i32 8)
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @pm_tell(i32* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @pm_tell2(i32* %0, i64* %2, i32 8)
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ init_lcm_registers();
void lcm_init(void) { init_lcm_registers(); }


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

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

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

LLVM IR (-O2):
define void @lcm_init() {
%1 = tail call i32 (...) @init_lcm_registers()
ret void
}
/* Variables and functions */
scalar_t__ read(int, unsigned char *, int);
unsigned char serial_getc(int fd) {
  unsigned char c = 0;
  if (fd > 0) {
    if (read(fd, &c, 1)) {
      return c;
    } else {
      return 0;
    }
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<serial_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1158 <serial_getc+0x48>
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
je     114f <serial_getc+0x3f>
mov    -0x9(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    115c <serial_getc+0x4c>
movb   $0x0,-0x1(%rbp)
jmp    115c <serial_getc+0x4c>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_getc>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
xor    %ebx,%ebx
test   %edi,%edi
jle    113c <serial_getc+0x2c>
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
movzbl 0xf(%rsp),%eax
cmove  %ebx,%eax
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define zeroext i8 @serial_getc(i32 %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = call i64 @read(i32 %0, i8* %2, i32 1)
%6 = icmp eq i64 %5, 0
%7 = load i8, i8* %2
%8 = select i1 %6, i8 0, i8 %7
br label %9
9: ; preds = %4, %1
%10 = phi i8 [ 0, %1 ], [ %8, %4 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ int80(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void clear() { int80(0, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <int80@plt>

LLVM IR (-O0):
define void @clear() {
%1 = call i32 @int80(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @clear() {
%1 = tail call i32 @int80(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help_save(int argc, char **argv) {
  printf("\n\033[1msave [filename]\033[0m\n"
         "  Save the configuration to the file [filename] (startup.vpc is the "
         "default filename).\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<help_save>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [113 x i8] c"\0A\1B[1msave [filename]\1B[0m\0A Save the configuration to the file [filename] (startup.vpc is the default filename).\0A\00"
define i32 @help_save(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [112 x i8] c"\0A\1B[1msave [filename]\1B[0m\0A Save the configuration to the file [filename] (startup.vpc is the default filename).\00"
define i32 @help_save(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exponant(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int sayi;
  char cevap;
  do {
    exponant(sayi);
    printf("Yeni x girilecek mi? (E/H)");
    scanf("%c", &cevap);
  } while (cevap == 'E' || cevap == 'e');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <exponant@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x45,%ecx
mov    %al,-0xa(%rbp)
je     1182 <main+0x52>
movsbl -0x9(%rbp),%eax
cmp    $0x65,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%r14
lea    0xed4(%rip),%r15
lea    0xf(%rsp),%rbx
nopl   0x0(%rax)
call   1040 <exponant@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movzbl 0xf(%rsp),%eax
and    $0xdf,%al
cmp    $0x45,%al
je     1150 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Yeni x girilecek mi? (E/H)\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %2
%6 = call i32 @exponant(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %9
9: ; preds = %4
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 69
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 101
br label %17
17: ; preds = %13, %9
%18 = phi i1 [ true, %9 ], [ %16, %13 ]
br i1 %18, label %4, label %19
19: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Yeni x girilecek mi? (E/H)\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call i32 @exponant(i32 undef)
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%6 = load i8, i8* %1
%7 = and i8 %6, -33
%8 = icmp eq i8 %7, 69
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 0
}