xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int __wcscoll_l(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                int /*<<< orphan*/);
int wcscoll(const wchar_t *l, const wchar_t *r) { return __wcscoll_l(l, r, 0); }


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

x86 assembly (clang, -O2):
<wcscoll>:
xor    %edx,%edx
jmp    1030 <__wcscoll_l@plt>

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

LLVM IR (-O2):
define i32 @wcscoll(i32* %0, i32* %1) {
%3 = tail call i32 @__wcscoll_l(i32* %0, i32* %1, i32 0)
ret i32 %3
}
void gather_forces(double *error_sum, double *forces) {}


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

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

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

LLVM IR (-O2):
define void @gather_forces(double* nocapture %0, double* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
int del_msg() {
  refresh();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @del_msg() {
%1 = call i32 (...) @refresh()
ret i32 0
}

LLVM IR (-O2):
define i32 @del_msg() {
%1 = tail call i32 (...) @refresh()
ret i32 0
}
long compute(long a, long b) {
  long x;
  x = a + b;
  return x;
}


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

x86 assembly (clang, -O2):
<compute>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @compute(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add nsw i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @compute(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
void ufshpb_resume(struct ufs_hba *hba) {}


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

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

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

LLVM IR (-O2):
%struct.ufs_hba = type opaque
define void @ufshpb_resume(%struct.ufs_hba* nocapture %0) {
ret void
}
/* Type definitions */
struct rq_routing_ids {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rq_routing_ids *);
int /*<<< orphan*/ rq_routing_ids_clear(struct rq_routing_ids *);
void rq_routing_ids_free(struct rq_routing_ids *p) {
  rq_routing_ids_clear(p);
  free(p);
}


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

x86 assembly (clang, -O2):
<rq_routing_ids_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rq_routing_ids_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.rq_routing_ids = type { i32 }
define void @rq_routing_ids_free(%struct.rq_routing_ids* %0) {
%2 = alloca %struct.rq_routing_ids*
store %struct.rq_routing_ids* %0, %struct.rq_routing_ids** %2
%3 = load %struct.rq_routing_ids*, %struct.rq_routing_ids** %2
%4 = call i32 @rq_routing_ids_clear(%struct.rq_routing_ids* %3)
%5 = load %struct.rq_routing_ids*, %struct.rq_routing_ids** %2
%6 = call i32 @free(%struct.rq_routing_ids* %5)
ret void
}

LLVM IR (-O2):
%struct.rq_routing_ids = type { i32 }
define void @rq_routing_ids_free(%struct.rq_routing_ids* %0) {
%2 = tail call i32 @rq_routing_ids_clear(%struct.rq_routing_ids* %0)
%3 = tail call i32 @free(%struct.rq_routing_ids* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, char const *, int);
double px_get_double_le(const char *cp) {
  double ret;
  unsigned char *dp = (unsigned char *)&ret;
  if (NULL == cp)
    return 0.0;
  memcpy(dp, cp, 8);
  return ret;
}


x86 assembly (clang, -O0):
<px_get_double_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    113d <px_get_double_le+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1159 <px_get_double_le+0x49>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<px_get_double_le>:
test   %rdi,%rdi
je     1130 <px_get_double_le+0x20>
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @px_get_double_le(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca double
%5 = alloca i8*
store i8* %0, i8** %3
%6 = bitcast double* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = icmp eq i8* null, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store double 0.000000e+00, double* %2
br label %15
10: ; preds = %1
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = call i32 @memcpy(i8* %11, i8* %12, i32 8)
%14 = load double, double* %4
store double %14, double* %2
br label %15
15: ; preds = %10, %9
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @px_get_double_le(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 @memcpy(i8* %3, i8* %0, i32 8)
%7 = load double, double* %2
br label %8
8: ; preds = %1, %5
%9 = phi double [ %7, %5 ], [ 0.000000e+00, %1 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ rtrim(char *);
int strlen(char *);
int continuing(char *s) {
  int sl;
  rtrim(s);
  sl = strlen(s);
  if ((sl > 0) && (s[sl - 1] == '\\')) {
    s[sl - 1] = 0;
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<continuing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <rtrim@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1182 <continuing+0x62>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1182 <continuing+0x62>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
jmp    1189 <continuing+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<continuing>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rtrim@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jle    114b <continuing+0x2b>
add    $0xffffffff,%ecx
cmpb   $0x5c,(%rbx,%rcx,1)
jne    114b <continuing+0x2b>
movb   $0x0,(%rbx,%rcx,1)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @continuing(i8* %0) {
%2 = tail call i32 @rtrim(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = add nsw i32 %3, -1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 92
br i1 %10, label %11, label %12
11: ; preds = %5
store i8 0, i8* %8
br label %12
12: ; preds = %1, %5, %11
%13 = phi i32 [ 1, %11 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %13
}
void GenRecordFxnSize(char *startLabelName, int endLabelNo) {
  (void)startLabelName;
  (void)endLabelNo;
}


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

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

LLVM IR (-O0):
define void @GenRecordFxnSize(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
ret void
}

LLVM IR (-O2):
define void @GenRecordFxnSize(i8* nocapture %0, i32 %1) {
ret void
}
void glColor4x(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glColor4x() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_system();
void main() { init_system(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init_system()
ret void
}
int test_imm_BDuint32_reg(unsigned int val) {
  return ((val) & (0xBD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BDuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xbd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BDuint32_reg>:
test   $0xbd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BDuint32_reg(i32 %0) {
%2 = and i32 %0, 189
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int random();
int /*<<< orphan*/ sleep(int);
void toSleep(int i) {
  printf("Philosopher %d sleeping... \n", i);
  sleep(random() % 10);
  printf("Philosopher %d is awake!!! \n", i);
}


x86 assembly (clang, -O0):
<toSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <random@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1050 <sleep@plt>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toSleep>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <random@plt>
movslq %eax,%rdi
imul   $0x66666667,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edi
call   1050 <sleep@plt>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Philosopher %d sleeping... \0A\00"
@.str.1 = [29 x i8] c"Philosopher %d is awake!!! \0A\00"
define void @toSleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @random()
%6 = srem i32 %5, 10
%7 = call i32 @sleep(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Philosopher %d sleeping... \0A\00"
@.str.1 = [29 x i8] c"Philosopher %d is awake!!! \0A\00"
define void @toSleep(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @random()
%4 = srem i32 %3, 10
%5 = tail call i32 @sleep(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int parseNparams(char const *, int, int, unsigned int **);
int parse3params(const char *params, int required, unsigned int *p1,
                 unsigned int *p2, unsigned int *p3) {
  unsigned int *p[] = {p1, p2, p3};
  return parseNparams(params, required, 3, p);
}


x86 assembly (clang, -O0):
<parse3params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x40(%rbp),%rcx
mov    $0x3,%edx
call   1030 <parseNparams@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse3params>:
sub    $0x18,%rsp
mov    %rdx,(%rsp)
mov    %rcx,0x8(%rsp)
mov    %r8,0x10(%rsp)
mov    %rsp,%rcx
mov    $0x3,%edx
call   1030 <parseNparams@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @parse3params(i8* %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca [3 x i32*]
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%12 = getelementptr inbounds [3 x i32*], [3 x i32*]* %11, i64 0, i64 0
%13 = load i32*, i32** %8
store i32* %13, i32** %12
%14 = getelementptr inbounds i32*, i32** %12, i64 1
%15 = load i32*, i32** %9
store i32* %15, i32** %14
%16 = getelementptr inbounds i32*, i32** %14, i64 1
%17 = load i32*, i32** %10
store i32* %17, i32** %16
%18 = load i8*, i8** %6
%19 = load i32, i32* %7
%20 = getelementptr inbounds [3 x i32*], [3 x i32*]* %11, i64 0, i64 0
%21 = call i32 @parseNparams(i8* %18, i32 %19, i32 3, i32** %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @parse3params(i8* %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca [3 x i32*]
%7 = bitcast [3 x i32*]* %6 to i8*
%8 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
store i32* %2, i32** %8
%9 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 1
store i32* %3, i32** %9
%10 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
store i32* %4, i32** %10
%11 = call i32 @parseNparams(i8* %0, i32 %1, i32 3, i32** %8)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_mult(void) {
  gen_pop();
  gen_call("_mul");
}


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

x86 assembly (clang, -O2):
<gen_mult>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"_mul\00"
define void @gen_mult() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"_mul\00"
define void @gen_mult() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int bar();
void foo20x1(void) {
  unsigned int a = bar();
  if (a > 0x1)
    bar();
}


x86 assembly (clang, -O0):
<foo20x1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jbe    1133 <foo20x1+0x23>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo20x1>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
cmp    $0x2,%eax
jb     1125 <foo20x1+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @foo20x1() {
%1 = alloca i32
%2 = call i32 (...) @bar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ugt i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @bar()
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @foo20x1() {
%1 = tail call i32 (...) @bar()
%2 = icmp ugt i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
struct jslex {
  int dummy;
};

/* Variables and functions */
scalar_t__ my_comma(struct jslex *);
scalar_t__ my_junk_member(struct jslex *);
int my_junk_members(struct jslex *lexer) {
  return my_junk_member(lexer) &&
         (my_comma(lexer) ? my_junk_members(lexer) : 1);
}


x86 assembly (clang, -O0):
<my_junk_members>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_junk_member@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1194 <my_junk_members+0x64>
mov    -0x8(%rbp),%rdi
call   1050 <my_comma@plt>
cmp    $0x0,%rax
je     117b <my_junk_members+0x4b>
mov    -0x8(%rbp),%rdi
call   1040 <my_junk_members@plt>
mov    %eax,-0x10(%rbp)
jmp    1188 <my_junk_members+0x58>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1188 <my_junk_members+0x58>
mov    -0x10(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_junk_members>:
push   %rbx
mov    %rdi,%rbx
call   1030 <my_junk_member@plt>
test   %rax,%rax
je     115e <my_junk_members+0x2e>
mov    %rbx,%rdi
call   1050 <my_comma@plt>
test   %rax,%rax
je     1162 <my_junk_members+0x32>
mov    %rbx,%rdi
call   1040 <my_junk_members@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.jslex = type { i32 }
define i32 @my_junk_members(%struct.jslex* %0) {
%2 = alloca %struct.jslex*
store %struct.jslex* %0, %struct.jslex** %2
%3 = load %struct.jslex*, %struct.jslex** %2
%4 = call i64 @my_junk_member(%struct.jslex* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load %struct.jslex*, %struct.jslex** %2
%8 = call i64 @my_comma(%struct.jslex* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load %struct.jslex*, %struct.jslex** %2
%12 = call i32 @my_junk_members(%struct.jslex* %11)
br label %14
13: ; preds = %6
br label %14
14: ; preds = %13, %10
%15 = phi i32 [ %12, %10 ], [ 1, %13 ]
%16 = icmp ne i32 %15, 0
br label %17
17: ; preds = %14, %1
%18 = phi i1 [ false, %1 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
%struct.jslex = type { i32 }
define i32 @my_junk_members(%struct.jslex* %0) {
%2 = tail call i64 @my_junk_member(%struct.jslex* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @my_comma(%struct.jslex* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1, %4, %9
%8 = phi i32 [ %12, %9 ], [ 0, %1 ], [ 1, %4 ]
ret i32 %8
9: ; preds = %4
%10 = tail call i32 @my_junk_members(%struct.jslex* %0)
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %7
}
const char *temp_dir() {
  const char *tmp = "/tmp";
  return tmp;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"/tmp\00"
define i8* @temp_dir() {
%1 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"/tmp\00"
define i8* @temp_dir() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char getchar();
void skipline() {
  char c;
  while ((c = getchar()) != '\n')
    ;
}


x86 assembly (clang, -O0):
<skipline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1133 <skipline+0x23>
jmp    1118 <skipline+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipline>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <skipline+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @skipline() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @skipline() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
void weechat_backtrace_addr2line(int number, void *address,
                                 const char *symbol) {
  (void)number;
  (void)address;
  (void)symbol;
}


x86 assembly (clang, -O0):
<weechat_backtrace_addr2line>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @weechat_backtrace_addr2line(i32 %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void close_handle(pid_t pid) { printf("fork terminated\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"fork terminated\0A\00"
define void @close_handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = 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"fork terminated\00"
define void @close_handle(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
int emptyp(char *s) {
  for (;;) {
    if (s[0] == '\0')
      return 1;
    else if (s[0] != ' ' && s[0] != '\t')
      return 0;
    else
      s++;
  }
}


x86 assembly (clang, -O0):
<emptyp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1124 <emptyp+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1166 <emptyp+0x66>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1150 <emptyp+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1150 <emptyp+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1166 <emptyp+0x66>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1161 <emptyp+0x61>
jmp    1108 <emptyp+0x8>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyp>:
jmp    1114 <emptyp+0x14>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x9,%al
je     1110 <emptyp+0x10>
cmp    $0x20,%al
je     1110 <emptyp+0x10>
test   %al,%al
jne    1129 <emptyp+0x29>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @emptyp(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %7
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_rcp_ps(int /*<<< orphan*/);
__m128 test_mm_rcp_ps(__m128 x) { return _mm_rcp_ps(x); }


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

x86 assembly (clang, -O2):
<test_mm_rcp_ps>:
jmp    1030 <_mm_rcp_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_rcp_ps(i32 %0) {
%2 = tail call i32 @_mm_rcp_ps(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, char *);
int main(void) {
  char buf[10] = "abc", *str;
  sscanf(buf, "%400", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xec6(%rip),%rsi
call   1030 <sscanf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x0,0x10(%rsp)
movq   $0x636261,0x8(%rsp)
lea    0xedf(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <sscanf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.buf = [10 x i8] c"abc\00\00\00\00\00\00\00"
@.str = [5 x i8] c"%400\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.buf = [10 x i8] c"abc\00\00\00\00\00\00\00"
@.str = [5 x i8] c"%400\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @sscanf(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ getchar();
int scanf(char *, int *);
int read_int() {
  int ret;
  if (scanf("%d", &ret) != 1) {
    err(1, "scanf");
  }
  getchar();
  return ret;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1162 <read_int+0x32>
mov    $0x1,%edi
lea    0xea6(%rip),%rsi
call   1040 <err@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1158 <read_int+0x28>
lea    0xeb5(%rip),%rsi
mov    $0x1,%edi
call   1040 <err@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"scanf\00"
define i32 @read_int() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @err(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = call i32 (...) @getchar()
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"scanf\00"
define i32 @read_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @err(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = call i32 (...) @getchar()
%9 = load i32, i32* %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main(void) {
  unsigned long int x = 0xffffffffffffffffUL;
  printf("X is %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"X is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 -1)
ret i32 0
}
/* Variables and functions */
double DSlater_2S_5S(double, double, double);
double DSlater_5S_2S(double rij, double xii, double xij) {
  return DSlater_2S_5S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<DSlater_5S_2S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <DSlater_2S_5S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSlater_5S_2S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <DSlater_2S_5S@plt>

LLVM IR (-O0):
define double @DSlater_5S_2S(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @DSlater_2S_5S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @DSlater_5S_2S(double %0, double %1, double %2) {
%4 = tail call double @DSlater_2S_5S(double %0, double %2, double %1)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ nfa_set_cmp(void *, void *);
int nfa_set_equal(void *va, void *vb) { return !nfa_set_cmp(va, vb); }


x86 assembly (clang, -O0):
<nfa_set_equal>:
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 <nfa_set_cmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfa_set_equal>:
push   %rax
call   1030 <nfa_set_cmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @nfa_set_equal(i8* %0, i8* %1) {
%3 = tail call i32 @nfa_set_cmp(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void R_GLstate_Replace(void) {}


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

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

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

LLVM IR (-O2):
define void @R_GLstate_Replace() {
ret void
}
void gtk_object_destroy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_object_destroy() {
ret void
}
unsigned int initSet() {
  unsigned int e;
  e = 0x0;
  return e;
}


x86 assembly (clang, -O0):
<initSet>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @initSet() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CLR(int);
void clr_c(void) { CLR(0x80); }


x86 assembly (clang, -O0):
<clr_c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
call   1030 <CLR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_c>:
mov    $0x80,%edi
jmp    1030 <CLR@plt>

LLVM IR (-O0):
define void @clr_c() {
%1 = call i32 @CLR(i32 128)
ret void
}

LLVM IR (-O2):
define void @clr_c() {
%1 = tail call i32 @CLR(i32 128)
ret void
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf37(int f, int n) { return (cbuf(f, n, 37)); }


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

x86 assembly (clang, -O2):
<cbuf37>:
mov    $0x25,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf37(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 37)
ret i32 %3
}
void test() {
  extern volatile unsigned x, y, z;
  x = y + z;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
add    %eax,%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec0(%rip),%rcx
add    (%rcx),%eax
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
@y = external global i32
@z = external global i32
@x = external global i32
define void @test() {
%1 = load volatile i32, i32* @y
%2 = load volatile i32, i32* @z
%3 = add i32 %1, %2
store volatile i32 %3, i32* @x
ret void
}

LLVM IR (-O2):
@y = external global i32
@z = external global i32
@x = external global i32
define void @test() {
%1 = load volatile i32, i32* @y
%2 = load volatile i32, i32* @z
%3 = add i32 %2, %1
store volatile i32 %3, i32* @x
ret void
}
void foo_2_2_1_1_2_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_2_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "mksparse"
        " [-f][-s size] file...\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: mksparse [-f][-s size] file...\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage: mksparse [-f][-s size] file...\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ b64dec_buf(unsigned char const *, int, char *);
char *malloc(int);
char *b64dec(const unsigned char *data, int len) {
  char *dest;
  dest = malloc(len + 1);
  b64dec_buf(data, len, dest);
  return (dest);
}


x86 assembly (clang, -O0):
<b64dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <b64dec_buf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64dec>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
call   1040 <b64dec_buf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @b64dec(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = call i32 @b64dec_buf(i8* %9, i32 %10, i8* %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @b64dec(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @b64dec_buf(i8* %0, i32 %1, i8* %4)
ret i8* %4
}
unsigned int le2int(unsigned char *buf) {
  unsigned int res = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
  return res;
}


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

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

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

LLVM IR (-O2):
define i32 @le2int(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%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 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
void swap(int *array, int num1, int num2) {
  int temp = array[num1];
  array[num1] = array[num2];
  array[num2] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int __attribute__((pure)) strcmp(const char *s1, const char *s2) {
  unsigned int a, b;
  do {
    a = *s1++;
    b = *s2++;
    if (a != b)
      return a - b;
  } while (a != '\0');
  return 0;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     1150 <strcmp+0x50>
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <strcmp+0x66>
jmp    1155 <strcmp+0x55>
cmpl   $0x0,-0x1c(%rbp)
jne    110c <strcmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %13, %2
%4 = phi i8* [ %1, %2 ], [ %14, %13 ]
%5 = phi i8* [ %0, %2 ], [ %15, %13 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = icmp eq i8 %6, %7
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = sext i8 %6 to i32
%11 = sext i8 %7 to i32
%12 = sub nsw i32 %10, %11
br label %17
13: ; preds = %3
%14 = getelementptr inbounds i8, i8* %4, i64 1
%15 = getelementptr inbounds i8, i8* %5, i64 1
%16 = icmp eq i8 %6, 0
br i1 %16, label %17, label %3
17: ; preds = %13, %9
%18 = phi i32 [ %12, %9 ], [ 0, %13 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void pass() {
  printf("Test: PASS\n");
  exit(0);
}


x86 assembly (clang, -O0):
<pass>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pass>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Test: PASS\0A\00"
define void @pass() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [11 x i8] c"Test: PASS\00"
define void @pass() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}