xunge/DecIR huggingface dataset:
char *xmalloc(size)
unsigned size;
{
  char *tem = malloc(size);
  if (!tem)
    memory_out();
  return tem;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <memory_out@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1137 <xmalloc+0x17>
xor    %eax,%eax
call   1030 <memory_out@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 (...) @memory_out()
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @memory_out()
br label %7
7: ; preds = %5, %1
ret i8* %3
}
double caccess_read_array_double(double *address, int index) {
  return address[index];
}


x86 assembly (clang, -O0):
<caccess_read_array_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<caccess_read_array_double>:
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @caccess_read_array_double(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %5, i64 %7
%9 = load double, double* %8
ret double %9
}

LLVM IR (-O2):
define double @caccess_read_array_double(double* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds double, double* %0, i64 %3
%5 = load double, double* %4
ret double %5
}
void EVP_CIPHER_CTX_iv_length(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_iv_length() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
void pmu_adc_disable() {
  pmu_reg_write(0x3B, ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |
                       (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) |
                       (1 << 10) | (0 << 11) | (0 << 12) | (1 << 13) |
                       (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) |
                       (1 << 18) | (1 << 19) | (1 << 20)));
}


x86 assembly (clang, -O0):
<pmu_adc_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
mov    $0x1fe7ff,%esi
call   1030 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_disable>:
mov    $0x3b,%edi
mov    $0x1fe7ff,%esi
jmp    1030 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_adc_disable() {
%1 = call i32 @pmu_reg_write(i32 59, i32 2091007)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_disable() {
%1 = tail call i32 @pmu_reg_write(i32 59, i32 2091007)
ret void
}
int main() {
  int a[10];
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    -0x28(%rsp),%rax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%4 = ptrtoint i32* %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = ptrtoint [10 x i32]* %1 to i64
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void gprsharp_inf_past() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<gprsharp_inf_past>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<gprsharp_inf_past>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_inf_past() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_inf_past() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, int /*<<< orphan*/);
int startsWith(const char *sz, const char *szStart) {
  return !strncmp(sz, szStart, strlen(szStart));
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
double ls_costN_nm2_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<ls_costN_nm2_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <ls_costN_nm2_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <ls_costN_nm2_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <ls_costN_nm2_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <ls_costN_nm2_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm2_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ls_costN_nm2_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @ls_costN_nm2_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
unsigned get_secure_buffer(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_secure_buffer() {
ret i32 0
}
unsigned int read32(unsigned char *buf) {
  return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
}


x86 assembly (clang, -O0):
<read32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @read32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Type definitions */
struct rw_semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __down_read(struct rw_semaphore *);
void down_read(struct rw_semaphore *sem) {
  ;
  __down_read(sem);
  ;
}


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

x86 assembly (clang, -O2):
<down_read>:
jmp    1030 <__down_read@plt>

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

LLVM IR (-O2):
%struct.rw_semaphore = type { i32 }
define void @down_read(%struct.rw_semaphore* %0) {
%2 = tail call i32 @__down_read(%struct.rw_semaphore* %0)
ret void
}
char *strcpy(char *dst, const char *src) {
  char *save = dst;
  for (; (*dst = *src) != '\0'; ++src, ++dst)
    ;
  return save;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     114e <strcpy+0x4e>
jmp    1131 <strcpy+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     111f <strcpy+0x1f>
mov    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ threeSum(int *, int, int *);
int main(int argc, char **argv) {
  int A[] = {-4, -2, -2, -2, 0, 1, 2, 2, 2, 3, 3, 4, 4, 6, 6};
  int ret = 0;
  threeSum(A, 15, &ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x3c,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x54(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0xf,%esi
lea    -0x54(%rbp),%rdx
call   1040 <threeSum@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movups 0xf11(%rip),%xmm0
movups %xmm0,0x3c(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
mov    $0xf,%esi
call   1030 <threeSum@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [15 x i32] [i32 -4, i32 -2, i32 -2, i32 -2, i32 0, i32 1, i32 2, i32 2, i32 2, i32 3, i32 3, i32 4, i32 4, i32 6, i32 6]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [15 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [15 x i32]* %6 to i8*
store i32 0, i32* %7
%9 = getelementptr inbounds [15 x i32], [15 x i32]* %6, i64 0, i64 0
%10 = call i32 @threeSum(i32* %9, i32 15, i32* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [15 x i32] [i32 -4, i32 -2, i32 -2, i32 -2, i32 0, i32 1, i32 2, i32 2, i32 2, i32 3, i32 3, i32 4, i32 4, i32 6, i32 6]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [15 x i32]
%4 = alloca i32
%5 = bitcast [15 x i32]* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 0
%8 = call i32 @threeSum(i32* %7, i32 15, i32* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(int /*<<< orphan*/);
int /*<<< orphan*/ ft_search_dir(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc > 2) {
    ft_putendl(ft_search_dir(argv[1], argv[2]));
  } else
    printf("Usage : ./test_ls <Directory> <To_Find>");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1171 <main+0x41>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1050 <ft_search_dir@plt>
mov    %eax,%edi
call   1040 <ft_putendl@plt>
jmp    117d <main+0x4d>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jl     114c <main+0x1c>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1050 <ft_search_dir@plt>
mov    %eax,%edi
call   1040 <ft_putendl@plt>
jmp    1158 <main+0x28>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Usage : ./test_ls <Directory> <To_Find>\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 2
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @ft_search_dir(i8* %11, i8* %14)
%16 = call i32 @ft_putendl(i32 %15)
br label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Usage : ./test_ls <Directory> <To_Find>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @ft_search_dir(i8* %6, i8* %8)
%10 = tail call i32 @ft_putendl(i32 %9)
br label %13
11: ; preds = %2
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %4
ret i32 0
}
signed int f17(signed int v_foo) {
  signed int v_parta = v_foo << 4;
  signed int v_partb = ((unsigned int)v_foo) >> 28;
  signed int v_rotl = v_parta | v_partb;
  signed int v_and = v_rotl & 126;
  return v_and;
}


x86 assembly (clang, -O0):
<f17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1c,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x7e,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f17>:
mov    %edi,%eax
rol    $0x4,%eax
and    $0x7e,%eax
ret

LLVM IR (-O0):
define i32 @f17(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = shl i32 %7, 4
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = lshr i32 %9, 28
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = or i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = and i32 %14, 126
store i32 %15, i32* %6
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
define i32 @f17(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 4)
%3 = and i32 %2, 126
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/);
void close_port(int *fds, int length) {
  while (length-- > 0) {
    close(*fds++);
  }
}


x86 assembly (clang, -O0):
<close_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    114e <close_port+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
call   1030 <close@plt>
jmp    111f <close_port+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_port>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1133 <close_port+0x23>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nop
mov    (%rbx),%edi
add    $0x4,%rbx
call   1030 <close@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <close_port+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @close_port(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %6
%10 = tail call i32 @close(i32 %9)
%11 = icmp ugt i32 %5, 1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ term_send(char);
void term_erase_line() {
  term_send(27);
  term_send('[');
  term_send('2');
  term_send('K');
}


x86 assembly (clang, -O0):
<term_erase_line>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x32,%edi
call   1030 <term_send@plt>
mov    $0x4b,%edi
call   1030 <term_send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_erase_line>:
push   %rax
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x32,%edi
call   1030 <term_send@plt>
mov    $0x4b,%edi
pop    %rax
jmp    1030 <term_send@plt>

LLVM IR (-O0):
define void @term_erase_line() {
%1 = call i32 @term_send(i8 signext 27)
%2 = call i32 @term_send(i8 signext 91)
%3 = call i32 @term_send(i8 signext 50)
%4 = call i32 @term_send(i8 signext 75)
ret void
}

LLVM IR (-O2):
define void @term_erase_line() {
%1 = tail call i32 @term_send(i8 signext 27)
%2 = tail call i32 @term_send(i8 signext 91)
%3 = tail call i32 @term_send(i8 signext 50)
%4 = tail call i32 @term_send(i8 signext 75)
ret void
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *ZBUFFv04_getErrorName(size_t errorCode) {
  return ERR_getErrorName(errorCode);
}


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

x86 assembly (clang, -O2):
<ZBUFFv04_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

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

LLVM IR (-O2):
define i8* @ZBUFFv04_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
__attribute__((always_)) void breakpoint(void) {
  __asm__ __volatile__("int $0x03" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @breakpoint() {
tail call void asm sideeffect "int $$0x03", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: sws[-dh][-c dir][-i address][-l file][-p port]dir\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: sws[-dh][-c dir][-i address][-l file][-p port]dir\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: sws[-dh][-c dir][-i address][-l file][-p port]dir\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ brc2(int, int, float);
void hvp(int pn1, int pn2) { brc2(pn1, pn2, 'f'); }


x86 assembly (clang, -O0):
<hvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movss  0xed4(%rip),%xmm0
call   1030 <brc2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hvp>:
movss  0xee8(%rip),%xmm0
jmp    1030 <brc2@plt>

LLVM IR (-O0):
define void @hvp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @brc2(i32 %5, i32 %6, float 1.020000e+02)
ret void
}

LLVM IR (-O2):
define void @hvp(i32 %0, i32 %1) {
%3 = tail call i32 @brc2(i32 %0, i32 %1, float 1.020000e+02)
ret void
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};

/* Variables and functions */
scalar_t__ OPENSSL_sk_new_null();
struct stack_st_OPENSSL_CSTRING *sk_OPENSSL_CSTRING_new_null(void) {
  return (struct stack_st_OPENSSL_CSTRING *)OPENSSL_sk_new_null();
}


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

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

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define %struct.stack_st_OPENSSL_CSTRING* @sk_OPENSSL_CSTRING_new_null() {
%1 = call i64 (...) @OPENSSL_sk_new_null()
%2 = inttoptr i64 %1 to %struct.stack_st_OPENSSL_CSTRING*
ret %struct.stack_st_OPENSSL_CSTRING* %2
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define %struct.stack_st_OPENSSL_CSTRING* @sk_OPENSSL_CSTRING_new_null() {
%1 = tail call i64 (...) @OPENSSL_sk_new_null()
%2 = inttoptr i64 %1 to %struct.stack_st_OPENSSL_CSTRING*
ret %struct.stack_st_OPENSSL_CSTRING* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pre_iterator(int ignore1, int ignore2, int ignore3) {
  printf("[==]\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"[==]\0A\00"
define i32 @pre_iterator(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"[==]\00"
define i32 @pre_iterator(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RETURN_IF_FALSE(int /*<<< orphan*/);
int /*<<< orphan*/ assert_exit(char *);
int /*<<< orphan*/ config_tokenizer_verbose_p();
int /*<<< orphan*/ log_print(char *, char *);
void tkz_file_open_print(char *fname) {
  assert_exit(fname);
  RETURN_IF_FALSE(config_tokenizer_verbose_p());
  log_print("[TKZ] Open source file %s\n", fname);
}


x86 assembly (clang, -O0):
<tkz_file_open_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <assert_exit@plt>
mov    $0x0,%al
call   1030 <config_tokenizer_verbose_p@plt>
mov    %eax,%edi
call   1050 <RETURN_IF_FALSE@plt>
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1040 <log_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tkz_file_open_print>:
push   %rbx
mov    %rdi,%rbx
call   1060 <assert_exit@plt>
xor    %eax,%eax
call   1030 <config_tokenizer_verbose_p@plt>
mov    %eax,%edi
call   1050 <RETURN_IF_FALSE@plt>
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <log_print@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"[TKZ] Open source file %s\0A\00"
define void @tkz_file_open_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert_exit(i8* %3)
%5 = call i32 (...) @config_tokenizer_verbose_p()
%6 = call i32 @RETURN_IF_FALSE(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @log_print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"[TKZ] Open source file %s\0A\00"
define void @tkz_file_open_print(i8* %0) {
%2 = tail call i32 @assert_exit(i8* %0)
%3 = tail call i32 (...) @config_tokenizer_verbose_p()
%4 = tail call i32 @RETURN_IF_FALSE(i32 %3)
%5 = tail call i32 @log_print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int c_strlen(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("strlen's result: %d\n", c_strlen("hello, world!"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"strlen's result: %d\0A\00"
@.str.1 = [14 x i8] c"hello, world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @c_strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"strlen's result: %d\0A\00"
@.str.1 = [14 x i8] c"hello, world!\00"
define i32 @main() {
%1 = tail call i32 @c_strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int myformat(char *fn) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @myformat(i8* nocapture readnone %0) {
ret i32 0
}
void __attribute__((unused)) sig_handler(int signum) {
  switch (signum) {}
}


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

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

LLVM IR (-O0):
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
ret void
}
void RTSgBufReset(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSgBufReset() {
ret void
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_RADIO_CSN_PIN() { return 0x01 & (inp_emulate(-2) >> 0); }


x86 assembly (clang, -O0):
<TOSH_READ_RADIO_CSN_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffe,%edi
call   1030 <inp_emulate@plt>
sar    $0x0,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_RADIO_CSN_PIN>:
push   %rax
mov    $0xfffffffe,%edi
call   1030 <inp_emulate@plt>
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_RADIO_CSN_PIN() {
%1 = call i32 @inp_emulate(i32 -2)
%2 = ashr i32 %1, 0
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_RADIO_CSN_PIN() {
%1 = tail call i32 @inp_emulate(i32 -2)
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 1
ret i8 %3
}
int bounce(int arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i32 @bounce(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
double oof2_filter(double *, double const);
double rand_normal(int /*<<< orphan*/ *, int /*<<< orphan*/ *, double *);
double rand_oof2(int32_t *flat_state, int8_t *empty, double *gset,
                 double *oof2_state) {
  const double x2 = rand_normal(flat_state, empty, gset);
  return oof2_filter(oof2_state, x2);
}


x86 assembly (clang, -O0):
<rand_oof2>:
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
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <rand_normal@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1030 <oof2_filter@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_oof2>:
push   %rbx
mov    %rcx,%rbx
call   1040 <rand_normal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <oof2_filter@plt>

LLVM IR (-O0):
define double @rand_oof2(i32* %0, i32* %1, double* %2, double* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
store i32* %0, i32** %5
store i32* %1, i32** %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load double*, double** %7
%13 = call double @rand_normal(i32* %10, i32* %11, double* %12)
store double %13, double* %9
%14 = load double*, double** %8
%15 = load double, double* %9
%16 = call double @oof2_filter(double* %14, double %15)
ret double %16
}

LLVM IR (-O2):
define double @rand_oof2(i32* %0, i32* %1, double* %2, double* %3) {
%5 = tail call double @rand_normal(i32* %0, i32* %1, double* %2)
%6 = tail call double @oof2_filter(double* %3, double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("\n%d\n%d", a * a, a * a * a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"\0A%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ p16c8init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ prg16setBank0(int /*<<< orphan*/);
int /*<<< orphan*/ prg16setBank1(int /*<<< orphan*/);
void m180_init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
               uint32_t prgRAMsizeIn, uint8_t *chrROMin,
               uint32_t chrROMsizeIn) {
  p16c8init(prgROMin, prgROMsizeIn, prgRAMin, prgRAMsizeIn, chrROMin,
            chrROMsizeIn);
  prg16setBank0(0);
  prg16setBank1(0);
}


x86 assembly (clang, -O0):
<m180_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1050 <p16c8init@plt>
xor    %edi,%edi
call   1030 <prg16setBank0@plt>
xor    %edi,%edi
call   1040 <prg16setBank1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m180_init>:
push   %rax
call   1050 <p16c8init@plt>
xor    %edi,%edi
call   1030 <prg16setBank0@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <prg16setBank1@plt>

LLVM IR (-O0):
define void @m180_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32*, i32** %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i32, i32* %12
%19 = call i32 @p16c8init(i32* %13, i32 %14, i32* %15, i32 %16, i32* %17, i32 %18)
%20 = call i32 @prg16setBank0(i32 0)
%21 = call i32 @prg16setBank1(i32 0)
ret void
}

LLVM IR (-O2):
define void @m180_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = tail call i32 @p16c8init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5)
%8 = tail call i32 @prg16setBank0(i32 0)
%9 = tail call i32 @prg16setBank1(i32 0)
ret void
}
const char *get_lame_very_short_version(void) {
  static const char *const str = "LAME"
                                 "3"
                                 "."
                                 "98"
                                 "r";
  return str;
}


x86 assembly (clang, -O0):
<get_lame_very_short_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@get_lame_very_short_version.str = internal constant i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0)
@.str = [10 x i8] c"LAME3.98r\00"
define i8* @get_lame_very_short_version() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"LAME3.98r\00"
define i8* @get_lame_very_short_version() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x31() {
  Assert_real((isxdigit(49)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              250, ("isxdigit should be 1 for 1"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xfa,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x31>:
push   %rax
mov    $0x31,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0xfa,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for 1\00"
define void @t_isxdigit_0x31() {
%1 = tail call i32 @isxdigit(i32 49)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
OP(dd, c8) {
  illegal_1();
  op_c8();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_c8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_c8@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_c8()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_c8()
ret i32 undef
}
/* Type definitions */
struct port {
  int dummy;
};
struct lagopus_packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lagopus_match_and_action(struct lagopus_packet *);
void lagopus_receive_packet(struct port *port, struct lagopus_packet *pkt) {
  (void)port;
  lagopus_match_and_action(pkt);
}


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

x86 assembly (clang, -O2):
<lagopus_receive_packet>:
mov    %rsi,%rdi
jmp    1030 <lagopus_match_and_action@plt>

LLVM IR (-O0):
%struct.port = type { i32 }
%struct.lagopus_packet = type { i32 }
define void @lagopus_receive_packet(%struct.port* %0, %struct.lagopus_packet* %1) {
%3 = alloca %struct.port*
%4 = alloca %struct.lagopus_packet*
store %struct.port* %0, %struct.port** %3
store %struct.lagopus_packet* %1, %struct.lagopus_packet** %4
%5 = load %struct.port*, %struct.port** %3
%6 = load %struct.lagopus_packet*, %struct.lagopus_packet** %4
%7 = call i32 @lagopus_match_and_action(%struct.lagopus_packet* %6)
ret void
}

LLVM IR (-O2):
%struct.port = type { i32 }
%struct.lagopus_packet = type { i32 }
define void @lagopus_receive_packet(%struct.port* nocapture readnone %0, %struct.lagopus_packet* %1) {
%3 = tail call i32 @lagopus_match_and_action(%struct.lagopus_packet* %1)
ret void
}
/* Variables and functions */
double ass_strtod(char *, char **);
int mystrtoi(char **p, int *res) {
  char *start = *p;
  double temp_res = ass_strtod(*p, p);
  *res = (int)(temp_res + (temp_res > 0 ? 0.5 : -0.5));
  return *p != start;
}


x86 assembly (clang, -O0):
<mystrtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ass_strtod@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xeae(%rip),%xmm4
movsd  0xeae(%rip),%xmm3
xorps  %xmm1,%xmm1
cmpltsd %xmm2,%xmm1
movaps %xmm1,%xmm2
andpd  %xmm4,%xmm2
andnpd %xmm3,%xmm1
orpd   %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrtoi>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <ass_strtod@plt>
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xec3(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%r14)
xor    %eax,%eax
cmp    %r15,(%rbx)
setne  %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @mystrtoi(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca double
store i8** %0, i8*** %3
store i32* %1, i32** %4
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
store i8* %8, i8** %5
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %3
%12 = call double @ass_strtod(i8* %10, i8** %11)
store double %12, double* %6
%13 = load double, double* %6
%14 = load double, double* %6
%15 = fcmp ogt double %14, 0.000000e+00
%16 = zext i1 %15 to i64
%17 = select i1 %15, double 5.000000e-01, double -5.000000e-01
%18 = fadd double %13, %17
%19 = fptosi double %18 to i32
%20 = load i32*, i32** %4
store i32 %19, i32* %20
%21 = load i8**, i8*** %3
%22 = load i8*, i8** %21
%23 = load i8*, i8** %5
%24 = icmp ne i8* %22, %23
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @mystrtoi(i8** %0, i32* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = tail call double @ass_strtod(i8* %3, i8** %0)
%5 = fcmp ogt double %4, 0.000000e+00
%6 = select i1 %5, double 5.000000e-01, double -5.000000e-01
%7 = fadd double %4, %6
%8 = fptosi double %7 to i32
store i32 %8, i32* %1
%9 = load i8*, i8** %0
%10 = icmp ne i8* %9, %3
%11 = zext i1 %10 to i32
ret i32 %11
}