xunge/DecIR huggingface dataset:
unsigned int getulong(unsigned char *buffer, int offset) {
  return (unsigned long)buffer[offset] |
         ((unsigned long)buffer[offset + 1] << 8L) |
         ((unsigned long)buffer[offset + 2] << 16L) |
         ((unsigned long)buffer[offset + 3] << 24L);
}


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

x86 assembly (clang, -O2):
<getulong>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @getulong(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = shl i64 %17, 8
%19 = or i64 %10, %18
%20 = load i8*, i8** %3
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %20, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i64
%27 = shl i64 %26, 16
%28 = or i64 %19, %27
%29 = load i8*, i8** %3
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %29, i64 %32
%34 = load i8, i8* %33
%35 = zext i8 %34 to i64
%36 = shl i64 %35, 24
%37 = or i64 %28, %36
%38 = trunc i64 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
define i32 @getulong(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 8
%13 = or i32 %12, %6
%14 = add nsw i32 %1, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl nuw nsw i32 %18, 16
%20 = or i32 %13, %19
%21 = add nsw i32 %1, 3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %0, i64 %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = shl nuw i32 %25, 24
%27 = or i32 %20, %26
ret i32 %27
}
/* Type definitions */
struct rq_asset_ccy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rq_asset_ccy_free(struct rq_asset_ccy *);
void rq_asset_ccy_freefunc(void *asset_data) {
  rq_asset_ccy_free((struct rq_asset_ccy *)asset_data);
}


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

x86 assembly (clang, -O2):
<rq_asset_ccy_freefunc>:
jmp    1030 <rq_asset_ccy_free@plt>

LLVM IR (-O0):
%struct.rq_asset_ccy = type { i32 }
define void @rq_asset_ccy_freefunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.rq_asset_ccy*
%5 = call i32 @rq_asset_ccy_free(%struct.rq_asset_ccy* %4)
ret void
}

LLVM IR (-O2):
%struct.rq_asset_ccy = type { i32 }
define void @rq_asset_ccy_freefunc(i8* %0) {
%2 = bitcast i8* %0 to %struct.rq_asset_ccy*
%3 = tail call i32 @rq_asset_ccy_free(%struct.rq_asset_ccy* %2)
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int time(int /*<<< orphan*/ *);
int main() {
  time_t s = time(NULL);
  while (time(NULL) - s < 20)
    ;
  printf("OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
sub    -0x8(%rbp),%eax
cmp    $0x14,%eax
jge    1155 <main+0x35>
jmp    113b <main+0x1b>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <time@plt>
sub    %ebx,%eax
cmp    $0x14,%eax
jl     1130 <main+0x10>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
store i32 %3, i32* %2
br label %4
4: ; preds = %9, %0
%5 = call i32 @time(i32* null)
%6 = load i32, i32* %2
%7 = sub nsw i32 %5, %6
%8 = icmp slt i32 %7, 20
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @time(i32* null)
%4 = sub nsw i32 %3, %1
%5 = icmp slt i32 %4, 20
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void d2i_ASN1_VISIBLESTRING(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ASN1_VISIBLESTRING() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setupterm(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ success(char *);
int main() {
  setupterm(NULL, 1, 0);
  success("Hello, World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <setupterm@plt>
lea    0xeba(%rip),%rdi
call   1040 <success@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <setupterm@plt>
lea    0xeca(%rip),%rdi
call   1040 <success@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setupterm(i32* null, i32 1, i32 0)
%3 = call i32 @success(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = tail call i32 @setupterm(i32* null, i32 1, i32 0)
%2 = tail call i32 @success(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(char);
char toupper(char);
int ishex(char c) {
  c = toupper(c);
  return isdigit(c) || ('A' <= c && c <= 'F');
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    117e <ishex+0x5e>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1178 <ishex+0x58>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
push   %rbx
call   1040 <toupper@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
add    $0xbf,%bl
cmp    $0x6,%bl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ishex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @toupper(i8 signext %3)
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = call i64 @isdigit(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 65, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 70
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ false, %8 ], [ %15, %12 ]
br label %18
18: ; preds = %16, %1
%19 = phi i1 [ true, %1 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @ishex(i8 signext %0) {
%2 = tail call signext i8 @toupper(i8 signext %0)
%3 = tail call i64 @isdigit(i8 signext %2)
%4 = icmp ne i64 %3, 0
%5 = add i8 %2, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void mainCRTStartup() {}


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

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

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

LLVM IR (-O2):
define void @mainCRTStartup() {
ret void
}
void trunc2ascii(char *str) {
  while (*str != 0) {
    *str = *str & 0x7f;
    str++;
  }
}


x86 assembly (clang, -O0):
<trunc2ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113b <trunc2ascii+0x3b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x7f,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <trunc2ascii+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunc2ascii>:
mov    (%rdi),%al
test   %al,%al
je     1120 <trunc2ascii+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
and    $0x7f,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <trunc2ascii+0x10>
ret

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

LLVM IR (-O2):
define void @trunc2ascii(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = and i8 %5, 127
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
float dist2(float x1, float y1, float x2, float y2) {
  float dx = x2 - x1;
  float dy = y2 - y1;
  return dx * dx + dy * dy;
}


x86 assembly (clang, -O0):
<dist2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist2>:
subss  %xmm0,%xmm2
subss  %xmm1,%xmm3
mulss  %xmm3,%xmm3
mulss  %xmm2,%xmm2
addss  %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @dist2(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load float, float* %7
%12 = load float, float* %5
%13 = fsub float %11, %12
store float %13, float* %9
%14 = load float, float* %8
%15 = load float, float* %6
%16 = fsub float %14, %15
store float %16, float* %10
%17 = load float, float* %9
%18 = load float, float* %9
%19 = load float, float* %10
%20 = load float, float* %10
%21 = fmul float %19, %20
%22 = call float @llvm.fmuladd.f32(float %17, float %18, float %21)
ret float %22
}

LLVM IR (-O2):
define float @dist2(float %0, float %1, float %2, float %3) {
%5 = fsub float %2, %0
%6 = fsub float %3, %1
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
ret float %8
}
void r_uart1_callback_sendend(void) {}


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

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

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

LLVM IR (-O2):
define void @r_uart1_callback_sendend() {
ret void
}
void ContactHessianH36(double *H, double *q, double *qdot, double *L,
                       double *addl) {}


x86 assembly (clang, -O0):
<ContactHessianH36>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ContactHessianH36(double* %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
ret void
}

LLVM IR (-O2):
define void @ContactHessianH36(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ zsleep_millisecond(int);
void job1(void *ctx) {
  int i = (int)(long)ctx;
  zsleep_millisecond(100);
  printf("job1, %d\n", i);
}


x86 assembly (clang, -O0):
<job1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    $0x64,%edi
call   1040 <zsleep_millisecond@plt>
mov    -0xc(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<job1>:
push   %rbx
mov    %rdi,%rbx
mov    $0x64,%edi
call   1040 <zsleep_millisecond@plt>
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"job1, %d\0A\00"
define void @job1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = call i32 @zsleep_millisecond(i32 100)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"job1, %d\0A\00"
define void @job1(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @zsleep_millisecond(i32 100)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ PASS(char *);
int main(int argc, const char *argv[]) {
  PASS("DYLD_VERSIONED_LIBRARY_PATH-basic");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"DYLD_VERSIONED_LIBRARY_PATH-basic\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @PASS(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [34 x i8] c"DYLD_VERSIONED_LIBRARY_PATH-basic\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @PASS(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void free_data_matrix(double **dm, int rows) {
  int i;
  for (i = 0; i < rows; ++i)
    free(dm[i]);
  free(dm);
}


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

x86 assembly (clang, -O2):
<free_data_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_data_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_data_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_data_matrix(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
int is_keychar(const char *s, char c) { return c && (s[0] == c) && !s[1]; }


x86 assembly (clang, -O0):
<is_keychar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1148 <is_keychar+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xa(%rbp)
jne    1148 <is_keychar+0x48>
mov    -0x8(%rbp),%rax
cmpb   $0x0,0x1(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_keychar>:
xor    %eax,%eax
test   %sil,%sil
je     1115 <is_keychar+0x15>
cmp    %sil,(%rdi)
jne    1115 <is_keychar+0x15>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_keychar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %12, %14
br i1 %15, label %16, label %22
16: ; preds = %8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = icmp ne i8 %19, 0
%21 = xor i1 %20, true
br label %22
22: ; preds = %16, %8, %2
%23 = phi i1 [ false, %8 ], [ false, %2 ], [ %21, %16 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_keychar(i8* nocapture %0, i8 signext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, %1
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %4, %2
%13 = phi i32 [ 0, %4 ], [ 0, %2 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
char *extract_token(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("keyword: '%s'\n\n", extract_token("(int"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1040 <extract_token@plt>
mov    %rax,%rsi
lea    0xebb(%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
call   1040 <extract_token@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"keyword: '%s'\0A\0A\00"
@.str.1 = [5 x i8] c"(int\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @extract_token(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"keyword: '%s'\0A\0A\00"
@.str.1 = [5 x i8] c"(int\00"
define i32 @main() {
%1 = tail call i8* @extract_token(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
void gtk_combo_box_prepend_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_prepend_text() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ icaF(char *);
void icaF2(char *x) { icaF(x); }


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

x86 assembly (clang, -O2):
<icaF2>:
jmp    1030 <icaF@plt>

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

LLVM IR (-O2):
define void @icaF2(i8* %0) {
%2 = tail call i32 @icaF(i8* %0)
ret void
}
int test_imm_0Auint16_mem(unsigned short *val) {
  return ((*val) & (-0x0A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Auint16_mem>:
movzwl (%rdi),%eax
test   $0xfff6,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -10
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void perfmon_init(void) {}


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

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

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

LLVM IR (-O2):
define void @perfmon_init() {
ret void
}
void enter_perf_probe(struct perf_event *e, int nmi, struct perf_sample_data *d,
                      struct pt_regs *r) {}


x86 assembly (clang, -O0):
<enter_perf_probe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.perf_event = type opaque
%struct.perf_sample_data = type opaque
%struct.pt_regs = type opaque
define void @enter_perf_probe(%struct.perf_event* %0, i32 %1, %struct.perf_sample_data* %2, %struct.pt_regs* %3) {
%5 = alloca %struct.perf_event*
%6 = alloca i32
%7 = alloca %struct.perf_sample_data*
%8 = alloca %struct.pt_regs*
store %struct.perf_event* %0, %struct.perf_event** %5
store i32 %1, i32* %6
store %struct.perf_sample_data* %2, %struct.perf_sample_data** %7
store %struct.pt_regs* %3, %struct.pt_regs** %8
ret void
}

LLVM IR (-O2):
%struct.perf_event = type opaque
%struct.perf_sample_data = type opaque
%struct.pt_regs = type opaque
define void @enter_perf_probe(%struct.perf_event* nocapture %0, i32 %1, %struct.perf_sample_data* nocapture %2, %struct.pt_regs* nocapture %3) {
ret void
}
void do_putch(char **p, char *end, char c) {
  if (*p < end)
    **p = c;
  (*p)++;
}


x86 assembly (clang, -O0):
<do_putch>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jae    112e <do_putch+0x2e>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_putch>:
mov    (%rdi),%rax
cmp    %rsi,%rax
jae    110d <do_putch+0xd>
mov    %dl,(%rax)
mov    (%rdi),%rax
add    $0x1,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @do_putch(i8** nocapture %0, i8* readnone %1, i8 signext %2) {
%4 = load i8*, i8** %0
%5 = icmp ult i8* %4, %1
br i1 %5, label %6, label %8
6: ; preds = %3
store i8 %2, i8* %4
%7 = load i8*, i8** %0
br label %8
8: ; preds = %6, %3
%9 = phi i8* [ %7, %6 ], [ %4, %3 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
ret void
}
void pvm_after_ckpt(void) {}


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

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

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

LLVM IR (-O2):
define void @pvm_after_ckpt() {
ret void
}
/* Variables and functions */
int libisofs_md5(void **, int /*<<< orphan*/ *, int /*<<< orphan*/,
                 int /*<<< orphan*/ *, int);
int iso_md5_start(void **md5_context) {
  int ret;
  ret = libisofs_md5(md5_context, NULL, 0, NULL, 1);
  if (ret <= 0)
    return 0xF030FFFA;
  return 1;
}


x86 assembly (clang, -O0):
<iso_md5_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
xor    %edx,%edx
mov    $0x1,%r8d
mov    %rcx,%rsi
call   1030 <libisofs_md5@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     114d <iso_md5_start+0x3d>
movl   $0xf030fffa,-0x4(%rbp)
jmp    1154 <iso_md5_start+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_md5_start>:
push   %rbx
mov    $0x1,%ebx
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <libisofs_md5@plt>
test   %eax,%eax
mov    $0xf030fffa,%eax
cmovg  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iso_md5_start(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = call i32 @libisofs_md5(i8** %5, i32* null, i32 0, i32* null, i32 1)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -265224198, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @iso_md5_start(i8** %0) {
%2 = tail call i32 @libisofs_md5(i8** %0, i32* null, i32 0, i32* null, i32 1)
%3 = icmp slt i32 %2, 1
%4 = select i1 %3, i32 -265224198, i32 1
ret i32 %4
}
void SelectDevice(int myrank) {}


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

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

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

LLVM IR (-O2):
define void @SelectDevice(i32 %0) {
ret void
}
char *strcpy(char *dest, const char *src) {
  __asm__("cld\n"
          "1:\tlodsb\n\t"
          "stosb\n\t"
          "testb %%al,%%al\n\t"
          "jne 1b" ::"S"(src),
          "D"(dest));
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
cld
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1115 <strcpy+0x15>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
cld
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1101 <strcpy+0x1>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
tail call void asm sideeffect "cld\0A1:\09lodsb\0A\09stosb\0A\09testb %al,%al\0A\09jne 1b", "{si},{di},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ my_qsort(void *, size_t, size_t,
                            int (*)(void const *, void const *));
__attribute__((__weak__, __always___)) void
softboundmpx_qsort(void *base, size_t nmemb, size_t size,
                   int (*compar)(const void *, const void *)) {
  my_qsort(base, nmemb, size, compar);
}


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

x86 assembly (clang, -O2):
<softboundmpx_qsort>:
jmp    1030 <my_qsort@plt>

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

LLVM IR (-O2):
define weak void @softboundmpx_qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = tail call i32 @my_qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printf(char *);
void callme(int signo) {
  alarm(2);
  printf("Hello world!\n");
}


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

x86 assembly (clang, -O2):
<callme>:
push   %rax
mov    $0x2,%edi
call   1040 <alarm@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define void @callme(i32 %0) {
%2 = tail call i32 @alarm(i32 2)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ genrand_dev(unsigned char *, int);
scalar_t__ genrand_unix(unsigned char *, int);
void esound_genrand(unsigned char *buffer, int buf_len) {
  if (genrand_dev(buffer, buf_len))
    return;
  else if (genrand_unix(buffer, buf_len))
    return;
  else
    abort();
}


x86 assembly (clang, -O0):
<esound_genrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <genrand_dev@plt>
cmp    $0x0,%rax
je     115a <esound_genrand+0x2a>
jmp    117c <esound_genrand+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <genrand_unix@plt>
cmp    $0x0,%rax
je     1175 <esound_genrand+0x45>
jmp    117c <esound_genrand+0x4c>
mov    $0x0,%al
call   1050 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esound_genrand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <genrand_dev@plt>
test   %rax,%rax
jne    1151 <esound_genrand+0x21>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <genrand_unix@plt>
test   %rax,%rax
je     1158 <esound_genrand+0x28>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1050 <abort@plt>

LLVM IR (-O0):
define void @esound_genrand(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 i64 @genrand_dev(i8* %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %18
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i64 @genrand_unix(i8* %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
br label %18
16: ; preds = %10
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %15, %9
ret void
}

LLVM IR (-O2):
define void @esound_genrand(i8* %0, i32 %1) {
%3 = tail call i64 @genrand_dev(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i64 @genrand_unix(i8* %0, i32 %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5, %2
ret void
}
void glProgramUniform4f(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void document_output_html_stream(FILE *output_stream) {
  fprintf(output_stream,
          "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\">\n");
  fprintf(output_stream, "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n");
  fflush(output_stream);
}


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

x86 assembly (clang, -O2):
<document_output_html_stream>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x3a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xef7(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"<!DOCTYPE html PUBLIC \22-//W3C//DTD XHTML 1.0 Strict//EN\22>\0A\00"
@.str.1 = [45 x i8] c"<html xmlns=\22http://www.w3.org/1999/xhtml\22>\0A\00"
define void @document_output_html_stream(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fflush(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"<!DOCTYPE html PUBLIC \22-//W3C//DTD XHTML 1.0 Strict//EN\22>\0A\00"
@.str.1 = [45 x i8] c"<html xmlns=\22http://www.w3.org/1999/xhtml\22>\0A\00"
define void @document_output_html_stream(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i64 58, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i64 44, i64 1, i32* %0)
%4 = tail call i32 @fflush(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ WriteUint64Le(int /*<<< orphan*/, void *);
int32_t WriteInt64Le(int64_t value, void *out) {
  return WriteUint64Le((uint64_t)value, out);
}


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

x86 assembly (clang, -O2):
<WriteInt64Le>:
jmp    1030 <WriteUint64Le@plt>

LLVM IR (-O0):
define i32 @WriteInt64Le(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i8*, i8** %4
%8 = call i32 @WriteUint64Le(i32 %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @WriteInt64Le(i64 %0, i8* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @WriteUint64Le(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal_with_reason(int /*<<< orphan*/, char *);
void socket_close(int socket) {
  if (close(socket))
    fatal_with_reason(errno, "Could not close socket");
}


x86 assembly (clang, -O0):
<socket_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1152 <socket_close+0x32>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fatal_with_reason@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_close>:
push   %rax
call   1030 <close@plt>
test   %rax,%rax
je     1141 <socket_close+0x21>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
pop    %rax
jmp    1040 <fatal_with_reason@plt>
pop    %rax
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [23 x i8] c"Could not close socket\00"
define void @socket_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = call i32 @fatal_with_reason(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [23 x i8] c"Could not close socket\00"
define void @socket_close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @fatal_with_reason(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %1
ret void
}
int f(void) {}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
void init_crypto(struct v7 *v7) { (void)v7; }


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

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

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

LLVM IR (-O2):
%struct.v7 = type opaque
define void @init_crypto(%struct.v7* nocapture %0) {
ret void
}
void addReplyBulkLongLong(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               21, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<addReplyBulkLongLong>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x15,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addReplyBulkLongLong>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x15,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyBulkLongLong = [21 x i8] c"addReplyBulkLongLong\00"
define void @addReplyBulkLongLong() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.addReplyBulkLongLong, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyBulkLongLong = [21 x i8] c"addReplyBulkLongLong\00"
define void @addReplyBulkLongLong() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.addReplyBulkLongLong, i64 0, i64 0))
ret void
}
/* Variables and functions */
int Traverse(char const *const, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *const);
int DoDir(const char *const srcpath, int checkmode) {
  return Traverse(srcpath, strlen(srcpath), checkmode);
}


x86 assembly (clang, -O0):
<DoDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <Traverse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoDir>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <Traverse@plt>

LLVM IR (-O0):
define i32 @DoDir(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 i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @Traverse(i8* %5, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @DoDir(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @Traverse(i8* %0, i32 %3, i32 %1)
ret i32 %4
}
unsigned int atomic_load_n_unsigned_int(unsigned int *ptr, int memorder) {
  return __atomic_load_n(ptr, memorder);
}


x86 assembly (clang, -O0):
<atomic_load_n_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     1149 <atomic_load_n_unsigned_int+0x49>
jmp    112a <atomic_load_n_unsigned_int+0x2a>
mov    -0x14(%rbp),%eax
sub    $0x5,%eax
je     1157 <atomic_load_n_unsigned_int+0x57>
jmp    113b <atomic_load_n_unsigned_int+0x3b>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <atomic_load_n_unsigned_int+0x60>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <atomic_load_n_unsigned_int+0x60>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_load_n_unsigned_int>:
lea    -0x1(%rsi),%eax
cmp    $0x2,%eax
jb     110b <atomic_load_n_unsigned_int+0xb>
cmp    $0x5,%esi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @atomic_load_n_unsigned_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
switch i32 %7, label %8 [
i32 1, label %10
i32 2, label %10
i32 5, label %12
]
8: ; preds = %2
%9 = load atomic i32, i32* %6 monotonic
store i32 %9, i32* %5
br label %14
10: ; preds = %2, %2
%11 = load atomic i32, i32* %6 acquire
store i32 %11, i32* %5
br label %14
12: ; preds = %2
%13 = load atomic i32, i32* %6 seq_cst
store i32 %13, i32* %5
br label %14
14: ; preds = %12, %10, %8
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @atomic_load_n_unsigned_int(i32* nocapture %0, i32 %1) {
switch i32 %1, label %3 [
i32 1, label %5
i32 2, label %5
i32 5, label %7
]
3: ; preds = %2
%4 = load atomic i32, i32* %0 monotonic
br label %9
5: ; preds = %2, %2
%6 = load atomic i32, i32* %0 acquire
br label %9
7: ; preds = %2
%8 = load atomic i32, i32* %0 seq_cst
br label %9
9: ; preds = %7, %5, %3
%10 = phi i32 [ %4, %3 ], [ %8, %7 ], [ %6, %5 ]
ret i32 %10
}