xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int value();
int main() {
  int print;
  print = value();
  printf("%d", print);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <value@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <value@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @value()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fz_tracepopclip(void *user) { printf("<popclip />\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"<popclip />\0A\00"
define void @fz_tracepopclip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"<popclip />\00"
define void @fz_tracepopclip(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arg_uint2(unsigned int, unsigned int);
void arg_uint1(unsigned int i) { arg_uint2(i, i + 1); }


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

x86 assembly (clang, -O2):
<arg_uint1>:
lea    0x1(%rdi),%esi
jmp    1030 <arg_uint2@plt>

LLVM IR (-O0):
define void @arg_uint1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 1
%6 = call i32 @arg_uint2(i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @arg_uint1(i32 %0) {
%2 = add i32 %0, 1
%3 = tail call i32 @arg_uint2(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendInterrupt(int, int, int, int);
void ScuSendExternalInterrupt03(void) {
  SendInterrupt(0x53, 0x7, 0x8000, 0x00080000);
}


x86 assembly (clang, -O0):
<ScuSendExternalInterrupt03>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53,%edi
mov    $0x7,%esi
mov    $0x8000,%edx
mov    $0x80000,%ecx
call   1030 <SendInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScuSendExternalInterrupt03>:
mov    $0x53,%edi
mov    $0x7,%esi
mov    $0x8000,%edx
mov    $0x80000,%ecx
jmp    1030 <SendInterrupt@plt>

LLVM IR (-O0):
define void @ScuSendExternalInterrupt03() {
%1 = call i32 @SendInterrupt(i32 83, i32 7, i32 32768, i32 524288)
ret void
}

LLVM IR (-O2):
define void @ScuSendExternalInterrupt03() {
%1 = tail call i32 @SendInterrupt(i32 83, i32 7, i32 32768, i32 524288)
ret void
}
/* Variables and functions */
scalar_t__ ceil(int);
int base64_needed_decoded_length(int length_of_encoded_data) {
  return (int)ceil(length_of_encoded_data * 3 / 4);
}


x86 assembly (clang, -O0):
<base64_needed_decoded_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_needed_decoded_length>:
lea    (%rdi,%rdi,2),%eax
lea    (%rdi,%rdi,2),%edi
add    $0x3,%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x2,%edi
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @base64_needed_decoded_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 3
%5 = sdiv i32 %4, 4
%6 = call i64 @ceil(i32 %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @base64_needed_decoded_length(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = sdiv i32 %2, 4
%4 = tail call i64 @ceil(i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int gbser_write(void *, int *, int);
int gbser_writec(void *handle, int c) { return gbser_write(handle, &c, 1); }


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

x86 assembly (clang, -O2):
<gbser_writec>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <gbser_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gbser_writec(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 @gbser_write(i8* %5, i32* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @gbser_writec(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @gbser_write(i8* %0, i32* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "malloc() failed: %ld\n", (long)size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"malloc() failed: %ld\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"malloc() failed: %ld\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
double no_crash_reinterpret_double_as_int(double a) {
  *(int *)&a = 1;
  return a * a;
}


x86 assembly (clang, -O0):
<no_crash_reinterpret_double_as_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_crash_reinterpret_double_as_int>:
movq   %xmm0,%rax
movabs $0xffffffff00000000,%rcx
ff ff ff
and    %rax,%rcx
or     $0x1,%rcx
movq   %rcx,%xmm0
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @no_crash_reinterpret_double_as_int(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i32*
store i32 1, i32* %3
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @no_crash_reinterpret_double_as_int(double %0) {
%2 = bitcast double %0 to i64
%3 = and i64 %2, -4294967296
%4 = or i64 %3, 1
%5 = bitcast i64 %4 to double
%6 = fmul double %5, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ getcbt_(int *, double *, double *, double *);
char *get_flavor_scheme() {
  int fixed_scheme;
  double dnull;
  char *fl_scheme;
  getcbt_(&fixed_scheme, &dnull, &dnull, &dnull);
  if (fixed_scheme)
    fl_scheme = "fixed";
  else
    fl_scheme = "variable";
  return fl_scheme;
}


x86 assembly (clang, -O0):
<get_flavor_scheme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <getcbt_@plt>
cmpl   $0x0,-0x4(%rbp)
je     1145 <get_flavor_scheme+0x35>
lea    0xec4(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1150 <get_flavor_scheme+0x40>
lea    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_flavor_scheme>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <getcbt_@plt>
cmpl   $0x0,0xc(%rsp)
lea    0xed1(%rip),%rcx
lea    0xec4(%rip),%rax
cmove  %rcx,%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"fixed\00"
@.str.1 = [9 x i8] c"variable\00"
define i8* @get_flavor_scheme() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @getcbt_(i32* %1, double* %2, double* %2, double* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
ret i8* %8
}
/* Type definitions */
struct timeval {
  unsigned long tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, struct timeval *);
void lc_usleep(unsigned long t) {
  struct timeval timeout;
  timeout.tv_sec = t / 1000000;
  timeout.tv_usec = t - 1000000 * timeout.tv_sec;
  select(1, NULL, NULL, NULL, &timeout);
}


x86 assembly (clang, -O0):
<lc_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,-0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lc_usleep>:
sub    $0x18,%rsp
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
mul    %rcx
shr    $0x12,%rdx
mov    %rdx,0x8(%rsp)
imul   $0xfffffffffff0bdc0,%rdx,%rax
add    %rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%r8
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @lc_usleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timeval
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%9 = load i64, i64* %8
%10 = mul i64 1000000, %9
%11 = sub i64 %7, %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 %11, i64* %12
%13 = call i32 @select(i32 1, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @lc_usleep(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = udiv i64 %0, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = mul i64 %4, -1000000
%7 = add i64 %6, %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = call i32 @select(i32 1, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
int IsOdd(int dNumber) {
  if ((2 * (dNumber / 2)) == dNumber) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<IsOdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
shl    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    112a <IsOdd+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <IsOdd+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsOdd>:
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
and    $0xfffffffe,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @IsOdd(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = shl nsw i32 %2, 1
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int mus_wav_waittime(int ch, int time) {
  printf("%s not implemented\n", __func__);
  return (-1);
}


x86 assembly (clang, -O0):
<mus_wav_waittime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_wav_waittime>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef5(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_wav_waittime = [17 x i8] c"mus_wav_waittime\00"
define i32 @mus_wav_waittime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.mus_wav_waittime, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_wav_waittime = [17 x i8] c"mus_wav_waittime\00"
define i32 @mus_wav_waittime(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.mus_wav_waittime, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
int /*<<< orphan*/ tok_ini0(char *, char *, int *, char ***);
void tok_ini(const char *s0, char *del, int *pc, char ***pv) {
  char *s;
  s = strdup(s0);
  tok_ini0(s, del, pc, pv);
  free(s);
}


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

x86 assembly (clang, -O2):
<tok_ini>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <tok_ini0@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @tok_ini(i8* nocapture %0, i8* %1, i32* %2, i8*** %3) {
%5 = tail call i8* @strdup(i8* %0)
%6 = tail call i32 @tok_ini0(i8* %5, i8* %1, i32* %2, i8*** %3)
%7 = tail call i32 @free(i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int get_character(int /*<<< orphan*/ *);
void skip_to_eof(FILE *f) {
  int ch;
  ch = get_character(f);
  while (ch != EOF) {
    ch = get_character(f);
  }
}


x86 assembly (clang, -O0):
<skip_to_eof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_character@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
je     114b <skip_to_eof+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <get_character@plt>
mov    %eax,-0xc(%rbp)
jmp    1128 <skip_to_eof+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_to_eof>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <get_character@plt>
mov    0x2ec5(%rip),%r14
cmp    (%r14),%eax
je     113d <skip_to_eof+0x2d>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <get_character@plt>
cmp    (%r14),%eax
jne    1130 <skip_to_eof+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_to_eof(i32* %0) {
%2 = tail call i32 @get_character(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %9, label %5
5: ; preds = %1, %5
%6 = tail call i32 @get_character(i32* %0)
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %5
9: ; preds = %5, %1
ret void
}
int get_flag(char ***args, char flag) {
  if ((**args)[0] == '-' && (**args)[1] == flag && (**args)[2] == '\0') {
    (*args)++;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    116f <get_flag+0x6f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    116f <get_flag+0x6f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    116f <get_flag+0x6f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1176 <get_flag+0x76>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_flag>:
mov    (%rdi),%rcx
mov    (%rcx),%rdx
xor    %eax,%eax
cmpb   $0x2d,(%rdx)
jne    1119 <get_flag+0x19>
cmp    %sil,0x1(%rdx)
jne    1119 <get_flag+0x19>
cmpb   $0x0,0x2(%rdx)
je     111a <get_flag+0x1a>
ret
add    $0x8,%rcx
mov    %rcx,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_flag(i8*** %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8***
%5 = alloca i8
store i8*** %0, i8**** %4
store i8 %1, i8* %5
%6 = load i8***, i8**** %4
%7 = load i8**, i8*** %6
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 45
br i1 %12, label %13, label %35
13: ; preds = %2
%14 = load i8***, i8**** %4
%15 = load i8**, i8*** %14
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %19, %21
br i1 %22, label %23, label %35
23: ; preds = %13
%24 = load i8***, i8**** %4
%25 = load i8**, i8*** %24
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 2
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %23
%32 = load i8***, i8**** %4
%33 = load i8**, i8*** %32
%34 = getelementptr inbounds i8*, i8** %33, i32 1
store i8** %34, i8*** %32
store i32 1, i32* %3
br label %36
35: ; preds = %23, %13, %2
store i32 0, i32* %3
br label %36
36: ; preds = %35, %31
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @get_flag(i8*** nocapture %0, i8 signext %1) {
%3 = load i8**, i8*** %0
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 45
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %1
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %4, i64 2
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = getelementptr inbounds i8*, i8** %3, i64 1
store i8** %16, i8*** %0
br label %17
17: ; preds = %2, %7, %11, %15
%18 = phi i32 [ 1, %15 ], [ 0, %11 ], [ 0, %7 ], [ 0, %2 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int abort_crash(int n) {
  assert(n > 0);
  abort_crash(n - 1);
  return 1;
}


x86 assembly (clang, -O0):
<abort_crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <abort_crash@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abort_crash>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1030 <assert@plt>
add    $0xffffffff,%ebx
jmp    1120 <abort_crash+0x10>

LLVM IR (-O0):
define i32 @abort_crash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = call i32 @abort_crash(i32 %8)
ret i32 1
}

LLVM IR (-O2):
define i32 @abort_crash(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %7, %2 ]
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = add nsw i32 %3, -1
br label %2
}
int isalpha(int character) {
  return (character >= 'a' && character <= 'z') ||
         (character >= 'A' && character <= 'Z');
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isalpha+0x39>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *value = malloc(size);
  if (value == 0) {
    fatal("virtual memory exhausted");
  }
  return value;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void fp_finalize(struct CalculationInfo *info) {}


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

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

LLVM IR (-O0):
%struct.CalculationInfo = type opaque
define void @fp_finalize(%struct.CalculationInfo* %0) {
%2 = alloca %struct.CalculationInfo*
store %struct.CalculationInfo* %0, %struct.CalculationInfo** %2
ret void
}

LLVM IR (-O2):
%struct.CalculationInfo = type opaque
define void @fp_finalize(%struct.CalculationInfo* nocapture %0) {
ret void
}
fchar(char letra) {
  int x;
  x = letra;
  if ((x >= 65 && x <= 90) || (x >= 97 && x <= 122))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<fchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x41,-0xc(%rbp)
jl     1125 <fchar+0x25>
cmpl   $0x5a,-0xc(%rbp)
jle    1139 <fchar+0x39>
cmpl   $0x61,-0xc(%rbp)
jl     1145 <fchar+0x45>
cmpl   $0x7a,-0xc(%rbp)
jg     1145 <fchar+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <fchar+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fchar>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @fchar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 90
br i1 %11, label %18, label %12
12: ; preds = %9, %1
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp sle i32 %16, 122
br i1 %17, label %18, label %19
18: ; preds = %15, %9
store i32 1, i32* %2
br label %20
19: ; preds = %15, %12
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @fchar(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
int feed_device_null_leave(void *const p_context) {
  (void)(p_context);
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @feed_device_null_leave(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void gnewint(char *prompt, int *intp) {
  char temp[20];
  temp[0] = '\0';
  printf("\n\nEnter new %s:  ", prompt);
  getline(temp, 20);
  if (temp[0])
    *intp = atoi(temp);
}


x86 assembly (clang, -O0):
<gnewint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x14,%esi
call   1050 <getline@plt>
cmpb   $0x0,-0x30(%rbp)
je     117d <gnewint+0x4d>
lea    -0x30(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnewint>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
movb   $0x0,(%rsp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    $0x14,%esi
call   1050 <getline@plt>
cmpb   $0x0,(%rsp)
je     1168 <gnewint+0x38>
mov    %rsp,%rdi
call   1040 <atoi@plt>
mov    %eax,(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"\0A\0AEnter new %s: \00"
define void @gnewint(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 @getline(i8* %4, i32 20)
%7 = load i8, i8* %4
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @atoi(i8* %4)
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %2
ret void
}
const char *mac_strerror(const int err) {
  switch (err) {
  default:
    return "unknown error";
  }
}


x86 assembly (clang, -O0):
<mac_strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_strerror>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unknown error\00"
define i8* @mac_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"unknown error\00"
define i8* @mac_strerror(i32 %0) {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct predicate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print(struct predicate *, int /*<<< orphan*/);
void predicate_print(struct predicate *p) { print(p, 0); }


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

x86 assembly (clang, -O2):
<predicate_print>:
xor    %esi,%esi
jmp    1030 <print@plt>

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

LLVM IR (-O2):
%struct.predicate = type { i32 }
define void @predicate_print(%struct.predicate* %0) {
%2 = tail call i32 @print(%struct.predicate* %0, i32 0)
ret void
}
void genbgtz_out() {}


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

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

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

LLVM IR (-O2):
define void @genbgtz_out() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _main();
void ___start() { _main(); }


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

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

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

LLVM IR (-O2):
define void @___start() {
%1 = tail call i32 (...) @_main()
ret void
}
void ft_add_test_case(char **data, char *original, char *answer) {
  data[0] = original;
  data[1] = answer;
}


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

x86 assembly (clang, -O2):
<ft_add_test_case>:
mov    %rsi,(%rdi)
mov    %rdx,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ft_add_test_case(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
store i8* %7, i8** %9
%10 = load i8*, i8** %6
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8* %10, i8** %12
ret void
}

LLVM IR (-O2):
define void @ft_add_test_case(i8** nocapture writeonly %0, i8* %1, i8* %2) {
store i8* %1, i8** %0
%4 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* %2, i8** %4
ret void
}
int Strcmp2(char *s, char *t) {
  for (; *s == *t; s++, t++) {
    if (*s == '\0')
      return 0;
  }
  return *s - *t;
}


x86 assembly (clang, -O0):
<Strcmp2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <Strcmp2+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <Strcmp2+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <Strcmp2+0x73>
jmp    1143 <Strcmp2+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <Strcmp2+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strcmp2>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <Strcmp2+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <Strcmp2+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <Strcmp2+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Strcmp2(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %34
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %29, %32
store i32 %33, i32* %3
br label %34
34: ; preds = %26, %19
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @Strcmp2(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t nsfGet_4567(uint16_t addr) {
  (void)addr;
  return 0x4C;
}


x86 assembly (clang, -O0):
<nsfGet_4567>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x4c,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nsfGet_4567(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i32 76
}

LLVM IR (-O2):
define i32 @nsfGet_4567(i32 %0) {
ret i32 76
}
void msgu_stream_free(struct msgu_stream *s) {}


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

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

LLVM IR (-O0):
%struct.msgu_stream = type opaque
define void @msgu_stream_free(%struct.msgu_stream* %0) {
%2 = alloca %struct.msgu_stream*
store %struct.msgu_stream* %0, %struct.msgu_stream** %2
ret void
}

LLVM IR (-O2):
%struct.msgu_stream = type opaque
define void @msgu_stream_free(%struct.msgu_stream* nocapture %0) {
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int std_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
  int dstfd;
  if ((dstfd = accept(sockfd, addr, addrlen)) == -1) {
    perror("accept");
    exit(1);
  }
  return dstfd;
}


x86 assembly (clang, -O0):
<std_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    1175 <std_accept+0x45>
lea    0xe9a(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_accept>:
push   %rax
call   1040 <accept@plt>
cmp    $0xffffffff,%eax
je     113d <std_accept+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @std_accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32*, i32** %6
%11 = call i32 @accept(i32 %8, %struct.sockaddr* %9, i32* %10)
store i32 %11, i32* %7
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @std_accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
int bar() { return 1 / 0; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 poison
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 poison
}
int count_utf_bytes(int c) {
  if ((c & 0xe0) == 0xc0)
    return 2;
  else if ((c & 0xf0) == 0xe0)
    return 3;
  else if ((c & 0xf8) == 0xf0)
    return 4;
  return 1;
}


x86 assembly (clang, -O0):
<count_utf_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xe0,%eax
cmp    $0xc0,%eax
jne    1126 <count_utf_bytes+0x26>
movl   $0x2,-0x4(%rbp)
jmp    1175 <count_utf_bytes+0x75>
mov    -0x8(%rbp),%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
jne    1145 <count_utf_bytes+0x45>
movl   $0x3,-0x4(%rbp)
jmp    1175 <count_utf_bytes+0x75>
mov    -0x8(%rbp),%eax
and    $0xf8,%eax
cmp    $0xf0,%eax
jne    1164 <count_utf_bytes+0x64>
movl   $0x4,-0x4(%rbp)
jmp    1175 <count_utf_bytes+0x75>
jmp    1169 <count_utf_bytes+0x69>
jmp    116e <count_utf_bytes+0x6e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_utf_bytes>:
mov    %edi,%ecx
and    $0xe0,%ecx
mov    $0x2,%eax
cmp    $0xc0,%ecx
je     1141 <count_utf_bytes+0x41>
mov    %edi,%ecx
and    $0xf0,%ecx
mov    $0x3,%eax
cmp    $0xe0,%ecx
je     1141 <count_utf_bytes+0x41>
and    $0xf8,%edi
xor    %eax,%eax
cmp    $0xf0,%edi
sete   %al
lea    (%rax,%rax,2),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @count_utf_bytes(i32 %0) {
%2 = and i32 %0, 224
%3 = icmp eq i32 %2, 192
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 240
%6 = icmp eq i32 %5, 224
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 248
%9 = icmp eq i32 %8, 240
%10 = select i1 %9, i32 4, i32 1
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 2, %1 ], [ 3, %4 ], [ %10, %7 ]
ret i32 %12
}
void rop3_226_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ *D;
  stk2 = S & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_226_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_226_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %dl,%cl
and    %sil,%cl
xor    %r8b,%cl
mov    %edx,%eax
not    %al
or     %sil,%al
and    %cl,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_226_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = or i32 %34, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = xor i32 %45, -1
%47 = and i32 %43, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %47, %50
%52 = or i32 %41, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_226_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, %4
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %7, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
int fun1147() { return 1147; }


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

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

LLVM IR (-O0):
define i32 @fun1147() {
ret i32 1147
}

LLVM IR (-O2):
define i32 @fun1147() {
ret i32 1147
}