xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int *a, int n) {
  for (; n > 0;)
    printf("%d ", a[--n]);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114d <print+0x3d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <print+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <print+0x39>
mov    %rdi,%r15
mov    %esi,%ebx
add    $0x1,%rbx
lea    0xed7(%rip),%r14
nopl   0x0(%rax)
lea    -0x2(%rbx),%eax
mov    (%r15,%rax,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <print+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @print(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 = %8, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, -1
store i32 %11, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 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 i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
int is_dot_or_dotdot(const char *name) {
  return (name[0] == '.' &&
          (name[1] == '\0' || (name[1] == '.' && name[2] == '\0')));
}


x86 assembly (clang, -O0):
<is_dot_or_dotdot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    1166 <is_dot_or_dotdot+0x66>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1160 <is_dot_or_dotdot+0x60>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0xb(%rbp)
jne    115a <is_dot_or_dotdot+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dot_or_dotdot>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    111c <is_dot_or_dotdot+0x1c>
mov    0x1(%rdi),%cl
test   %cl,%cl
je     111d <is_dot_or_dotdot+0x1d>
cmp    $0x2e,%cl
jne    111c <is_dot_or_dotdot+0x1c>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_dot_or_dotdot(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 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 46
br i1 %7, label %8, label %30
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %28, label %14
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 46
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 0
br label %26
26: ; preds = %20, %14
%27 = phi i1 [ false, %14 ], [ %25, %20 ]
br label %28
28: ; preds = %26, %8
%29 = phi i1 [ true, %8 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %1
%31 = phi i1 [ false, %1 ], [ %29, %28 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @is_dot_or_dotdot(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %12 [
i8 0, label %13
i8 46, label %7
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
br label %13
12: ; preds = %4
br label %13
13: ; preds = %4, %12, %7, %1
%14 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %11, %7 ], [ 0, %12 ]
ret i32 %14
}
const char *dbg_get_key_dump(const struct ubifs_info *c,
                             const union ubifs_key *key) {
  return "";
}


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

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
%union.ubifs_key = type opaque
@.str = [1 x i8] zeroinitializer
define i8* @dbg_get_key_dump(%struct.ubifs_info* %0, %union.ubifs_key* %1) {
%3 = alloca %struct.ubifs_info*
%4 = alloca %union.ubifs_key*
store %struct.ubifs_info* %0, %struct.ubifs_info** %3
store %union.ubifs_key* %1, %union.ubifs_key** %4
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%union.ubifs_key = type opaque
@.str = [1 x i8] zeroinitializer
define i8* @dbg_get_key_dump(%struct.ubifs_info* nocapture readnone %0, %union.ubifs_key* nocapture readnone %1) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ subwindow;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
unsigned long get_XLeaveWindowEvent_subwindow(void *_p) {
  return (unsigned long)((XLeaveWindowEvent *)_p)->subwindow;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XLeaveWindowEvent_subwindow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XLeaveWindowEvent_subwindow(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ write_error(char *);
void no_ifaces_error(void) {
  write_error(
      "No active interfaces. Check their status or the /proc filesystem");
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c"No active interfaces. Check their status or the /proc filesystem\00"
define void @no_ifaces_error() {
%1 = call i32 @write_error(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"No active interfaces. Check their status or the /proc filesystem\00"
define void @no_ifaces_error() {
%1 = tail call i32 @write_error(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double ceil(double);
double round_up(double x, double scale) {
  return (scale == 1.0 ? ceil(x) : ceil(x / scale) * scale);
}


x86 assembly (clang, -O0):
<round_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1153 <round_up+0x43>
jp     1153 <round_up+0x43>
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    116c <round_up+0x5c>
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <ceil@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up>:
push   %rax
ucomisd 0xee7(%rip),%xmm1
jne    1123 <round_up+0x13>
jp     1123 <round_up+0x13>
pop    %rax
jmp    1030 <ceil@plt>
divsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <ceil@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @round_up(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp oeq double %5, 1.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %3
%9 = call double @llvm.ceil.f64(double %8)
br label %17
10: ; preds = %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fdiv double %11, %12
%14 = call double @llvm.ceil.f64(double %13)
%15 = load double, double* %4
%16 = fmul double %14, %15
br label %17
17: ; preds = %10, %7
%18 = phi double [ %9, %7 ], [ %16, %10 ]
ret double %18
}

LLVM IR (-O2):
define double @round_up(double %0, double %1) {
%3 = fcmp oeq double %1, 1.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call double @llvm.ceil.f64(double %0)
br label %10
6: ; preds = %2
%7 = fdiv double %0, %1
%8 = tail call double @llvm.ceil.f64(double %7)
%9 = fmul double %8, %1
br label %10
10: ; preds = %6, %4
%11 = phi double [ %5, %4 ], [ %9, %6 ]
ret double %11
}
char *RCSid() {
  return RCSid("$Id: stats.c,v 1.3.2.4 2013/04/12 17:21:57 sfeam Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [55 x i8] c"$Id: stats.c,v 1.3.2.4 2013/04/12 17:21:57 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ doSystem(char *);
int main() {
  doSystem("exit 1");
  doSystem("./does-not-exist");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <doSystem@plt>
lea    0xed5(%rip),%rdi
call   1030 <doSystem@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <doSystem@plt>
lea    0xee3(%rip),%rdi
call   1030 <doSystem@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"exit 1\00"
@.str.1 = [17 x i8] c"./does-not-exist\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @doSystem(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @doSystem(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [7 x i8] c"exit 1\00"
@.str.1 = [17 x i8] c"./does-not-exist\00"
define i32 @main() {
%1 = tail call i32 @doSystem(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @doSystem(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
unsigned long make_mask(unsigned long x) {
  x = x | x >> 1;
  x = x | x >> 2;
  x = x | x >> 4;
  x = x | x >> 8;
  x = x | x >> 16;
  return x;
}


x86 assembly (clang, -O0):
<make_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x10,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_mask>:
mov    %rdi,%rax
shr    %rax
or     %rdi,%rax
mov    %rax,%rcx
shr    $0x2,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x4,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x8,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x10,%rax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @make_mask(i64 %0) {
%2 = lshr i64 %0, 1
%3 = or i64 %2, %0
%4 = lshr i64 %3, 2
%5 = or i64 %4, %3
%6 = lshr i64 %5, 4
%7 = or i64 %6, %5
%8 = lshr i64 %7, 8
%9 = or i64 %8, %7
%10 = lshr i64 %9, 16
%11 = or i64 %10, %9
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ print_fibonacci(int);
int main() { print_fibonacci(10); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <print_fibonacci@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <print_fibonacci@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @print_fibonacci(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_fibonacci(i32 10)
ret i32 0
}
/* Type definitions */
struct spx_msg {
  int dummy;
};

/* Variables and functions */
int spx_msg_unpack_i32(struct spx_msg *);
int spx_msg_unpack_int(struct spx_msg *ctx) { return spx_msg_unpack_i32(ctx); }


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

x86 assembly (clang, -O2):
<spx_msg_unpack_int>:
jmp    1030 <spx_msg_unpack_i32@plt>

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

LLVM IR (-O2):
%struct.spx_msg = type { i32 }
define i32 @spx_msg_unpack_int(%struct.spx_msg* %0) {
%2 = tail call i32 @spx_msg_unpack_i32(%struct.spx_msg* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int);
scalar_t__ isprint(int);
int /*<<< orphan*/ isspace(int);
int ispunct(int c) { return (isprint(c) && !isspace(c) && !isalnum(c)); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <isprint@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115a <ispunct+0x2a>
mov    %ebp,%edi
call   1040 <isspace@plt>
test   %eax,%eax
jne    115a <ispunct+0x2a>
mov    %ebp,%edi
call   1030 <isalnum@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isprint(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isspace(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @isalnum(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @isspace(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @isalnum(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
int xmlUCSIsTaiXuanJingSymbols(int code) {
  return (((code >= 0x1D300) && (code <= 0x1D35F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsTaiXuanJingSymbols>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1d300,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsTaiXuanJingSymbols+0x26>
cmpl   $0x1d35f,-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):
<xmlUCSIsTaiXuanJingSymbols>:
add    $0xfffe2d00,%edi
xor    %eax,%eax
cmp    $0x60,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsTaiXuanJingSymbols(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 119552
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 119647
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 @xmlUCSIsTaiXuanJingSymbols(i32 %0) {
%2 = add i32 %0, -119552
%3 = icmp ult i32 %2, 96
%4 = zext i1 %3 to i32
ret i32 %4
}
void dummy_free(void *p) {}


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

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

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

LLVM IR (-O2):
define void @dummy_free(i8* nocapture %0) {
ret void
}
int min(int i, int j) { return i < j ? i : j; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ kputc(int /*<<< orphan*/);
void kputs(const char *s) {
  while (*s) {
    kputc(*s++);
  }
}


x86 assembly (clang, -O0):
<kputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <kputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <kputc@plt>
jmp    111c <kputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <kputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <kputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <kputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @kputc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void destroy_no_ops(void **data) { return; }


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

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

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

LLVM IR (-O2):
define void @destroy_no_ops(i8** nocapture %0) {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int days_from_0(int);
int32_t days_from_1970(int32_t year) {
  const int days_from_0_to_1970 = days_from_0(1970);
  return days_from_0(year) - days_from_0_to_1970;
}


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

x86 assembly (clang, -O2):
<days_from_1970>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x7b2,%edi
call   1030 <days_from_0@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <days_from_0@plt>
sub    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @days_from_1970(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @days_from_0(i32 1970)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @days_from_0(i32 %5)
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @days_from_1970(i32 %0) {
%2 = tail call i32 @days_from_0(i32 1970)
%3 = tail call i32 @days_from_0(i32 %0)
%4 = sub nsw i32 %3, %2
ret i32 %4
}
int test_imm_CAint16_reg(short val) {
  return ((val) & (-0xCA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CAint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff36,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CAint16_reg>:
test   $0xff36,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CAint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -202
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_CAint16_reg(i16 signext %0) {
%2 = and i16 %0, -202
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xc9() {
  Assert_real((isupper(201) == 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_isupper.c",
              1010, ("isupper should be 0 for 0xc9"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xc9>:
push   %rax
mov    $0xc9,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3f2,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xc9\00"
define void @t_isupper_0xc9() {
%1 = call i64 @isupper(i32 201)
%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 1010, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xc9\00"
define void @t_isupper_0xc9() {
%1 = tail call i64 @isupper(i32 201)
%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 1010, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Soft_SPI_Write(char);
void SPI_Write_Bytes(char *buffer, unsigned NoBytes) {
  int i;
  for (i = 0; i < NoBytes; i++)
    Soft_SPI_Write(buffer[i]);
}


x86 assembly (clang, -O0):
<SPI_Write_Bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1151 <SPI_Write_Bytes+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <Soft_SPI_Write@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <SPI_Write_Bytes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_Write_Bytes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <SPI_Write_Bytes+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <Soft_SPI_Write@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <SPI_Write_Bytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @SPI_Write_Bytes(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @Soft_SPI_Write(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int vlan_hdr_shift(unsigned int offset) { return offset + 2; }


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

x86 assembly (clang, -O2):
<vlan_hdr_shift>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @vlan_hdr_shift(i32 %0) {
%2 = add i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int yaffs_access_reldir(int /*<<< orphan*/, char const *, int);
int yaffs_access(const char *path, int amode) {
  return yaffs_access_reldir((0), path, amode);
}


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

x86 assembly (clang, -O2):
<yaffs_access>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_access_reldir@plt>

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

LLVM IR (-O2):
define i32 @yaffs_access(i8* %0, i32 %1) {
%3 = tail call i32 @yaffs_access_reldir(i32 0, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *str) {
  int n = strlen(str) + 1;
  char *dup = malloc(n);
  if (dup) {
    strcpy(dup, str);
  }
  return dup;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116f <strdup+0x3f>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <strdup+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
br label %16
16: ; preds = %12, %1
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
void *malloc(int);
void *CRYPTO_malloc(int num, const char *file, int line) { return malloc(num); }


x86 assembly (clang, -O0):
<CRYPTO_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @CRYPTO_malloc(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i8* @malloc(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @CRYPTO_malloc(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i8* @malloc(i32 %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ ls_usage(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void ls_help(void) {
  ls_usage(stdout);
  fputs("List resources in a file's resource fork.\n"
        "\n"
        "options:\n"
        "  -bytes        display sizes in bytes instead of using prefixes\n"
        "  -sort <key>   "
        "sort resources, key can be id (default), index, or size\n"
        "  -flat         "
        "display all resources in one list, instead of one per type\n"
        "  -reverse      reverse sort order\n",
        stdout);
}


x86 assembly (clang, -O0):
<ls_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <ls_usage@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_help>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
call   1040 <ls_usage@plt>
mov    (%rbx),%esi
lea    0xec8(%rip),%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [300 x i8] c"List resources in a file's resource fork.\0A\0Aoptions:\0A -bytes display sizes in bytes instead of using prefixes\0A -sort <key> sort resources, key can be id (default), index, or size\0A -flat display all resources in one list, instead of one per type\0A -reverse reverse sort order\0A\00"
define void @ls_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @ls_usage(i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [300 x i8] c"List resources in a file's resource fork.\0A\0Aoptions:\0A -bytes display sizes in bytes instead of using prefixes\0A -sort <key> sort resources, key can be id (default), index, or size\0A -flat display all resources in one list, instead of one per type\0A -reverse reverse sort order\0A\00"
define void @ls_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @ls_usage(i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  short y;
};
typedef TYPE_1__ XPoint;

/* Variables and functions */
void set_XPoint_y(void *_p, short _v) { ((XPoint *)_p)->y = (short)_v; }


x86 assembly (clang, -O0):
<set_XPoint_y>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XPoint_y>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XPoint_y(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XPoint_y(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
int test(char *);
int main(void) {
  int result = 0;
  result |= test("C");
  result |= test("en_US.ISO-8859-1");
  result |= test("de_DE.UTF-8");
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <test@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <test@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xec2(%rip),%rdi
call   1030 <test@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <test@plt>
mov    %eax,%ebx
lea    0xeda(%rip),%rdi
call   1030 <test@plt>
mov    %eax,%ebp
or     %ebx,%ebp
lea    0xedb(%rip),%rdi
call   1030 <test@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"C\00"
@.str.1 = [17 x i8] c"en_US.ISO-8859-1\00"
@.str.2 = [12 x i8] c"de_DE.UTF-8\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = or i32 %4, %3
store i32 %5, i32* %2
%6 = call i32 @test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = call i32 @test(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = or i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"C\00"
@.str.1 = [17 x i8] c"en_US.ISO-8859-1\00"
@.str.2 = [12 x i8] c"de_DE.UTF-8\00"
define i32 @main() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = or i32 %2, %1
%4 = tail call i32 @test(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
char *findJsonBeginning(char const *);
int /*<<< orphan*/ *findJsonEnd(char const *);
int isCompleteJson(const char *data) {
  data = findJsonBeginning(data);
  if (!data)
    return 0;
  return (findJsonEnd(data) != NULL);
}


x86 assembly (clang, -O0):
<isCompleteJson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <findJsonBeginning@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <isCompleteJson+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1168 <isCompleteJson+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <findJsonEnd@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCompleteJson>:
push   %rax
call   1040 <findJsonBeginning@plt>
test   %rax,%rax
je     1140 <isCompleteJson+0x20>
mov    %rax,%rdi
call   1030 <findJsonEnd@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isCompleteJson(i8* %0) {
%2 = tail call i8* @findJsonBeginning(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32* @findJsonEnd(i8* %2)
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int test_imm_96int8_mem(signed char *val) {
  return ((*val) & (0x96 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_96int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x96,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_96int8_mem>:
testb  $0x96,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_96int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 150
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_96int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -106
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ SamsungAppName;

/* Variables and functions */
int strncmp(char *, char *, int);
int isRCSamsung(char *appName, int appNameLen) {
  char SamsungAppName[] = "iapp.samsung";
  return (strncmp(appName + appNameLen - sizeof(SamsungAppName), SamsungAppName,
                  sizeof(SamsungAppName)));
}


x86 assembly (clang, -O0):
<isRCSamsung>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xed3(%rip),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
add    $0xfffffffffffffff3,%rdi
lea    -0x19(%rbp),%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRCSamsung>:
sub    $0x18,%rsp
movabs $0x676e75736d6173,%rax
mov    %rax,0xd(%rsp)
movabs $0x6d61732e70706169,%rax
73 61 6d
mov    %rax,0x8(%rsp)
movslq %esi,%rax
add    %rax,%rdi
add    $0xfffffffffffffff3,%rdi
lea    0x8(%rsp),%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.isRCSamsung.SamsungAppName = [13 x i8] c"iapp.samsung\00"
define i32 @isRCSamsung(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [13 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [13 x i8]* %5 to i8*
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 -13
%12 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%13 = call i32 @strncmp(i8* %11, i8* %12, i32 13)
ret i32 %13
}

LLVM IR (-O2):
@__const.isRCSamsung.SamsungAppName = [13 x i8] c"iapp.samsung\00"
define i32 @isRCSamsung(i8* %0, i32 %1) {
%3 = alloca [13 x i8]
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -13
%8 = call i32 @strncmp(i8* %7, i8* %4, i32 13)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Atm128AlarmAsyncP__0__Alarm__stop();
void AlarmToTimerC__0__Alarm__stop(void) {
  Atm128AlarmAsyncP__0__Alarm__stop();
}


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

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

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

LLVM IR (-O2):
define void @AlarmToTimerC__0__Alarm__stop() {
%1 = tail call i32 (...) @Atm128AlarmAsyncP__0__Alarm__stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnbr(int);
int put_play(int x, int y) {
  (void)y;
  (void)x;
  ft_putnbr(y);
  ft_putchar(' ');
  ft_putnbr(x);
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<put_play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ft_putnbr@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%edi
call   1040 <ft_putnbr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_play>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <ft_putnbr@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
mov    %ebx,%edi
call   1040 <ft_putnbr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @put_play(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @ft_putnbr(i32 %7)
%9 = call i32 @ft_putchar(i8 signext 32)
%10 = load i32, i32* %3
%11 = call i32 @ft_putnbr(i32 %10)
%12 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @put_play(i32 %0, i32 %1) {
%3 = tail call i32 @ft_putnbr(i32 %1)
%4 = tail call i32 @ft_putchar(i8 signext 32)
%5 = tail call i32 @ft_putnbr(i32 %0)
%6 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emscripten_run_script(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void c_writeback(char *str) {
  char *buf = malloc(1024 * 2);
  if (!buf)
    exit(1);
  sprintf(buf, "writeback(\"%s\");", str);
  emscripten_run_script(buf);
  free(buf);
}


x86 assembly (clang, -O0):
<c_writeback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x800,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117f <c_writeback+0x2f>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe72(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <emscripten_run_script@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_writeback>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x800,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1192 <c_writeback+0x42>
mov    %rax,%rbx
lea    0xe90(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <emscripten_run_script@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"writeback(\22%s\22);\00"
define void @c_writeback(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 2048)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @emscripten_run_script(i8* %13)
%15 = load i8*, i8** %3
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"writeback(\22%s\22);\00"
define void @c_writeback(i8* %0) {
%2 = tail call dereferenceable_or_null(2048) i8* @malloc(i32 2048)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @emscripten_run_script(i8* %2)
%9 = tail call i32 @free(i8* %2)
ret void
}