xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int strlen(char const *);
int barFS_write(const char *data) {
  printf("bar: %s\n", data);
  return (strlen(data));
}


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

x86 assembly (clang, -O2):
<barFS_write>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"bar: %s\0A\00"
define i32 @barFS_write(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @strlen(i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fe_irc_dcc_init();
int /*<<< orphan*/ fe_irc_notifylist_init();
void fe_irc_modules_init(void) {
  fe_irc_dcc_init();
  fe_irc_notifylist_init();
}


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

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

LLVM IR (-O0):
define void @fe_irc_modules_init() {
%1 = call i32 (...) @fe_irc_dcc_init()
%2 = call i32 (...) @fe_irc_notifylist_init()
ret void
}

LLVM IR (-O2):
define void @fe_irc_modules_init() {
%1 = tail call i32 (...) @fe_irc_dcc_init()
%2 = tail call i32 (...) @fe_irc_notifylist_init()
ret void
}
void fdmi_dtype_op_MAX_double(void *a, void *b) {
  (*(double *)a =
       (((*(double *)a) > (*(double *)b)) ? *(double *)a : *(double *)b));
}


x86 assembly (clang, -O0):
<fdmi_dtype_op_MAX_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1134 <fdmi_dtype_op_MAX_double+0x34>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1141 <fdmi_dtype_op_MAX_double+0x41>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdmi_dtype_op_MAX_double>:
movsd  (%rdi),%xmm0
maxsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @fdmi_dtype_op_MAX_double(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 double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp ogt double %7, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to double*
%15 = load double, double* %14
br label %20
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to double*
%19 = load double, double* %18
br label %20
20: ; preds = %16, %12
%21 = phi double [ %15, %12 ], [ %19, %16 ]
%22 = load i8*, i8** %3
%23 = bitcast i8* %22 to double*
store double %21, double* %23
ret void
}

LLVM IR (-O2):
define void @fdmi_dtype_op_MAX_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = select i1 %7, double %4, double %6
store double %8, double* %3
ret void
}
void *f2_1(void *a, int b) { return (a += b); }


x86 assembly (clang, -O0):
<f2_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2_1>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @f2_1(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 = load i8*, i8** %3
%7 = sext i32 %5 to i64
%8 = getelementptr i8, i8* %6, i64 %7
store i8* %8, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @f2_1(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr i8, i8* %0, i64 %3
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long time;
};
struct TYPE_4__ {
  TYPE_1__ xselectionclear;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xselectionclear_time(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xselectionclear.time = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xselectionclear_time>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xselectionclear_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
char *strcpy(char *des, const char *src) {
  int i = 0;
  while (src[i] != '\0') {
    des[i] = src[i];
    i++;
  }
  des[i] = '\0';
  return des;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Type definitions */
struct TalpaPacket_VettingDetails {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct TalpaPacket_VettingDetails *);
void vc_release(int handle, struct TalpaPacket_VettingDetails *packet) {
  (void)handle;
  free(packet);
  return;
}


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

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

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

LLVM IR (-O2):
%struct.TalpaPacket_VettingDetails = type { i32 }
define void @vc_release(i32 %0, %struct.TalpaPacket_VettingDetails* nocapture %1) {
%3 = tail call i32 @free(%struct.TalpaPacket_VettingDetails* %1)
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
int endEMBL(char *s, int *addend) {
  *addend = 0;
  return ((strstr(s, "//") != NULL) || (strstr(s, "ID   ") == s));
}


x86 assembly (clang, -O0):
<endEMBL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    0xecb(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1166 <endEMBL+0x56>
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strstr@plt>
cmp    -0x8(%rbp),%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endEMBL>:
push   %rbx
mov    %rdi,%rbx
movl   $0x0,(%rsi)
lea    0xecf(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1145 <endEMBL+0x25>
pop    %rbx
ret
lea    0xeb7(%rip),%rsi
mov    $0x5,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"//\00"
@.str.1 = [6 x i8] c"ID \00"
define i32 @endEMBL(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
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = call i8* @strstr(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i8* @strstr(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = load i8*, i8** %3
%13 = icmp eq i8* %11, %12
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"//\00"
@.str.1 = [6 x i8] c"ID \00"
define i32 @endEMBL(i8* %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 5)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
int _kill(int id, int s) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_kill(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void talk(void) { say("Mr.SmileStein's fertilizers and formulas.", 1); }


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

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Mr.SmileStein's fertilizers and formulas.\00"
define void @talk() {
%1 = call i32 @say(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Mr.SmileStein's fertilizers and formulas.\00"
define void @talk() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
float floatFromData(unsigned char *data) {
  int i = 0x00;
  i |= (data[7] << 24);
  i |= (data[6] << 16);
  i |= (data[5] << 8);
  i |= (data[4]);
  return *(float *)&i;
}


x86 assembly (clang, -O0):
<floatFromData>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatFromData>:
movss  0x4(%rdi),%xmm0
ret

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

LLVM IR (-O2):
define float @floatFromData(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 6
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 5
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i8, i8* %0, i64 4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
%20 = bitcast i32 %19 to float
ret float %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("This is a test project!!!!!\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"This is a test project!!!!!\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"This is a test project!!!!!\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lib_main_exit();
void __attribute__((destructor)) lib_destructor() { lib_main_exit(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @lib_destructor, i8* null }]
define void @lib_destructor() {
%1 = call i32 (...) @lib_main_exit()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @lib_destructor, i8* null }]
define void @lib_destructor() {
%1 = tail call i32 (...) @lib_main_exit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int sqlite3_exec(int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int mvcard(sqlite3 *db, int plid, int nlid) {
  char sql[512];
  snprintf(sql, 512, "UPDATE id SET lid=%d WHERE lid=%d;", nlid, plid);
  return sqlite3_exec(db, sql, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<mvcard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    $0x200,%esi
lea    0xeb1(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <sqlite3_exec@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvcard>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %edx,%ecx
mov    %esi,%r8d
mov    %rdi,%rbx
lea    0xec7(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x200,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sqlite3_exec@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"UPDATE id SET lid=%d WHERE lid=%d;\00"
define i32 @mvcard(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [512 x i8]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = call i32 @snprintf(i8* %8, i32 512, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32*, i32** %4
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = call i32 @sqlite3_exec(i32* %12, i8* %13, i32* null, i32* null, i32* null)
ret i32 %14
}

LLVM IR (-O2):
@.str = [35 x i8] c"UPDATE id SET lid=%d WHERE lid=%d;\00"
define i32 @mvcard(i32* %0, i32 %1, i32 %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 512, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %1)
%7 = call i32 @sqlite3_exec(i32* %0, i8* %5, i32* null, i32* null, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ f1(int, int, int, int, int);
int __attribute__((no)) f2(int a, int b, int c, int d, int e) {
  if ((b & 0x1111) != 1)
    f1(a, b, c, d, e);
  return 0;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1111,%eax
cmp    $0x1,%eax
je     114e <f2+0x3e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <f1@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %esi,%eax
and    $0x1111,%eax
cmp    $0x1,%eax
je     1126 <f2+0x16>
push   %rax
call   1030 <f1@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = and i32 %1, 4369
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @f1(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
br label %10
10: ; preds = %8, %5
ret i32 0
}
int max_at_once(unsigned int lev) {
  return ((2 + lev / 4) < (12) ? (2 + lev / 4) : (12));
}


x86 assembly (clang, -O0):
<max_at_once>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
add    $0x2,%eax
cmp    $0xc,%eax
jae    112a <max_at_once+0x2a>
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <max_at_once+0x37>
mov    $0xc,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <max_at_once+0x37>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_at_once>:
mov    %edi,%ecx
shr    $0x2,%ecx
add    $0x2,%ecx
cmp    $0x28,%edi
mov    $0xc,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @max_at_once(i32 %0) {
%2 = icmp ult i32 %0, 40
%3 = lshr i32 %0, 2
%4 = add nuw nsw i32 %3, 2
%5 = select i1 %2, i32 %4, i32 12
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ addfield(char *, char *);
char *strchr(char *, char);
char *strdup(char *);
void addprefix(char *s, char *filename) {
  char *filename_cpy, *p;
  filename_cpy = strdup(filename);
  if (NULL != (p = strchr(filename_cpy, '.')))
    *p = '\0';
  addfield(s, filename_cpy);
}


x86 assembly (clang, -O0):
<addprefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     1174 <addprefix+0x44>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <addfield@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addprefix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1157 <addprefix+0x27>
movb   $0x0,(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <addfield@plt>

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

LLVM IR (-O2):
define void @addprefix(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strdup(i8* %1)
%4 = tail call i8* @strchr(i8* dereferenceable(1) %3, i8 signext 46)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %2
store i8 0, i8* %4
br label %7
7: ; preds = %6, %2
%8 = tail call i32 @addfield(i8* %0, i8* %3)
ret void
}
int rvarr(int n, int a[restrict n]) { return a[2]; }


x86 assembly (clang, -O0):
<rvarr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rvarr>:
mov    0x8(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @rvarr(i32 %0, i32* noalias nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 2
%4 = load i32, i32* %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswcntrl(int /*<<< orphan*/);
int __iswcntrl_l(wint_t c, locale_t l) { return iswcntrl(c); }


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

x86 assembly (clang, -O2):
<__iswcntrl_l>:
jmp    1030 <iswcntrl@plt>

LLVM IR (-O0):
define i32 @__iswcntrl_l(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 = call i32 @iswcntrl(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__iswcntrl_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswcntrl(i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t Q_GetRandom(uint16_t *lfsr) {
  uint16_t d = *lfsr;
  d = (d << 1) | (((d >> 14) ^ (d >> 6)) & 1);
  *lfsr = d;
  return d;
}


x86 assembly (clang, -O0):
<Q_GetRandom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
sar    $0xe,%ecx
mov    -0xc(%rbp),%edx
sar    $0x6,%edx
xor    %edx,%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_GetRandom>:
mov    (%rdi),%eax
mov    %eax,%ecx
shr    $0xe,%ecx
mov    %eax,%edx
shr    $0x6,%edx
xor    %ecx,%edx
and    $0x1,%edx
lea    (%rdx,%rax,2),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @Q_GetRandom(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 1
%4 = lshr i32 %2, 14
%5 = lshr i32 %2, 6
%6 = xor i32 %4, %5
%7 = and i32 %6, 1
%8 = or i32 %7, %3
store i32 %8, i32* %0
ret i32 %8
}
/* Type definitions */
struct rb_root {
  int dummy;
};
struct rb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __rb_insert(struct rb_node *, struct rb_root *);
void rb_insert_color(struct rb_node *node, struct rb_root *root) {
  __rb_insert(node, root);
}


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

x86 assembly (clang, -O2):
<rb_insert_color>:
jmp    1030 <__rb_insert@plt>

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

LLVM IR (-O2):
%struct.rb_node = type { i32 }
%struct.rb_root = type { i32 }
define void @rb_insert_color(%struct.rb_node* %0, %struct.rb_root* %1) {
%3 = tail call i32 @__rb_insert(%struct.rb_node* %0, %struct.rb_root* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ spawn(int, char **);
int main(int argc, char *argv[]) {
  spawn(argc - 2, argv);
  printf("\nthe end\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
mov    -0x10(%rbp),%rsi
call   1040 <spawn@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
add    $0xfffffffe,%edi
call   1040 <spawn@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [9 x i8] c"\0Athe end\00"
define i32 @main(i32 %0, i8** %1) {
%3 = add nsw i32 %0, -2
%4 = tail call i32 @spawn(i32 %3, i8** %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 1
}
__attribute__((no, noclone)) signed __int128 t104_5sub(signed __int128 x) {
  signed __int128 r;
  if (__builtin_sub_overflow(
          x,
          (signed __int128)((
              -((signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1)) -
              1)),
          &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t104_5sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
movabs $0x8000000000000000,%rax
sub    %rax,%rcx
seto   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    115d <t104_5sub+0x4d>
jmp    1164 <t104_5sub+0x54>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t104_5sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movabs $0x8000000000000000,%rax
sub    %rax,%rbx
jno    1130 <t104_5sub+0x20>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t104_5sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 %11, i128 -170141183460469231731687303715884105728)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t104_5sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 %6, i128 -170141183460469231731687303715884105728)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
int harmony_pcie_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @harmony_pcie_init() {
ret i32 0
}
/* Variables and functions */
double nth_root(double, int);
double sqrt(double n) { return nth_root(n, 2); }


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <nth_root@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
mov    $0x2,%edi
jmp    1030 <nth_root@plt>

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

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = tail call double @nth_root(double %0, i32 2)
ret double %2
}
int mem_is_zero(const void *mem, int size) {
  const char *p = mem;
  unsigned long i;
  for (i = 0; i < size; i++) {
    if (p[i] != 0x00)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<mem_is_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jae    1163 <mem_is_zero+0x63>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114d <mem_is_zero+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    116a <mem_is_zero+0x6a>
jmp    1152 <mem_is_zero+0x52>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    111b <mem_is_zero+0x1b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_is_zero>:
mov    $0x1,%eax
test   %esi,%esi
je     111f <mem_is_zero+0x1f>
movslq %esi,%rcx
xor    %edx,%edx
xchg   %ax,%ax
cmpb   $0x0,(%rdi,%rdx,1)
jne    1120 <mem_is_zero+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <mem_is_zero+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mem_is_zero(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ %13, %6 ], [ 0, %4 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = add nuw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
int my_main(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @my_main() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void print_uint32_t(uint32_t m) { fprintf(stderr, "%u", m); }


x86 assembly (clang, -O0):
<print_uint32_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uint32_t>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%u\00"
define void @print_uint32_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%u\00"
define void @print_uint32_t(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
unsigned int list_insert(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/ *);
bool test_list_insert_null_params(void) {
  bool pass = false;
  unsigned int res = list_insert(NULL, 0, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_insert_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edx
xor    %esi,%esi
mov    %rdx,%rdi
call   1030 <list_insert@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <test_list_insert_null_params+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_list_insert_null_params() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @list_insert(i32* null, i32 0, 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_insert_null_params() {
%1 = tail call i32 @list_insert(i32* null, i32 0, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, temp;
  scanf("%d%d", &a, &b);
  if (a > b) {
    temp = a;
    a = b;
    b = temp;
  }
  printf("%d %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1161 <main+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%esi
cmp    %esi,%eax
jle    114b <main+0x2b>
mov    %esi,0x4(%rsp)
mov    %eax,(%rsp)
mov    %eax,%edx
jmp    114f <main+0x2f>
mov    %esi,%edx
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 %7, i32* %1
store i32 %6, i32* %2
br label %10
10: ; preds = %9, %0
%11 = phi i32 [ %6, %9 ], [ %7, %0 ]
%12 = phi i32 [ %7, %9 ], [ %6, %0 ]
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %11)
ret i32 0
}
void *_byte_ptr_to_object(void *ptr) { return ptr; }


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

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

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

LLVM IR (-O2):
define i8* @_byte_ptr_to_object(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pf0() { printf("Function Test 0\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Function Test 0\0A\00"
define void @pf0() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Function Test 0\00"
define void @pf0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
void printe(char message[99]) {
  fprintf(stderr, "\n%s %s\n%s",
          "\033[31m"
          "\033[1m"
          "ERROR:"
          "\033[0m"
          "\033[1m",
          message,
          "\033[0m"
          "");
}


x86 assembly (clang, -O0):
<printe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xed0(%rip),%rsi
lea    0xed3(%rip),%rdx
lea    0xee4(%rip),%r8
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printe>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xee0(%rip),%rdx
lea    0xef1(%rip),%r8
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"\0A%s %s\0A%s\00"
@.str.1 = [24 x i8] c"\1B[31m\1B[1mERROR:\1B[0m\1B[1m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @printe(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"\0A%s %s\0A%s\00"
@.str.1 = [24 x i8] c"\1B[31m\1B[1mERROR:\1B[0m\1B[1m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @printe(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ wait(int /*<<< orphan*/ *);
void wait_for_children(int sig) {
  while (wait(NULL) >= 0 || errno == EINTR)
    ;
}


x86 assembly (clang, -O0):
<wait_for_children>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <wait@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jge    1150 <wait_for_children+0x40>
mov    0x2ea3(%rip),%rax
mov    (%rax),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1160 <wait_for_children+0x50>
jmp    1165 <wait_for_children+0x55>
jmp    111b <wait_for_children+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_children>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    0x2eb6(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edi,%edi
call   1030 <wait@plt>
test   %rax,%rax
jns    1130 <wait_for_children+0x20>
mov    (%rbx),%rax
cmp    %rax,(%r14)
je     1130 <wait_for_children+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define void @wait_for_children(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %12, %1
%4 = call i64 @wait(i32* null)
%5 = icmp sge i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
br label %10
10: ; preds = %6, %3
%11 = phi i1 [ true, %3 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %3
13: ; preds = %10
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define void @wait_for_children(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @wait(i32* null)
%4 = icmp sgt i64 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINTR
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 true, i1 %7
br i1 %8, label %2, label %9
9: ; preds = %2
ret void
}