xunge/DecIR huggingface dataset:
void makelookuptable(char *s, int *l) {
  int i;
  for (i = 0; i < 256; i++)
    l[i] = 0;
  for (; *s; s++)
    l[(int)((unsigned char)*s)] = 1;
}


x86 assembly (clang, -O0):
<makelookuptable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    113d <makelookuptable+0x3d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <makelookuptable+0x13>
jmp    1142 <makelookuptable+0x42>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <makelookuptable+0x75>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1142 <makelookuptable+0x42>
pop    %rbp
ret

x86 assembly (clang, -O2):
<makelookuptable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x400,%edx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    (%rbx),%al
test   %al,%al
je     1156 <makelookuptable+0x46>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl %al,%eax
movl   $0x1,(%r14,%rax,4)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <makelookuptable+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @makelookuptable(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = bitcast i32* %1 to i8*
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %12, %6 ], [ %4, %2 ]
%8 = phi i8* [ %11, %6 ], [ %0, %2 ]
%9 = zext i8 %7 to i64
%10 = getelementptr inbounds i32, i32* %1, i64 %9
store i32 1, i32* %10
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn62() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn62");
  return result;
}


x86 assembly (clang, -O0):
<fn62>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn62>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn62\00"
define i8* @fn62() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn62\00"
define i8* @fn62() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int motoni2(hin)
int hin;
{
  register int c;
  if (hin == 127)
    return (-1);
  if (hin <= 4)
    return (hin);
  c = hin >> 2;
  return ((hin - (c << 1)) * (c + 1) + (c >> 1));
}


x86 assembly (clang, -O0):
<motoni2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jne    111d <motoni2+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <motoni2+0x5a>
cmpl   $0x4,-0x8(%rbp)
jg     1132 <motoni2+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <motoni2+0x5a>
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<motoni2>:
mov    $0xffffffff,%eax
cmp    $0x7f,%edi
je     1127 <motoni2+0x27>
cmp    $0x5,%edi
jl     1125 <motoni2+0x25>
mov    %edi,%eax
shr    $0x2,%eax
mov    %edi,%edx
sub    %eax,%edx
sub    %eax,%edx
add    $0x1,%eax
imul   %edx,%eax
shr    $0x3,%edi
add    %eax,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @motoni2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 127
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %26
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 4
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %26
13: ; preds = %8
%14 = load i32, i32* %3
%15 = ashr i32 %14, 2
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = shl i32 %17, 1
%19 = sub nsw i32 %16, %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = mul nsw i32 %19, %21
%23 = load i32, i32* %4
%24 = ashr i32 %23, 1
%25 = add nsw i32 %22, %24
store i32 %25, i32* %2
br label %26
26: ; preds = %13, %11, %7
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @motoni2(i32 %0) {
%2 = icmp eq i32 %0, 127
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 5
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = lshr i32 %0, 2
%7 = mul nsw i32 %6, -2
%8 = add nsw i32 %7, %0
%9 = add nuw nsw i32 %6, 1
%10 = mul nsw i32 %8, %9
%11 = lshr i32 %0, 3
%12 = add nsw i32 %10, %11
br label %13
13: ; preds = %3, %1, %5
%14 = phi i32 [ %12, %5 ], [ -1, %1 ], [ %0, %3 ]
ret i32 %14
}
void matmul(const float *A, const float *B, float *C, unsigned nx, unsigned ny,
            unsigned nz) {}


x86 assembly (clang, -O0):
<matmul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @matmul(float* %0, float* %1, float* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @matmul(float* nocapture %0, float* nocapture %1, float* nocapture %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRFILLREGION_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 2, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRFILLREGION_swap>:
mov    %esi,%edx
mov    $0x2,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRFILLREGION_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 2, i32 %1)
ret void
}
int cpuidle_coupled_register_device(struct cpuidle_device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cpuidle_device = type opaque
define i32 @cpuidle_coupled_register_device(%struct.cpuidle_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
float log(float);
float log10(float arg) {
  static float ln10 = 2.302585092994045684;
  return (log(arg) / ln10);
}


x86 assembly (clang, -O0):
<log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log@plt>
divss  0x2ef9(%rip),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10>:
push   %rax
call   1030 <log@plt>
divss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@log10.ln10 = internal global float 0x40026BB1C0000000
define float @log10(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @log(float %3)
%5 = load float, float* @log10.ln10
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
define float @log10(float %0) {
%2 = tail call float @log(float %0)
%3 = fdiv float %2, 0x40026BB1C0000000
ret float %3
}
void wait_for_termination(pid) int pid;
{
  while (1) {
    if (kill(pid, 0) < 0)
      break;
    wait(0);
  }
}


x86 assembly (clang, -O0):
<wait_for_termination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <kill@plt>
cmp    $0x0,%eax
jge    1145 <wait_for_termination+0x25>
jmp    1153 <wait_for_termination+0x33>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <wait@plt>
jmp    112b <wait_for_termination+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_termination>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %esi,%esi
xor    %eax,%eax
call   1030 <kill@plt>
test   %eax,%eax
js     114a <wait_for_termination+0x2a>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <wait@plt>
mov    %ebx,%edi
jmp    1130 <wait_for_termination+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @wait_for_termination(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %8
%4 = load i32, i32* %2
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @kill to i32 (i32, i32, ...)*)(i32 %4, i32 0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %10
8: ; preds = %3
%9 = call i32 (i32, ...) bitcast (i32 (...)* @wait to i32 (i32, ...)*)(i32 0)
br label %3
10: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @wait_for_termination(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @kill to i32 (i32, i32, ...)*)(i32 %0, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @wait to i32 (i32, ...)*)(i32 0)
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @kill to i32 (i32, i32, ...)*)(i32 %0, i32 0)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}
int test_imm_56int16_reg(short val) {
  return ((val) & (-0x56 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_56int16_reg(i16 signext %0) {
%2 = and i16 %0, -86
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cdops_read_toc(struct TOC *toc, int session) {
  struct {
    int session;
    void *buffer;
  } param;
  param.session = session;
  param.buffer = toc;
  return cdops_exec_cmd(19, &param);
}


x86 assembly (clang, -O0):
<cdops_read_toc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x13,%edi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <cdops_exec_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdops_read_toc>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
mov    %rdi,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x13,%edi
xor    %eax,%eax
call   1030 <cdops_exec_cmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.TOC = type opaque
%struct.anon = type { i32, i8* }
define i32 @cdops_read_toc(%struct.TOC* %0, i32 %1) {
%3 = alloca %struct.TOC*
%4 = alloca i32
%5 = alloca %struct.anon
store %struct.TOC* %0, %struct.TOC** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = load %struct.TOC*, %struct.TOC** %3
%9 = bitcast %struct.TOC* %8 to i8*
%10 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 1
store i8* %9, i8** %10
%11 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @cdops_exec_cmd to i32 (i32, %struct.anon*, ...)*)(i32 19, %struct.anon* %5)
ret i32 %11
}

LLVM IR (-O2):
%struct.TOC = type opaque
%struct.anon = type { i32, i8* }
define i32 @cdops_read_toc(%struct.TOC* %0, i32 %1) {
%3 = alloca %struct.anon
%4 = bitcast %struct.anon* %3 to i8*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 1
%7 = bitcast i8** %6 to %struct.TOC**
store %struct.TOC* %0, %struct.TOC** %7
%8 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @cdops_exec_cmd to i32 (i32, %struct.anon*, ...)*)(i32 19, %struct.anon* %3)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, int /*<<< orphan*/);
scalar_t__ realloc(char *, unsigned int);
char *xrealloc(char *ptr, unsigned size) {
  char *result = (char *)realloc(ptr, size);
  if (!result) {
    fatal("virtual memory exhausted", 0);
  }
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xeaf(%rip),%rdi
xor    %esi,%esi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <xrealloc+0x1c>
lea    0xecb(%rip),%rdi
xor    %esi,%esi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(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 i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i64 @realloc(i8* %6, i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = tail call i64 @realloc(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0)
br label %7
7: ; preds = %5, %2
%8 = inttoptr i64 %3 to i8*
ret i8* %8
}
/* Variables and functions */
int ssds_get_gen_name(int, char *, char *, char *, char *, int);
int ssds_get_field_name(int pcfd, char *full_def, char *res, int len) {
  return ssds_get_gen_name(pcfd, full_def, "gf", "f_name", res, len);
}


x86 assembly (clang, -O0):
<ssds_get_field_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
lea    0xec4(%rip),%rdx
lea    0xec0(%rip),%rcx
call   1030 <ssds_get_gen_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_field_name>:
mov    %ecx,%r9d
mov    %rdx,%r8
lea    0xee3(%rip),%rdx
lea    0xedf(%rip),%rcx
jmp    1030 <ssds_get_gen_name@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"gf\00"
@.str.1 = [7 x i8] c"f_name\00"
define i32 @ssds_get_field_name(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @ssds_get_gen_name(i32 %9, i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"gf\00"
@.str.1 = [7 x i8] c"f_name\00"
define i32 @ssds_get_field_name(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @ssds_get_gen_name(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %3)
ret i32 %5
}
void lruCacheFree() {}


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

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

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

LLVM IR (-O2):
define void @lruCacheFree() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
long glongplus(long x, long y) {
  x += y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<glongplus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <glongplus+0x30>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glongplus>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
jne    1120 <glongplus+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @glongplus(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int vga_get(struct pci_dev *, unsigned int, int);
int vga_get_interruptible(struct pci_dev *pdev, unsigned int rsrc) {
  return vga_get(pdev, rsrc, 1);
}


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

x86 assembly (clang, -O2):
<vga_get_interruptible>:
mov    $0x1,%edx
jmp    1030 <vga_get@plt>

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

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
define i32 @vga_get_interruptible(%struct.pci_dev* %0, i32 %1) {
%3 = tail call i32 @vga_get(%struct.pci_dev* %0, i32 %1, i32 1)
ret i32 %3
}
void LPoke(void *a, int r) {
  unsigned char *c = (unsigned char *)a;
  c[0] = r;
  c[1] = r >> 8;
  c[2] = r >> 16;
  c[3] = r >> 24;
}


x86 assembly (clang, -O0):
<LPoke>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPoke>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @LPoke(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 i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 16
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i32, i32* %4
%22 = ashr i32 %21, 24
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
ret void
}

LLVM IR (-O2):
define void @LPoke(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *alloc(size_t size) {
  void *new_mem = malloc(size);
  if (new_mem == NULL) {
    fprintf(stderr, "Fatal: out of memory!\n");
    exit(EXIT_FAILURE);
  }
  return new_mem;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <alloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <alloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Fatal: out of memory!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Fatal: out of memory!\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
int modd(int numerator, int modulator) {
  while (numerator >= modulator) {
    numerator -= modulator;
  }
  return numerator;
}


x86 assembly (clang, -O0):
<modd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1126 <modd+0x26>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    110a <modd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modd>:
mov    %edi,%eax
add    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
sub    %esi,%eax
cmp    %esi,%eax
jge    1110 <modd+0x10>
ret

LLVM IR (-O0):
define i32 @modd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp sge i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, %10
store i32 %12, i32* %3
br label %5
13: ; preds = %5
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @modd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp slt i32 %4, %1
%6 = sub nsw i32 %4, %1
br i1 %5, label %7, label %3
7: ; preds = %3
ret i32 %4
}
/* Type definitions */
struct passwd {
  char *pw_dir;
};

/* Variables and functions */
char *getenv(char *);
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
int strlen(char *);
int home_dir_len(void) {
  struct passwd *foo;
  char *lookup;
  lookup = getenv("HOME");
  if (lookup) {
    return strlen(lookup);
  }
  foo = getpwuid(getuid());
  return strlen(foo->pw_dir);
}


x86 assembly (clang, -O0):
<home_dir_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1174 <home_dir_len+0x34>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    1195 <home_dir_len+0x55>
mov    $0x0,%al
call   1060 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<home_dir_len>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     115b <home_dir_len+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1050 <strlen@plt>
xor    %eax,%eax
call   1060 <getuid@plt>
mov    %eax,%edi
call   1040 <getpwuid@plt>
mov    (%rax),%rdi
pop    %rax
jmp    1050 <strlen@plt>

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [5 x i8] c"HOME\00"
define i32 @home_dir_len() {
%1 = alloca i32
%2 = alloca %struct.passwd*
%3 = alloca i8*
%4 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %1
br label %17
10: ; preds = %0
%11 = call i32 (...) @getuid()
%12 = call %struct.passwd* @getpwuid(i32 %11)
store %struct.passwd* %12, %struct.passwd** %2
%13 = load %struct.passwd*, %struct.passwd** %2
%14 = getelementptr inbounds %struct.passwd, %struct.passwd* %13, i32 0, i32 0
%15 = load i8*, i8** %14
%16 = call i32 @strlen(i8* %15)
store i32 %16, i32* %1
br label %17
17: ; preds = %10, %7
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [5 x i8] c"HOME\00"
define i32 @home_dir_len() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @strlen(i8* %1)
br label %11
5: ; preds = %0
%6 = tail call i32 (...) @getuid()
%7 = tail call %struct.passwd* @getpwuid(i32 %6)
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %7, i64 0, i32 0
%9 = load i8*, i8** %8
%10 = tail call i32 @strlen(i8* %9)
br label %11
11: ; preds = %5, %3
%12 = phi i32 [ %4, %3 ], [ %10, %5 ]
ret i32 %12
}
/* Type definitions */
struct terminal_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal_t *, int, int /*<<< orphan*/);
void nl(struct terminal_t *term) { move_cursor(term, 1, 0); }


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

x86 assembly (clang, -O2):
<nl>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <move_cursor@plt>

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

LLVM IR (-O2):
%struct.terminal_t = type { i32 }
define void @nl(%struct.terminal_t* %0) {
%2 = tail call i32 @move_cursor(%struct.terminal_t* %0, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
int strcmp(const char *s1, const char *s2) {
  printf("s1: %s, s2: %s\n", s1, s2);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"s1: %s, s2: %s\0A\00"
define i32 @strcmp(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 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"s1: %s, s2: %s\0A\00"
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
/* Variables and functions */
int fax_send(char *, int);
int fax_wait_for(char *, int);
int fax_command(char *send, char *expect, int fd) {
  if (fax_send(send, fd) == -1)
    return -1;
  return fax_wait_for(expect, fd);
}


x86 assembly (clang, -O0):
<fax_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <fax_send@plt>
cmp    $0xffffffff,%eax
jne    1154 <fax_command+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <fax_command+0x43>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <fax_wait_for@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fax_command>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edx,%esi
call   1040 <fax_send@plt>
cmp    $0xffffffff,%eax
je     1146 <fax_command+0x26>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fax_wait_for@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @fax_command(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @fax_send(i8* %0, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @fax_wait_for(i8* %1, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
int ub_dentry_alloc(struct dentry *d) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @ub_dentry_alloc(%struct.dentry* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printFunction(char *, void *);
void traverseFunction(void *data) {
  printFunction("", data);
  return;
}


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @traverseFunction(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printFunction(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @traverseFunction(i8* %0) {
%2 = tail call i32 @printFunction(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define i32 @brcmf_proto_bcdc_attach(%struct.brcmf_pub* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int partition2(int *, int, int);
void quick_sort(int a[], int left, int right) {
  int q = 0;
  if (left >= right) {
    return;
  }
  q = partition2(a, left, right);
  quick_sort(a, left, (q - 1));
  quick_sort(a, (q + 1), right);
  return;
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     114a <quick_sort+0x2a>
jmp    1180 <quick_sort+0x60>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition2@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition2@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(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
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition2(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition2(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cctools_debug(long long, char *, char const *, char const *);
void corrupt_data(const char *filename, const char *line) {
  cctools_debug((1LL << 2), "corrupt data in %s: %s\n", filename, line);
}


x86 assembly (clang, -O0):
<corrupt_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x4,%edi
lea    0xecc(%rip),%rsi
call   1030 <cctools_debug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corrupt_data>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    $0x4,%edi
jmp    1030 <cctools_debug@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"corrupt data in %s: %s\0A\00"
define void @corrupt_data(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 @cctools_debug(i64 4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"corrupt data in %s: %s\0A\00"
define void @corrupt_data(i8* %0, i8* %1) {
%3 = tail call i32 @cctools_debug(i64 4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_NOW;
void *dlopen(char *, int /*<<< orphan*/);
void *dlsym(void *, char const *);
void *resolve(const char *sym) {
  static void *handle = NULL;
  if (handle == NULL) {
    handle = dlopen("libc.so", RTLD_NOW);
  }
  return dlsym(handle, sym);
}


x86 assembly (clang, -O0):
<resolve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,0x2f04(%rip)
jne    1156 <resolve+0x36>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1030 <dlopen@plt>
mov    %rax,0x2ee2(%rip)
mov    0x2edb(%rip),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <dlsym@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolve>:
push   %rbx
mov    %rdi,%rbx
mov    0x2f0d(%rip),%rdi
test   %rdi,%rdi
jne    114f <resolve+0x2f>
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
call   1030 <dlopen@plt>
mov    %rax,%rdi
mov    %rax,0x2ee9(%rip)
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <dlsym@plt>

LLVM IR (-O0):
@resolve.handle = internal global i8* null
@.str = [8 x i8] c"libc.so\00"
@RTLD_NOW = global i32 0
define i8* @resolve(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** @resolve.handle
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @RTLD_NOW
%7 = call i8* @dlopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
store i8* %7, i8** @resolve.handle
br label %8
8: ; preds = %5, %1
%9 = load i8*, i8** @resolve.handle
%10 = load i8*, i8** %2
%11 = call i8* @dlsym(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@resolve.handle = internal unnamed_addr global i8* null
@.str = [8 x i8] c"libc.so\00"
@RTLD_NOW = global i32 0
define i8* @resolve(i8* %0) {
%2 = load i8*, i8** @resolve.handle
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @RTLD_NOW
%6 = tail call i8* @dlopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
store i8* %6, i8** @resolve.handle
br label %7
7: ; preds = %4, %1
%8 = phi i8* [ %6, %4 ], [ %2, %1 ]
%9 = tail call i8* @dlsym(i8* %8, i8* %0)
ret i8* %9
}
__attribute__((noipa)) void *return_vla_index_var(int n, int i) {
  char a[n];
  char *p = &a[i];
  sink(p);
  return p;
}


x86 assembly (clang, -O0):
<return_vla_index_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <sink@plt>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_vla_index_var>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
movslq %esi,%rbx
add    %rcx,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sink@plt>
mov    %rbx,%rax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @return_vla_index_var(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %5
%11 = alloca i8, i64 %9
store i64 %9, i64* %6
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @sink to i32 (i8*, ...)*)(i8* %15)
%17 = load i8*, i8** %7
%18 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @return_vla_index_var(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = alloca i8, i64 %3
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @sink to i32 (i8*, ...)*)(i8* %6)
ret i8* %6
}
void strength_result10(int *data) {
  int stop = 21 * data[3];
  int i = 0;
  do {
    data[data[2]] = i;
    i = i + 21;
  } while (i < stop);
}


x86 assembly (clang, -O0):
<strength_result10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x15,0xc(%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x15,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     111a <strength_result10+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_result10>:
mov    0xc(%rdi),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movslq 0x8(%rdi),%rdx
mov    %ecx,(%rdi,%rdx,4)
add    $0x15,%ecx
cmp    %eax,%ecx
jl     1110 <strength_result10+0x10>
ret

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

LLVM IR (-O2):
define void @strength_result10(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 21
%5 = getelementptr inbounds i32, i32* %0, i64 2
br label %6
6: ; preds = %6, %1
%7 = phi i32 [ 0, %1 ], [ %11, %6 ]
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %7, i32* %10
%11 = add nuw nsw i32 %7, 21
%12 = icmp slt i32 %11, %4
br i1 %12, label %6, label %13
13: ; preds = %6
ret void
}