xunge/DecIR huggingface dataset:
/* Type definitions */
struct terminal_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal_t *, int, int /*<<< orphan*/);
void reverse_nl(struct terminal_t *term) { move_cursor(term, -1, 0); }


x86 assembly (clang, -O0):
<reverse_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
xor    %edx,%edx
call   1030 <move_cursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_nl>:
mov    $0xffffffff,%esi
xor    %edx,%edx
jmp    1030 <move_cursor@plt>

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

LLVM IR (-O2):
%struct.terminal_t = type { i32 }
define void @reverse_nl(%struct.terminal_t* %0) {
%2 = tail call i32 @move_cursor(%struct.terminal_t* %0, i32 -1, i32 0)
ret void
}
signed long signedlong_ignoring_longlongint(signed long x, long long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @signedlong_ignoring_longlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ PRIO_PROCESS;
int getpriority(int /*<<< orphan*/, int);
int nice(int pid) { return getpriority(PRIO_PROCESS, pid); }


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

x86 assembly (clang, -O2):
<nice>:
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getpriority@plt>

LLVM IR (-O0):
@PRIO_PROCESS = global i32 0
define i32 @nice(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PRIO_PROCESS
%4 = load i32, i32* %2
%5 = call i32 @getpriority(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@PRIO_PROCESS = global i32 0
define i32 @nice(i32 %0) {
%2 = load i32, i32* @PRIO_PROCESS
%3 = tail call i32 @getpriority(i32 %2, i32 %0)
ret i32 %3
}
int findCurveType(int a, int b, int c) {
  int type = 0;
  if (a == 0 && b == 0)
    type = 3;
  else if (a == 0)
    type = 2;
  else
    type = 1;
  return type;
}


x86 assembly (clang, -O0):
<findCurveType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1134 <findCurveType+0x34>
cmpl   $0x0,-0x8(%rbp)
jne    1134 <findCurveType+0x34>
movl   $0x3,-0x10(%rbp)
jmp    1156 <findCurveType+0x56>
cmpl   $0x0,-0x4(%rbp)
jne    114a <findCurveType+0x4a>
movl   $0x2,-0x10(%rbp)
jmp    1151 <findCurveType+0x51>
movl   $0x1,-0x10(%rbp)
jmp    1156 <findCurveType+0x56>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findCurveType>:
cmp    $0x1,%edi
mov    $0x1,%ecx
adc    $0x0,%ecx
or     %edi,%esi
mov    $0x3,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findCurveType(i32 %0, i32 %1, i32 %2) {
%4 = or i32 %1, %0
%5 = icmp eq i32 %4, 0
%6 = icmp eq i32 %0, 0
%7 = select i1 %6, i32 2, i32 1
%8 = select i1 %5, i32 3, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(void) {
  for (;;) {
    sleep(10);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <sleep@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <sleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @sleep(i32 10)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sleep(i32 10)
br label %1
}
int get_severity(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @get_severity() {
ret i32 1
}

LLVM IR (-O2):
define i32 @get_severity() {
ret i32 1
}
/* Variables and functions */
double li2(double);
double dilog(double x) { return li2(x); }


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

x86 assembly (clang, -O2):
<dilog>:
jmp    1030 <li2@plt>

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

LLVM IR (-O2):
define double @dilog(double %0) {
%2 = tail call double @li2(double %0)
ret double %2
}
char *decode_fd_type(int type) {
  if (type == 0)
    return "FD_STDIN";
  if (type == 1)
    return "FD_REGULAR_FILE";
  return "Unknown";
}


x86 assembly (clang, -O0):
<decode_fd_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <decode_fd_type+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <decode_fd_type+0x46>
cmpl   $0x1,-0xc(%rbp)
jne    113b <decode_fd_type+0x3b>
lea    0xed7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <decode_fd_type+0x46>
lea    0xed7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_fd_type>:
cmp    $0x1,%edi
lea    0xeff(%rip),%rax
lea    0xf08(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"FD_STDIN\00"
@.str.1 = [16 x i8] c"FD_REGULAR_FILE\00"
@.str.2 = [8 x i8] c"Unknown\00"
define i8* @decode_fd_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"FD_STDIN\00"
@.str.1 = [16 x i8] c"FD_REGULAR_FILE\00"
@.str.2 = [8 x i8] c"Unknown\00"
define i8* @decode_fd_type(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void *ignore() { return 1024; }


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

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

LLVM IR (-O0):
define i8* @ignore() {
ret i8* inttoptr (i64 1024 to i8*)
}

LLVM IR (-O2):
define i8* @ignore() {
ret i8* inttoptr (i64 1024 to i8*)
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1141 <gcd+0x31>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0xc(%rbp)
jmp    1147 <gcd+0x37>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ outfmt(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ strlen(char const *);
void ch_screen_message(const char *message) {
  outfmt(strlen(message), "%s\n", message);
}


x86 assembly (clang, -O0):
<ch_screen_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
lea    0xebe(%rip),%rsi
call   1040 <outfmt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_screen_message>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0xed0(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <outfmt@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @ch_screen_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @outfmt(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @ch_screen_message(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @outfmt(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int vsprintf(char *, char const *, int /*<<< orphan*/);
int vsprintf_l(char *str, locale_t l, const char *fmt, va_list args) {
  return vsprintf(str, fmt, args);
}


x86 assembly (clang, -O0):
<vsprintf_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <vsprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf_l>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <vsprintf@plt>

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

LLVM IR (-O2):
define i32 @vsprintf_l(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsprintf(i8* %0, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int strspn(char *, char *);
char *gobble_spaces(char *string) {
  int num;
  num = strspn(string, " \t");
  return string + num;
}


x86 assembly (clang, -O0):
<gobble_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strspn@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gobble_spaces>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strspn@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
define i8* @gobble_spaces(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strspn(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define i8* @gobble_spaces(i8* %0) {
%2 = tail call i32 @strspn(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
int test_03(unsigned char *x, int y, int z) { return ((x[0] << 3) & 192) == 0; }


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x3,%eax
and    $0xc0,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
xor    %eax,%eax
testb  $0x18,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @test_03(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 3
%12 = and i32 %11, 192
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_03(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, 24
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int xmlIsMainThread(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @xmlIsMainThread() {
ret i32 1
}

LLVM IR (-O2):
define i32 @xmlIsMainThread() {
ret i32 1
}
signed char cstylecast_3(signed int x) { return (signed char)x; }


x86 assembly (clang, -O0):
<cstylecast_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstylecast_3>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @cstylecast_3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @cstylecast_3(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_regspace2_uniform_64k(struct flashctx *);
int printlock_w39v040b(struct flashctx *);
int printlock_w39v040fb(struct flashctx *flash) {
  int ret = 0;
  ret = printlock_w39v040b(flash);
  ret |= printlock_regspace2_uniform_64k(flash);
  return ret;
}


x86 assembly (clang, -O0):
<printlock_w39v040fb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printlock_w39v040b@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printlock_regspace2_uniform_64k@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlock_w39v040fb>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <printlock_w39v040b@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <printlock_regspace2_uniform_64k@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040fb(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
%3 = alloca i32
store %struct.flashctx* %0, %struct.flashctx** %2
store i32 0, i32* %3
%4 = load %struct.flashctx*, %struct.flashctx** %2
%5 = call i32 @printlock_w39v040b(%struct.flashctx* %4)
store i32 %5, i32* %3
%6 = load %struct.flashctx*, %struct.flashctx** %2
%7 = call i32 @printlock_regspace2_uniform_64k(%struct.flashctx* %6)
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040fb(%struct.flashctx* %0) {
%2 = tail call i32 @printlock_w39v040b(%struct.flashctx* %0)
%3 = tail call i32 @printlock_regspace2_uniform_64k(%struct.flashctx* %0)
%4 = or i32 %3, %2
ret i32 %4
}
f() {
  extern f();
  extern (*p)();
  extern d(int (*)());
  d(f);
  d(p);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rdi
call   1030 <d@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%rdi
call   1030 <d@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    0x2ec8(%rip),%rdi
call   1030 <d@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%rdi
pop    %rax
jmp    1030 <d@plt>

LLVM IR (-O0):
@p = external global i32 (...)*
define i32 @f() {
%1 = alloca i32
%2 = call i32 @d(i32 (...)* bitcast (i32 ()* @f to i32 (...)*))
%3 = load i32 (...)*, i32 (...)** @p
%4 = call i32 @d(i32 (...)* %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@p = external global i32 (...)*
define i32 @f() {
%1 = tail call i32 @d(i32 (...)* bitcast (i32 ()* @f to i32 (...)*))
%2 = load i32 (...)*, i32 (...)** @p
%3 = tail call i32 @d(i32 (...)* %2)
ret i32 undef
}
int is_null(const char *line) {
  char *i = (char *)line;
  for (; *i != '\0'; i++)
    if (*i != ' ')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <is_null+0x52>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     113c <is_null+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1159 <is_null+0x59>
jmp    1141 <is_null+0x41>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <is_null+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_null>:
movzbl (%rdi),%eax
cmp    $0x20,%al
jne    110d <is_null+0xd>
add    $0x1,%rdi
jmp    1100 <is_null>
test   %al,%al
jne    1117 <is_null+0x17>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_null(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %8
i8 32, label %5
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ p;

/* Variables and functions */
uint32_t scrypt_be32dec(const void *pp) {
  const uint8_t *p = (uint8_t const *)pp;
  return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
          ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
}


x86 assembly (clang, -O0):
<scrypt_be32dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrypt_be32dec>:
mov    0x10(%rdi),%ecx
shl    $0x8,%ecx
add    0x18(%rdi),%ecx
mov    (%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
add    %ecx,%edx
shl    $0x18,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @scrypt_be32dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 3
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %9, %14
%16 = load i64*, i64** %3
%17 = getelementptr inbounds i64, i64* %16, i64 1
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 16
%21 = add nsw i32 %15, %20
%22 = load i64*, i64** %3
%23 = getelementptr inbounds i64, i64* %22, i64 0
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = shl i32 %25, 24
%27 = add nsw i32 %21, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @scrypt_be32dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 16
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %11, %6
%13 = getelementptr inbounds i8, i8* %0, i64 8
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = add nsw i32 %12, %17
%19 = load i64, i64* %2
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 24
%22 = add nsw i32 %18, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handle_latch(void) { printf("LATCH\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"LATCH\00"
define void @handle_latch() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x9b() {
  Assert_real((isxdigit(155) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              780, ("isxdigit should be 0 for 0x9b"));
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fesetexceptflag(int *, int);
int feraiseexcept(int __excepts) {
  fexcept_t __ex = __excepts;
  fesetexceptflag(&__ex, __excepts);
  return 0;
}


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

x86 assembly (clang, -O2):
<feraiseexcept>:
push   %rax
mov    %edi,%esi
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <fesetexceptflag@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @feraiseexcept(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 %0, i32* %2
%4 = call i32 @fesetexceptflag(i32* %2, i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char string_1[] = "Halli Hallo";
  char string_2[20];
  int index = 0;
  while ((string_2[index] = string_1[index]) != '\0') {
    index += 1;
  }
  printf("string_2 = %s\n", string_2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
movslq -0x34(%rbp),%rax
mov    -0x10(%rbp,%rax,1),%al
movslq -0x34(%rbp),%rcx
mov    %al,-0x30(%rbp,%rcx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1164 <main+0x54>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113a <main+0x2a>
lea    -0x30(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x614820696c6c6148,%rax
20 48 61
mov    %rax,(%rsp)
movl   $0x6f6c6c,0x8(%rsp)
lea    0xedb(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.string_1 = [12 x i8] c"Halli Hallo\00"
@.str = [15 x i8] c"string_2 = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [20 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [12 x i8]* %2 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %12
store i8 %10, i8* %13
%14 = sext i8 %10 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %6
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string_1 = [12 x i8] c"Halli Hallo\00"
@.str = [15 x i8] c"string_2 = %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 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char *strdup(char *);
char *get_question() {
  char answer[512];
  char *ans;
  printf("Write question: ");
  scanf("%s", answer);
  ans = strdup(answer);
  return ans;
}


x86 assembly (clang, -O0):
<get_question>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    -0x200(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x200(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x208(%rbp)
mov    -0x208(%rbp),%rax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_question>:
push   %rbx
sub    $0x200,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Write question: \00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @get_question() {
%1 = alloca [512 x i8]
%2 = alloca i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [17 x i8] c"Write question: \00"
@.str.1 = [3 x i8] c"%s\00"
define noalias i8* @get_question() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i8* @strdup(i8* %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ segundo(char *);
int main() {
  segundo("estudiantes");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"estudiantes\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @segundo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"estudiantes\00"
define i32 @main() {
%1 = tail call i32 @segundo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ errx(char *, char *, int, char *);
void lsd_fatal_error(char *file, int line, char *mesg) {
  errx("%p: %s:%d: %s\n", file, line, mesg);
}


x86 assembly (clang, -O0):
<lsd_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <errx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsd_fatal_error>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%p: %s:%d: %s\0A\00"
define void @lsd_fatal_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @errx(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%p: %s:%d: %s\0A\00"
define void @lsd_fatal_error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @errx(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmd_usage_generate(void) {
  printf("usage: mdp gen[erate] [-h] [-p profile] [-n count] "
         "[-l length]\n");
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"usage: mdp gen[erate] [-h] [-p profile] [-n count] [-l length]\0A\00"
define void @cmd_usage_generate() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"usage: mdp gen[erate] [-h] [-p profile] [-n count] [-l length]\00"
define void @cmd_usage_generate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int wiringPiSetupSys() {
  printf("wiringPiSetupSys\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"wiringPiSetupSys\00"
define i32 @wiringPiSetupSys() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int main() {
  run_func(20, 20, 0, 20);
  asm volatile(".byte 0xd6" : : "a"(0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%ecx
xor    %edx,%edx
mov    %ecx,%edi
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <run_func@plt>
xor    %eax,%eax
(bad)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
mov    $0x14,%esi
xor    %edx,%edx
mov    $0x14,%ecx
xor    %eax,%eax
call   1030 <run_func@plt>
xor    %eax,%eax
(bad)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @run_func to i32 (i32, i32, i32, i32, ...)*)(i32 20, i32 20, i32 0, i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @run_func to i32 (i32, i32, i32, i32, ...)*)(i32 20, i32 20, i32 0, i32 20)
tail call void asm sideeffect ".byte 0xd6", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
int sscanf(char const *, char *, double *, double *, double *);
int main(void) {
  const char *p = "-0.500000 -0.500001 0.530002";
  int n;
  double f1, f2, f3;
  n = sscanf(p, "%lf  %lf  %lf", &f1, &f2, &f3);
  printf("%lf  %lf  %lf\n", f1, f2, f3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed8(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
call   1040 <sscanf@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
call   1040 <sscanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"-0.500000 -0.500001 0.530002\00"
@.str.1 = [14 x i8] c"%lf %lf %lf\00"
@.str.2 = [15 x i8] c"%lf %lf %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double* %4, double* %5, double* %6)
store i32 %8, i32* %3
%9 = load double, double* %4
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %9, double %10, double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"-0.500000 -0.500001 0.530002\00"
@.str.1 = [14 x i8] c"%lf %lf %lf\00"
@.str.2 = [15 x i8] c"%lf %lf %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @sscanf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %1
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %8, double %9, double %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128InterruptPinP__3__Irq__default__fired();
void HplAtm128InterruptPinP__3__Irq__fired(void) {
  HplAtm128InterruptPinP__3__Irq__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128InterruptPinP__3__Irq__fired() {
%1 = tail call i32 (...) @HplAtm128InterruptPinP__3__Irq__default__fired()
ret void
}
/* Variables and functions */
double genchi(double);
void chis_rndc(int n, double dof, double *array) {
  int i;
  for (i = 0; i < n; i++)
    *(array + i) = genchi(dof);
}


x86 assembly (clang, -O0):
<chis_rndc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115c <chis_rndc+0x4c>
movsd  -0x10(%rbp),%xmm0
call   1030 <genchi@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <chis_rndc+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chis_rndc>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
jle    114a <chis_rndc+0x3a>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
movsd  %xmm0,0x8(%rsp)
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
call   1030 <genchi@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <chis_rndc+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @chis_rndc(i32 %0, double %1, double* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = tail call double @genchi(double %1)
%10 = getelementptr inbounds double, double* %2, i64 %8
store double %9, double* %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putenv(char *);
char *realloc(int /*<<< orphan*/ *, size_t);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *, int);
int strlen(char const *);
void int_to_env(const char *name, int value) {
  size_t len = 12 + strlen(name);
  char *buf = realloc(NULL, len);
  snprintf(buf, len, "%s=%d", name, value);
  putenv(buf);
}


x86 assembly (clang, -O0):
<int_to_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0xc,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1060 <realloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
lea    0xe77(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <putenv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_env>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1030 <strlen@plt>
add    $0xc,%eax
movslq %eax,%rbp
xor    %edi,%edi
mov    %rbp,%rsi
call   1060 <realloc@plt>
mov    %rax,%rbx
lea    0xe94(%rip),%rdx
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r15,%rcx
mov    %r14d,%r8d
call   1040 <snprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <putenv@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s=%d\00"
define void @int_to_env(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 12, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = call i8* @realloc(i32* null, i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i64, i64* %5
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = call i32 @snprintf(i8* %13, i64 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16)
%18 = load i8*, i8** %6
%19 = call i32 @putenv(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s=%d\00"
define void @int_to_env(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 12
%5 = sext i32 %4 to i64
%6 = tail call i8* @realloc(i32* null, i64 %5)
%7 = tail call i32 @snprintf(i8* %6, i64 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%8 = tail call i32 @putenv(i8* %6)
ret void
}
void PEM_read_bio_PrivateKey(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_read_bio_PrivateKey() {
ret void
}
char *getSectorData(char *data, int tracknum, int sectornum) {
  return &data[((tracknum & 0x1F) * (64 * 256)) + ((sectornum & 0x3F) * 256)];
}


x86 assembly (clang, -O0):
<getSectorData>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
shl    $0xe,%ecx
mov    -0x10(%rbp),%edx
and    $0x3f,%edx
shl    $0x8,%edx
add    %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSectorData>:
and    $0x1f,%esi
shl    $0xe,%esi
and    $0x3f,%edx
shl    $0x8,%edx
lea    (%rdx,%rsi,1),%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @getSectorData(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = and i32 %8, 31
%10 = mul nsw i32 %9, 16384
%11 = load i32, i32* %6
%12 = and i32 %11, 63
%13 = mul nsw i32 %12, 256
%14 = add nsw i32 %10, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %7, i64 %15
ret i8* %16
}

LLVM IR (-O2):
define i8* @getSectorData(i8* readnone %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 14
%5 = and i32 %4, 507904
%6 = shl i32 %2, 8
%7 = and i32 %6, 16128
%8 = or i32 %7, %5
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
ret i8* %10
}