xunge/DecIR huggingface dataset:
point(s) char *s;
{ return ((long)s >= 128 || (long)s < 0); }


x86 assembly (clang, -O0):
<point>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmp    $0x80,%rcx
mov    %al,-0x9(%rbp)
jge    112c <point+0x2c>
mov    -0x8(%rbp),%rax
cmp    $0x0,%rax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<point>:
cmp    $0x7f,%rdi
setg   %al
test   %rdi,%rdi
sets   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @point(i8* readnone %0) {
%2 = icmp sgt i8* %0, inttoptr (i64 127 to i8*)
%3 = icmp slt i8* %0, null
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ access(char const *, int /*<<< orphan*/);
int file_exists(const char *given_filename) {
  return (!access(given_filename, F_OK));
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void fninit(void) { __asm volatile("fninit"); }


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

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

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

LLVM IR (-O2):
define void @fninit() {
tail call void asm sideeffect "fninit", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
void get_pilot_name(char *pilot_name, int len) {
  printf("Please provide pilot name..\n");
  fgets(pilot_name, len, stdin);
}


x86 assembly (clang, -O0):
<get_pilot_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pilot_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fgets@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Please provide pilot name..\0A\00"
@stdin = global i32 0
define void @get_pilot_name(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %6, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [28 x i8] c"Please provide pilot name..\00"
define void @get_pilot_name(i8* %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = tail call i32 @fgets(i8* %0, i32 %1, i32 %4)
ret void
}
/* Variables and functions */
void strcpy(const char *from, char *to) {
  while (*from != '\0') {
    *to++ = *from++;
  }
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <strcpy+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    (%rdi),%al
test   %al,%al
je     1120 <strcpy+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcpy+0x10>
ret

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

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

/* Variables and functions */
void cec_ops_request_current_latency(const struct cec_msg *msg,
                                     __u16 *phys_addr) {
  *phys_addr = (msg->msg[2] << 8) | msg->msg[3];
}


x86 assembly (clang, -O0):
<cec_ops_request_current_latency>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
or     0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_ops_request_current_latency>:
mov    (%rdi),%rax
mov    0x8(%rax),%ecx
shl    $0x8,%ecx
or     0xc(%rax),%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_request_current_latency(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = load %struct.cec_msg*, %struct.cec_msg** %3
%12 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %11, i32 0, i32 0
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 3
%15 = load i32, i32* %14
%16 = or i32 %10, %15
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_request_current_latency(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = getelementptr inbounds i32, i32* %4, i64 3
%9 = load i32, i32* %8
%10 = or i32 %7, %9
store i32 %10, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void __divdi3(int64_t a, int64_t b) {}


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

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

LLVM IR (-O0):
define void @__divdi3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @__divdi3(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ machine_close();
void mode_close(void) { machine_close(); }


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

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

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

LLVM IR (-O2):
define void @mode_close() {
%1 = tail call i32 (...) @machine_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawProgressBar(int /*<<< orphan*/, unsigned char, int,
                                   unsigned char, unsigned char);
void LcdBarLine(unsigned char line, unsigned char persent) {
  DrawProgressBar(0, line, 83, line + 4, persent);
}


x86 assembly (clang, -O0):
<LcdBarLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%cl
movzbl -0x1(%rbp),%eax
add    $0x4,%eax
xor    %edi,%edi
mov    $0x53,%edx
movzbl %cl,%esi
movzbl %al,%ecx
movzbl -0x2(%rbp),%r8d
call   1030 <DrawProgressBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LcdBarLine>:
mov    %esi,%r8d
mov    %edi,%esi
lea    0x4(%rsi),%eax
movzbl %al,%ecx
xor    %edi,%edi
mov    $0x53,%edx
jmp    1030 <DrawProgressBar@plt>

LLVM IR (-O0):
define void @LcdBarLine(i8 zeroext %0, i8 zeroext %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* %3
%7 = zext i8 %6 to i32
%8 = add nsw i32 %7, 4
%9 = trunc i32 %8 to i8
%10 = load i8, i8* %4
%11 = call i32 @DrawProgressBar(i32 0, i8 zeroext %5, i32 83, i8 zeroext %9, i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @LcdBarLine(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %0, 4
%4 = tail call i32 @DrawProgressBar(i32 0, i8 zeroext %0, i32 83, i8 zeroext %3, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_set_verbose(int);
int /*<<< orphan*/ strcmp(char *, char *);
int log_verbose_init(int argc, char **argv) {
  if (argc > 1) {
    if (!strcmp("-verbose", argv[1])) {
      log_set_verbose(1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<log_verbose_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1165 <log_verbose_init+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1160 <log_verbose_init+0x40>
mov    $0x1,%edi
call   1030 <log_set_verbose@plt>
jmp    1165 <log_verbose_init+0x45>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_verbose_init>:
push   %rax
cmp    $0x2,%edi
jl     1144 <log_verbose_init+0x24>
mov    0x8(%rsi),%rsi
lea    0xecf(%rip),%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1144 <log_verbose_init+0x24>
mov    $0x1,%edi
call   1030 <log_set_verbose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"-verbose\00"
define i32 @log_verbose_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %7
%14 = call i32 @log_set_verbose(i32 1)
br label %15
15: ; preds = %13, %7
br label %16
16: ; preds = %15, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"-verbose\00"
define i32 @log_verbose_init(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @log_set_verbose(i32 1)
br label %11
11: ; preds = %4, %9, %2
ret i32 0
}
/* Variables and functions */
bool uc_is_surrogate(int c) { return c >= 0xd800 && c <= 0xdfff; }


x86 assembly (clang, -O0):
<uc_is_surrogate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xd800,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <uc_is_surrogate+0x26>
cmpl   $0xdfff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc_is_surrogate>:
and    $0xfffff800,%edi
xor    %eax,%eax
cmp    $0xd800,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @uc_is_surrogate(i32 %0) {
%2 = and i32 %0, -2048
%3 = icmp eq i32 %2, 55296
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ showmat(size_t, size_t, double *);
void ssm(size_t order, double *M) { showmat(order, order, M); }


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

x86 assembly (clang, -O2):
<ssm>:
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <showmat@plt>

LLVM IR (-O0):
define void @ssm(i64 %0, double* %1) {
%3 = alloca i64
%4 = alloca double*
store i64 %0, i64* %3
store double* %1, double** %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load double*, double** %4
%8 = call i32 @showmat(i64 %5, i64 %6, double* %7)
ret void
}

LLVM IR (-O2):
define void @ssm(i64 %0, double* %1) {
%3 = tail call i32 @showmat(i64 %0, i64 %0, double* %1)
ret void
}
/* Variables and functions */
scalar_t__ pow(double const, int);
double sqrt(scalar_t__);
double calcTotalSpeed(const double hSpeed, const double vSpeed) {
  return sqrt(pow(hSpeed, 2) + pow(vSpeed, 2));
}


x86 assembly (clang, -O0):
<calcTotalSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcTotalSpeed>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @calcTotalSpeed(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i64 @pow(double %5, i32 2)
%7 = load double, double* %4
%8 = call i64 @pow(double %7, i32 2)
%9 = add nsw i64 %6, %8
%10 = call double @sqrt(i64 %9)
ret double %10
}

LLVM IR (-O2):
define double @calcTotalSpeed(double %0, double %1) {
%3 = tail call i64 @pow(double %0, i32 2)
%4 = tail call i64 @pow(double %1, i32 2)
%5 = add nsw i64 %4, %3
%6 = tail call double @sqrt(i64 %5)
ret double %6
}
/* Type definitions */
struct sampler {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sampler *);
int wav_close(struct sampler *sampler) {
  free(sampler);
  return 0;
}


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

x86 assembly (clang, -O2):
<wav_close>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.sampler = type { i32 }
define i32 @wav_close(%struct.sampler* nocapture %0) {
%2 = tail call i32 @free(%struct.sampler* %0)
ret i32 0
}
_Bool is_ptr(unsigned int s) { return (_Bool)(((s)&1) == 0); }


x86 assembly (clang, -O0):
<is_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ptr>:
test   $0x1,%dil
sete   %al
ret

LLVM IR (-O0):
define zeroext i1 @is_ptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
ret i1 %5
}

LLVM IR (-O2):
define zeroext i1 @is_ptr(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
ret i1 %3
}
void PWM_Cmds_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @PWM_Cmds_Init() {
ret void
}
/* Variables and functions */
unsigned int list_length(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool test_list_length_null_params(void) {
  bool pass = false;
  unsigned int res = list_length(NULL, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_length_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <list_length@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113f <test_list_length_null_params+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_length_null_params>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <list_length@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_list_length_null_params() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @list_length(i32* null, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_list_length_null_params() {
%1 = tail call i32 @list_length(i32* null, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
void part_2_2() {
  short int shortInt;
  long int longInt;
  long double longDouble;
  signed char signedChar;
  unsigned char unsignedChar;
  signed int signedInt;
  unsigned int unsignedInt;
}


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

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

LLVM IR (-O0):
define void @part_2_2() {
%1 = alloca i16
%2 = alloca i64
%3 = alloca x86_fp80
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
ret void
}

LLVM IR (-O2):
define void @part_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void foo(char *x) { printf("%s\n", x); }


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

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @foo(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned int get_le32(const unsigned char *p) {
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


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

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

LLVM IR (-O0):
define i32 @get_le32(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 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

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


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

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

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

LLVM IR (-O2):
define void @i8042_platform_exit() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char to_char(uint8_t b) {
  if (b < 32 || b > 126) {
    return '.';
  }
  return b;
}


x86 assembly (clang, -O0):
<to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     111b <to_char+0x1b>
cmpl   $0x7e,-0x8(%rbp)
jle    1124 <to_char+0x24>
movb   $0x2e,-0x1(%rbp)
jmp    112a <to_char+0x2a>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_char>:
lea    -0x7f(%rdi),%eax
cmp    $0xffffffa1,%eax
mov    $0x2e,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @to_char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 32
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i8 46, i8* %2
br label %13
10: ; preds = %6
%11 = load i32, i32* %3
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %13
13: ; preds = %10, %9
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @to_char(i32 %0) {
%2 = add i32 %0, -127
%3 = icmp ult i32 %2, -95
%4 = trunc i32 %0 to i8
%5 = select i1 %3, i8 46, i8 %4
ret i8 %5
}
/* Variables and functions */
int init_settings(char *, int, char **, char *);
int init_util(char *progname, int argc, char *argv[], char *optString) {
  return init_settings(progname, argc, argv, optString);
}


x86 assembly (clang, -O0):
<init_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <init_settings@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_util>:
jmp    1030 <init_settings@plt>

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

LLVM IR (-O2):
define i32 @init_util(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = tail call i32 @init_settings(i8* %0, i32 %1, i8** %2, i8* %3)
ret i32 %5
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned int f0a(unsigned long long);
int main() {
  uint32_t r1;
  r1 = f0a(12094370573988097329ULL);
  if (r1 != ~0U)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0xa7d7d5f5547f6d31,%rdi
d5 d7 a7
call   1030 <f0a@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1152 <main+0x32>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0xa7d7d5f5547f6d31,%rdi
d5 d7 a7
call   1030 <f0a@plt>
cmp    $0xffffffff,%eax
jne    1139 <main+0x19>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @f0a(i64 -6352373499721454287)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f0a(i64 -6352373499721454287)
%2 = icmp eq i32 %1, -1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void swap_int(int *a, int *b) {
  *a = *a + *b;
  *b = *a - *b;
  *a = *a - *b;
}


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

x86 assembly (clang, -O2):
<swap_int>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    %eax,(%rdi)
sub    (%rsi),%eax
mov    %eax,(%rsi)
sub    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @swap_int(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = sub nsw i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @swap_int(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = sub nsw i32 %8, %7
store i32 %9, i32* %0
ret void
}
double dabs(double x) {
  if (x >= 0.0)
    return x;
  else
    return -x;
}


x86 assembly (clang, -O0):
<dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <dabs+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114b <dabs+0x4b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
cmpnlesd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fneg double %9
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @dabs(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
scalar_t__ abs(int);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
void main() {
  int y = 4;
  print("y 8");
  y += abs(-4);
  printid(y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <print@plt>
mov    $0xfffffffc,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <print@plt>
mov    $0xfffffffc,%edi
call   1030 <abs@plt>
lea    0x4(%rax),%edi
pop    %rax
jmp    1050 <printid@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"y 8\00"
define void @main() {
%1 = alloca i32
store i32 4, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i64 @abs(i32 -4)
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @printid(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"y 8\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @abs(i32 -4)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 4
%5 = tail call i32 @printid(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x8a() {
  Assert_real((isprint(138) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              695, ("isprint should be 0 for 0x8a"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x8a\00"
define void @t_isprint_0x8a() {
%1 = tail call i64 @isprint(i32 138)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 695, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int is_dots(const char *name, unsigned int len) {
  if (len == 0)
    return 0;
  if (name[0] == '.') {
    if (len == 1)
      return 1;
    if (len == 2 && name[1] == '.')
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_dots>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1121 <is_dots+0x21>
movl   $0x0,-0x4(%rbp)
jmp    117a <is_dots+0x7a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1173 <is_dots+0x73>
cmpl   $0x1,-0x14(%rbp)
jne    1147 <is_dots+0x47>
movl   $0x1,-0x4(%rbp)
jmp    117a <is_dots+0x7a>
cmpl   $0x2,-0x14(%rbp)
jne    116e <is_dots+0x6e>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    116e <is_dots+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    117a <is_dots+0x7a>
jmp    1173 <is_dots+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dots>:
xor    %eax,%eax
test   %esi,%esi
je     1122 <is_dots+0x22>
cmpb   $0x2e,(%rdi)
jne    1120 <is_dots+0x20>
cmp    $0x1,%esi
je     1123 <is_dots+0x23>
cmp    $0x2,%esi
jne    1120 <is_dots+0x20>
mov    $0x1,%eax
cmpb   $0x2e,0x1(%rdi)
je     1122 <is_dots+0x22>
xor    %eax,%eax
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @is_dots(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 46
br i1 %6, label %7, label %12
7: ; preds = %4
switch i32 %1, label %12 [
i32 1, label %13
i32 2, label %8
]
8: ; preds = %7
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 46
br i1 %11, label %13, label %12
12: ; preds = %7, %8, %4
br label %13
13: ; preds = %8, %7, %2, %12
%14 = phi i32 [ 0, %12 ], [ 0, %2 ], [ %1, %7 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ ungetch(char);
void ungetchs(char s[]) {
  int len = strlen(s);
  while (len > 0) {
    ungetch(s[--len]);
  }
}


x86 assembly (clang, -O0):
<ungetchs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1160 <ungetchs+0x40>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <ungetch@plt>
jmp    1138 <ungetchs+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungetchs>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <ungetchs+0x37>
mov    %eax,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsbl (%r14,%rax,1),%edi
call   1040 <ungetch@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1140 <ungetchs+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ungetchs(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @ungetch(i8 signext %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %1
ret void
}
void X509v3_get_ext_by_NID(void) {}


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

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

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

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

/* Variables and functions */
int _mm_cvt_ss2si(int /*<<< orphan*/);
int test_mm_cvt_ss2si(__m128 A) { return _mm_cvt_ss2si(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvt_ss2si>:
jmp    1030 <_mm_cvt_ss2si@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvt_ss2si(i32 %0) {
%2 = tail call i32 @_mm_cvt_ss2si(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *appname) {
  printf("Usage: %s -f func -o output.txt "
         "\t-d ((src - dest) < strlen(dest)) -p PROGRAM\n"
         "\t-o --output	output to file, stdout default\n"
         "\t-f --function	function that want to be hook\n"
         "\t-c --condition	condition trigger\n"
         "\t-p --program	program that want to check\n"
         "\t-h --help	this message\n",
         appname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [266 x i8] c"Usage: %s -f func -o output.txt \09-d ((src - dest) < strlen(dest)) -p PROGRAM\0A\09-o --output\09output to file, stdout default\0A\09-f --function\09function that want to be hook\0A\09-c --condition\09condition trigger\0A\09-p --program\09program that want to check\0A\09-h --help\09this message\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([266 x i8], [266 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [266 x i8] c"Usage: %s -f func -o output.txt \09-d ((src - dest) < strlen(dest)) -p PROGRAM\0A\09-o --output\09output to file, stdout default\0A\09-f --function\09function that want to be hook\0A\09-c --condition\09condition trigger\0A\09-p --program\09program that want to check\0A\09-h --help\09this message\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([266 x i8], [266 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int EINVAL;
void *spx_alloc(int, size_t const, int *);
void *spx_alloc_alone(const size_t s, int *err) {
  if (0 == s) {
    *err = EINVAL;
    return NULL;
  }
  return spx_alloc(1, s, err);
}


x86 assembly (clang, -O0):
<spx_alloc_alone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1148 <spx_alloc_alone+0x38>
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    115e <spx_alloc_alone+0x4e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%edi
call   1030 <spx_alloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spx_alloc_alone>:
mov    %rsi,%rdx
test   %rdi,%rdi
je     1125 <spx_alloc_alone+0x15>
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <spx_alloc@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rdx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i8* @spx_alloc_alone(i64 %0, i32* %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @EINVAL
store i32 %5, i32* %1
br label %8
6: ; preds = %2
%7 = tail call i8* @spx_alloc(i32 1, i64 %0, i32* %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ null, %4 ], [ %7, %6 ]
ret i8* %9
}
__attribute__((always_)) int srcu_read_lock_held(struct srcu_struct *sp) {
  return 1;
}


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

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

LLVM IR (-O0):
%struct.srcu_struct = type opaque
define i32 @srcu_read_lock_held(%struct.srcu_struct* %0) {
%2 = alloca %struct.srcu_struct*
store %struct.srcu_struct* %0, %struct.srcu_struct** %2
ret i32 1
}

LLVM IR (-O2):
%struct.srcu_struct = type opaque
define i32 @srcu_read_lock_held(%struct.srcu_struct* nocapture readnone %0) {
ret i32 1
}
void ad_int2(char **pbuf, int inint) {
  **pbuf = (char)((inint >> 8) & 0x00FF);
  (*pbuf)++;
  **pbuf = (char)(inint & 0x00FF);
  (*pbuf)++;
}


x86 assembly (clang, -O0):
<ad_int2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ad_int2>:
mov    %esi,%eax
mov    (%rdi),%rcx
mov    %ah,(%rcx)
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,0x1(%rcx)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @ad_int2(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
store i8 %8, i8* %10
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %11
%14 = load i32, i32* %4
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8**, i8*** %3
%18 = load i8*, i8** %17
store i8 %16, i8* %18
%19 = load i8**, i8*** %3
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %19
ret void
}

LLVM IR (-O2):
define void @ad_int2(i8** nocapture %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = load i8*, i8** %0
store i8 %4, i8* %5
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
%8 = trunc i32 %1 to i8
store i8 %8, i8* %7
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
ret void
}
int _int_ptr_cmpfunc(void *self, void *other) {
  return !!(*(int *)self < *(int *)other);
}


x86 assembly (clang, -O0):
<_int_ptr_cmpfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_int_ptr_cmpfunc>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @_int_ptr_cmpfunc(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp slt i32 %7, %10
%12 = xor i1 %11, true
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @_int_ptr_cmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}