xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void signal_init() { signal(SIGINT, SIG_IGN); }


x86 assembly (clang, -O0):
<signal_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_init>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
define void @signal_init() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
define void @signal_init() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
ret void
}
double OP_GreaterThanEqual(double op1, double op2) { return op1 >= op2; }


x86 assembly (clang, -O0):
<OP_GreaterThanEqual>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP_GreaterThanEqual>:
cmplesd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @OP_GreaterThanEqual(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oge double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @OP_GreaterThanEqual(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
float RadToDeg(float angleRadians) {
  return angleRadians * (float)3.14159265358979323846 / 180.0f;
}


x86 assembly (clang, -O0):
<RadToDeg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RadToDeg>:
mulss  0xef8(%rip),%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @RadToDeg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x400921FB60000000
%5 = fdiv float %4, 1.800000e+02
ret float %5
}

LLVM IR (-O2):
define float @RadToDeg(float %0) {
%2 = fmul float %0, 0x400921FB60000000
%3 = fdiv float %2, 1.800000e+02
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ CloseAllBatchSources(void *);
int ExitBatch(void *theEnv, int num) {
  CloseAllBatchSources(theEnv);
  return (1);
}


x86 assembly (clang, -O0):
<ExitBatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CloseAllBatchSources@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExitBatch>:
push   %rax
call   1030 <CloseAllBatchSources@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ExitBatch(i8* %0, i32 %1) {
%3 = tail call i32 @CloseAllBatchSources(i8* %0)
ret i32 1
}
int execute_pciconfig_iobase() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_pciconfig_iobase() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_bss();
int /*<<< orphan*/ check_data();
int /*<<< orphan*/ check_sbrk();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("zero: phase 1: checking .bss\n");
  check_data();
  check_bss();
  printf("zero: phase 2: checking sbrk()\n");
  check_sbrk();
  printf("zero: passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <check_data@plt>
mov    $0x0,%al
call   1060 <check_bss@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <check_sbrk@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <check_data@plt>
xor    %eax,%eax
call   1060 <check_bss@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <check_sbrk@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"zero: phase 1: checking .bss\0A\00"
@.str.1 = [32 x i8] c"zero: phase 2: checking sbrk()\0A\00"
@.str.2 = [14 x i8] c"zero: passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @check_data()
%4 = call i32 (...) @check_bss()
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @check_sbrk()
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"zero: phase 1: checking .bss\00"
@str.3 = [31 x i8] c"zero: phase 2: checking sbrk()\00"
@str.4 = [13 x i8] c"zero: passed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @check_data()
%3 = tail call i32 (...) @check_bss()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 (...) @check_sbrk()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int /*<<< orphan*/ swprintf(char *, size_t, char const *);
void uninitvar_swprintf(void) {
  wchar_t *s;
  size_t n;
  const wchar_t *format;
  (void)swprintf(s, n, format);
}


x86 assembly (clang, -O0):
<uninitvar_swprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <swprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_swprintf>:
jmp    1030 <swprintf@plt>

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

LLVM IR (-O2):
define void @uninitvar_swprintf() {
%1 = tail call i32 @swprintf(i8* undef, i64 undef, i8* undef)
ret void
}
void DebugMsg(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @DebugMsg(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void uninitvar_exit(void) {
  int i;
  exit(i);
}


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

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

LLVM IR (-O0):
define void @uninitvar_exit() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
define void @uninitvar_exit() {
%1 = tail call i32 @exit(i32 undef)
unreachable
}
void intermission_render(void) {}


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

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

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

LLVM IR (-O2):
define void @intermission_render() {
ret void
}
double utl_make_mult(int digits) {
  double rtn;
  if (digits < 1)
    return (0.0);
  rtn = 1.0;
  while (digits-- > 1)
    rtn *= 10.0;
  return (rtn);
}


x86 assembly (clang, -O0):
<utl_make_mult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    111e <utl_make_mult+0x1e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1160 <utl_make_mult+0x60>
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x1,%eax
jle    1156 <utl_make_mult+0x56>
movsd  0xec1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    112b <utl_make_mult+0x2b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<utl_make_mult>:
test   %edi,%edi
jle    1112 <utl_make_mult+0x12>
cmp    $0x1,%edi
jne    1116 <utl_make_mult+0x16>
movsd  0xeef(%rip),%xmm0
ret
xorps  %xmm0,%xmm0
ret
add    $0x1,%edi
movsd  0xedf(%rip),%xmm0
movsd  0xedf(%rip),%xmm1
nopl   0x0(%rax)
mulsd  %xmm1,%xmm0
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     1130 <utl_make_mult+0x30>
ret

LLVM IR (-O0):
define double @utl_make_mult(i32 %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %18
8: ; preds = %1
store double 1.000000e+00, double* %4
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -1
store i32 %11, i32* %3
%12 = icmp sgt i32 %10, 1
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load double, double* %4
%15 = fmul double %14, 1.000000e+01
store double %15, double* %4
br label %9
16: ; preds = %9
%17 = load double, double* %4
store double %17, double* %2
br label %18
18: ; preds = %16, %7
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @utl_make_mult(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 1
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi double [ %9, %5 ], [ 1.000000e+00, %3 ]
%7 = phi i32 [ %8, %5 ], [ %0, %3 ]
%8 = add nsw i32 %7, -1
%9 = fmul double %6, 1.000000e+01
%10 = icmp ugt i32 %7, 2
br i1 %10, label %5, label %11
11: ; preds = %5, %3, %1
%12 = phi double [ 0.000000e+00, %1 ], [ 1.000000e+00, %3 ], [ %9, %5 ]
ret double %12
}
int isEmptyStack(int bottom, int top) { return (bottom == -1 && top == -1); }


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

x86 assembly (clang, -O2):
<isEmptyStack>:
and    %esi,%edi
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isEmptyStack(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
void XtAppAddActionHook() {}


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

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

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

LLVM IR (-O2):
define void @XtAppAddActionHook() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int invoke_raw_read(int, int /*<<< orphan*/ *, int);
bool invoke_recv_msg(int fd, uint32_t *msg) {
  const int result = invoke_raw_read(fd, msg, sizeof(*msg));
  ;
  return (0 == result);
}


x86 assembly (clang, -O0):
<invoke_recv_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <invoke_raw_read@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invoke_recv_msg>:
push   %rax
mov    $0x4,%edx
call   1030 <invoke_raw_read@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @invoke_recv_msg(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = load i32*, i32** %4
%8 = call i32 @invoke_raw_read(i32 %6, i32* %7, i32 4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 0, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @invoke_recv_msg(i32 %0, i32* %1) {
%3 = tail call i32 @invoke_raw_read(i32 %0, i32* %1, i32 4)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char const *, char);
int char_is_one_of(const char *list, char c) {
  return c != '\0' && strchr(list, c) != NULL;
}


x86 assembly (clang, -O0):
<char_is_one_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     114b <char_is_one_of+0x3b>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_is_one_of>:
test   %sil,%sil
je     112f <char_is_one_of+0x1f>
push   %rax
movsbl %sil,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @char_is_one_of(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %4
%11 = call i32* @strchr(i8* %9, i8 signext %10)
%12 = icmp ne i32* %11, null
br label %13
13: ; preds = %8, %2
%14 = phi i1 [ false, %2 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @char_is_one_of(i8* %0, i8 signext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32* @strchr(i8* %0, i8 signext %1)
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ read(char *, int);
void scanf(char *buffer, int bytes) { read(buffer, bytes); }


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

x86 assembly (clang, -O2):
<scanf>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define void @scanf(i8* %0, i32 %1) {
%3 = tail call i32 @read(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
char *setlocale(int /*<<< orphan*/, int /*<<< orphan*/ *);
const char *get_current_locale_str(void) {
  char const *loc_str = setlocale(LC_ALL, NULL);
  return loc_str ? loc_str : "unknown";
}


x86 assembly (clang, -O0):
<get_current_locale_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setlocale@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <get_current_locale_str+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1156 <get_current_locale_str+0x46>
lea    0xeb3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1156 <get_current_locale_str+0x46>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_locale_str>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setlocale@plt>
test   %rax,%rax
lea    0xed5(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [8 x i8] c"unknown\00"
define i8* @get_current_locale_str() {
%1 = alloca i8*
%2 = load i32, i32* @LC_ALL
%3 = call i8* @setlocale(i32 %2, i32* null)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i8*, i8** %1
br label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %6
%10 = phi i8* [ %7, %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %8 ]
ret i8* %10
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [8 x i8] c"unknown\00"
define i8* @get_current_locale_str() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i8* @setlocale(i32 %1, i32* null)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
int monkey_samples_per_frame(unsigned int versionid,
                             unsigned int compressionlevel) {
  if (versionid >= 3950) {
    return 294912;
  } else if (versionid >= 3900) {
    return 73728;
  } else if ((versionid >= 3800) && (compressionlevel == 4000)) {
    return 73728;
  } else {
    return 9216;
  }
}


x86 assembly (clang, -O0):
<monkey_samples_per_frame>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xf6e,-0x8(%rbp)
jb     1123 <monkey_samples_per_frame+0x23>
movl   $0x48000,-0x4(%rbp)
jmp    1169 <monkey_samples_per_frame+0x69>
cmpl   $0xf3c,-0x8(%rbp)
jb     113c <monkey_samples_per_frame+0x3c>
movl   $0x12000,-0x4(%rbp)
jmp    1169 <monkey_samples_per_frame+0x69>
cmpl   $0xed8,-0x8(%rbp)
jb     1162 <monkey_samples_per_frame+0x62>
cmpl   $0xfa0,-0xc(%rbp)
jne    1162 <monkey_samples_per_frame+0x62>
movl   $0x12000,-0x4(%rbp)
jmp    1169 <monkey_samples_per_frame+0x69>
movl   $0x2400,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<monkey_samples_per_frame>:
mov    $0x48000,%eax
cmp    $0xf6d,%edi
ja     1136 <monkey_samples_per_frame+0x36>
mov    $0x12000,%eax
cmp    $0xf3b,%edi
ja     1136 <monkey_samples_per_frame+0x36>
cmp    $0xfa0,%esi
mov    $0x12000,%eax
mov    $0x2400,%ecx
cmovne %ecx,%eax
cmp    $0xed8,%edi
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @monkey_samples_per_frame(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, 3949
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp ugt i32 %0, 3899
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = icmp ugt i32 %0, 3799
%8 = icmp eq i32 %1, 4000
%9 = and i1 %7, %8
%10 = select i1 %9, i32 73728, i32 9216
br label %11
11: ; preds = %6, %4, %2
%12 = phi i32 [ 294912, %2 ], [ 73728, %4 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
unsigned long long __normal___umoddi3(unsigned long long, unsigned long long);
unsigned long long __wrap___umoddi3(unsigned long long a,
                                    unsigned long long b) {
  return __normal___umoddi3(a, b);
}


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

x86 assembly (clang, -O2):
<__wrap___umoddi3>:
jmp    1030 <__normal___umoddi3@plt>

LLVM IR (-O0):
define i64 @__wrap___umoddi3(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
%6 = load i64, i64* %4
%7 = call i64 @__normal___umoddi3(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__wrap___umoddi3(i64 %0, i64 %1) {
%3 = tail call i64 @__normal___umoddi3(i64 %0, i64 %1)
ret i64 %3
}
unsigned long skip_list_ln2(unsigned long n) {
  register unsigned long i = 0;
  while (n) {
    i++;
    n >>= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<skip_list_ln2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <skip_list_ln2+0x38>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <skip_list_ln2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_list_ln2>:
xor    %eax,%eax
test   %rdi,%rdi
je     1120 <skip_list_ln2+0x20>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <skip_list_ln2+0x10>
ret

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

LLVM IR (-O2):
define i64 @skip_list_ln2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i64 %4, 1
%7 = lshr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %10
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char *, struct stat *);
int isdir(char *fp) {
  struct stat st;
  stat(fp, &st);
  return S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<isdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isdir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @S_ISDIR(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isdir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @S_ISDIR(i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf(""
         "Usage: dmapprint [options] [file]\n"
         "\n"
         "Reads Digital Media Access Protocol (DMAP) input from a file or "
         "standard input\n"
         "and prints it in a human-readable format.\n"
         "\n"
         "Options:\n"
         "  -h, --help       Show this help message and exit\n"
         "  -r, --raw-codes  Don't map content codes to human-readable names\n"
         "      --version    Show the version and exit \n");
}


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

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

LLVM IR (-O0):
@.str = [331 x i8] c"Usage: dmapprint [options] [file]\0A\0AReads Digital Media Access Protocol (DMAP) input from a file or standard input\0Aand prints it in a human-readable format.\0A\0AOptions:\0A -h, --help Show this help message and exit\0A -r, --raw-codes Don't map content codes to human-readable names\0A --version Show the version and exit \0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [330 x i8] c"Usage: dmapprint [options] [file]\0A\0AReads Digital Media Access Protocol (DMAP) input from a file or standard input\0Aand prints it in a human-readable format.\0A\0AOptions:\0A -h, --help Show this help message and exit\0A -r, --raw-codes Don't map content codes to human-readable names\0A --version Show the version and exit \00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([330 x i8], [330 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int sprintf(char *, char const *, char const *);
char *msg_app_str(const char *msg1, const char *msg2) {
  char *p = malloc(200);
  int b = sprintf(p, msg1, msg2);
  return p;
}


x86 assembly (clang, -O0):
<msg_app_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_app_str>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @msg_app_str(i8* nocapture %0, i8* %1) {
%3 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ SetUpMemBanks();
void MemOverlay_ChangeNtfy(void) { SetUpMemBanks(); }


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

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

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

LLVM IR (-O2):
define void @MemOverlay_ChangeNtfy() {
%1 = tail call i32 (...) @SetUpMemBanks()
ret void
}
/* Variables and functions */
size_t strlen(const char *p) {
  size_t len = 0;
  while (*p++)
    len++;
  return len;
}


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

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rev8(uint8_t d) {
  int i;
  uint8_t out = 0;
  for (i = 0; i < 8; i++)
    if (d & (1 << i))
      out |= (1 << (7 - i));
  return out;
}


x86 assembly (clang, -O0):
<rev8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1161 <rev8+0x61>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     114e <rev8+0x4e>
mov    $0x7,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <rev8+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <rev8+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev8>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @rev8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = shl i32 1, %10
%12 = and i32 %9, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i32, i32* %3
%16 = sub nsw i32 7, %15
%17 = shl i32 1, %16
%18 = load i32, i32* %4
%19 = or i32 %18, %17
store i32 %19, i32* %4
br label %20
20: ; preds = %14, %8
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %5
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @rev8(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
void $Sub$$_sys_exit(int rc) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<$Sub$$_sys_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <$Sub$$_sys_exit+0x7>

x86 assembly (clang, -O2):
<$Sub$$_sys_exit>:
jmp    1100 <$Sub$$_sys_exit>

LLVM IR (-O0):
define void @"$Sub$$_sys_exit"(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @"$Sub$$_sys_exit"(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
void *calloc(int, size_t);
void *ne_alloc(size_t size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<ne_alloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @ne_alloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
char *readline();
char *readline_with_prompt(const char *prompt) {
  printf("%s: ", prompt);
  return readline();
}


x86 assembly (clang, -O0):
<readline_with_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <readline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline_with_prompt>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <readline@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
define i8* @readline_with_prompt(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8* (...) @readline()
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x82() {
  Assert_real((isalpha(130) == 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",
              655, ("isalpha should be 0 for 0x82"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x82>:
push   %rax
mov    $0x82,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28f,%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 0x82\00"
define void @t_isalpha_0x82() {
%1 = call i64 @isalpha(i32 130)
%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 655, 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 0x82\00"
define void @t_isalpha_0x82() {
%1 = tail call i64 @isalpha(i32 130)
%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 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void irc_deop(char *channel, char *nick) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s -o %s", "MODE", channel, nick);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_deop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x1fd,%esi
lea    0xeb2(%rip),%rdx
lea    0xeb7(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_deop>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xecb(%rip),%rdx
lea    0xed0(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s %s -o %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_deop(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%11 = call i32 @net_send(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s %s -o %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_deop(i8* %0, i8* %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @net_send(i8* %4)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_initialize_standard_solution(int idx, int verbose) {
  int fail;
  int pars[2];
  double *c;
  pars[0] = 0;
  pars[1] = idx;
  fail = _ada_use_c2phc4c(861, pars, &verbose, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_initialize_standard_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x14(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x35d,%edi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_initialize_standard_solution>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
movl   $0x0,0x10(%rsp)
mov    %edi,0x14(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x35d,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @padcon_initialize_standard_solution(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i32]
%7 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 0, i32* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %9, i32* %10
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%12 = load double*, double** %7
%13 = call i32 @_ada_use_c2phc4c(i32 861, i32* %11, i32* %4, double* %12, i32 0)
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @padcon_initialize_standard_solution(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %1, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %0, i32* %7
%8 = call i32 @_ada_use_c2phc4c(i32 861, i32* %6, i32* %3, double* undef, i32 0)
ret i32 %8
}
/* Variables and functions */
int f1(int *);
__attribute__((bnd_legacy)) int f2(int *p) { return f1(p); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <f1@plt>

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

LLVM IR (-O2):
define i32 @f2(i32* %0) {
%2 = tail call i32 @f1(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int write(int, void const *, int);
void dev_write(int fd, const void *buf, int count) {
  int i;
  i = write(fd, buf, count);
  if (i != count) {
    printf("Write failed\n");
    exit(5);
  }
}


x86 assembly (clang, -O0):
<dev_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1176 <dev_write+0x46>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_write>:
push   %rbx
mov    %edx,%ebx
call   1040 <write@plt>
cmp    %ebx,%eax
jne    113e <dev_write+0xe>
pop    %rbx
ret
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Write failed\0A\00"
define void @dev_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 5)
unreachable
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Write failed\00"
define void @dev_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, %2
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 5)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int __libc_fcntl(int, int, void *);
int /*<<< orphan*/ pthread_testcancel();
int fcntl(int fd, int cmd, void *arg) {
  pthread_testcancel();
  return __libc_fcntl(fd, cmd, arg);
}


x86 assembly (clang, -O0):
<fcntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_testcancel@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <__libc_fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <pthread_testcancel@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <__libc_fcntl@plt>

LLVM IR (-O0):
define i32 @fcntl(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 (...) @pthread_testcancel()
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @__libc_fcntl(i32 %8, i32 %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @fcntl(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 (...) @pthread_testcancel()
%5 = tail call i32 @__libc_fcntl(i32 %0, i32 %1, i8* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void count_numbers(void *num) {
  int i;
  for (i = 1; i <= (int)num; i++)
    printf("%d ", i);
  putchar('\n');
}


x86 assembly (clang, -O0):
<count_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    %ecx,%eax
jg     115f <count_numbers+0x3f>
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <count_numbers+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_numbers>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
test   %r15d,%r15d
jle    115d <count_numbers+0x3d>
neg    %r15d
mov    $0x1,%ebx
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <count_numbers+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @count_numbers(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i32
%8 = icmp sle i32 %5, %7
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @count_numbers(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 1
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 1, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %6, %3
br i1 %9, label %10, label %5
10: ; preds = %5, %1
%11 = tail call i32 @putchar(i8 signext 10)
ret void
}