xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void strcopy(char *dest, char *src, int length) {
  strncpy(dest, src, length);
  dest[length] = '\0';
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @strcopy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @strcopy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
/* Variables and functions */
char *strchr(const char *cs, int c) {
  const char *s;
  s = cs;
  while (*s) {
    if (*s == c)
      return (char *)s;
    s++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strchr+0x4e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113d <strchr+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <strchr+0x56>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int crypto_onetimeauth_poly1305_verify(unsigned char const *,
                                       unsigned char const *, size_t,
                                       unsigned char const *);
int poly1305_verify(const unsigned char *mac, const unsigned char *key,
                    const unsigned char *msg, size_t msg_len) {
  return crypto_onetimeauth_poly1305_verify(mac, msg, msg_len, key);
}


x86 assembly (clang, -O0):
<poly1305_verify>:
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    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   1030 <crypto_onetimeauth_poly1305_verify@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly1305_verify>:
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %rax,%rcx
jmp    1030 <crypto_onetimeauth_poly1305_verify@plt>

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

LLVM IR (-O2):
define i32 @poly1305_verify(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @crypto_onetimeauth_poly1305_verify(i8* %0, i8* %2, i64 %3, i8* %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ arch_nop();
void emit_nop() { arch_nop(); }


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

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

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

LLVM IR (-O2):
define void @emit_nop() {
%1 = tail call i32 (...) @arch_nop()
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int gettimeofday(struct timeval *, void *);
int openvpn_gettimeofday(struct timeval *tv, void *tz) {
  return gettimeofday(tv, tz);
}


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

x86 assembly (clang, -O2):
<openvpn_gettimeofday>:
jmp    1030 <gettimeofday@plt>

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @openvpn_gettimeofday(%struct.timeval* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @gettimeofday(%struct.timeval* %0, i8* %1)
ret i32 %3
}
int user_mode(struct pt_regs *regs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define i32 @user_mode(%struct.pt_regs* nocapture readnone %0) {
ret i32 0
}
int foo(float a, float b) {
  if (a == b)
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    112f <foo+0x2f>
jp     112f <foo+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <foo+0x36>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmpeqss %xmm1,%xmm0
movd   %xmm0,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @foo(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp oeq float %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %11
10: ; preds = %2
store i32 2, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo(float %0, float %1) {
%3 = fcmp oeq float %0, %1
%4 = select i1 %3, i32 1, i32 2
ret i32 %4
}
/* Variables and functions */
double fabs(double);
int check_j_cm2(double val) { return (fabs(val) < 1.0e8) ? 1 : 0; }


x86 assembly (clang, -O0):
<check_j_cm2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xefb(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xedf(%rip),%xmm0
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_j_cm2>:
andpd  0xef8(%rip),%xmm0
movsd  0xf00(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @check_j_cm2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 1.000000e+08
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @check_j_cm2(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp olt double %2, 1.000000e+08
%4 = zext i1 %3 to i32
ret i32 %4
}
void gpioclr(volatile unsigned int *gpioptr, int portn) {
  *(gpioptr + 10 + (portn / 32)) = 1 << portn;
}


x86 assembly (clang, -O0):
<gpioclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,0x28(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpioclr>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
lea    0x1f(%rcx),%edx
test   %esi,%esi
cmovns %ecx,%edx
sar    $0x5,%edx
movslq %edx,%rcx
mov    %eax,0x28(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @gpioclr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 10
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 32
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
store volatile i32 %6, i32* %12
ret void
}

LLVM IR (-O2):
define void @gpioclr(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = getelementptr inbounds i32, i32* %0, i64 10
%5 = sdiv i32 %1, 32
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %4, i64 %6
store volatile i32 %3, i32* %7
ret void
}
int uh_usb_parse_path(char *buf) {
  int pos = 0;
  while (buf[pos] != ';') {
    pos++;
  }
  pos = pos + 1;
  return pos;
}


x86 assembly (clang, -O0):
<uh_usb_parse_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3b,%eax
je     1132 <uh_usb_parse_path+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <uh_usb_parse_path+0xf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uh_usb_parse_path>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x3b,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <uh_usb_parse_path+0x10>
ret

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

LLVM IR (-O2):
define i32 @uh_usb_parse_path(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 59
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nuw nsw i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int cg_write(char const *, char *, char *);
int cg_freeze_nowait(const char *cgroup, bool freeze) {
  return cg_write(cgroup, "cgroup.freeze", freeze ? "1" : "0");
}


x86 assembly (clang, -O0):
<cg_freeze_nowait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xee3(%rip),%rdx
lea    0xeda(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xebe(%rip),%rsi
call   1030 <cg_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cg_freeze_nowait>:
test   %esi,%esi
lea    0xef7(%rip),%rax
lea    0xeee(%rip),%rdx
cmove  %rax,%rdx
lea    0xed5(%rip),%rsi
jmp    1030 <cg_write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"cgroup.freeze\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"0\00"
define i32 @cg_freeze_nowait(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 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @cg_write(i8* %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"cgroup.freeze\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"0\00"
define i32 @cg_freeze_nowait(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @cg_write(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}
double velocity(double v0, double a, double t) { return v0 + a * t; }


x86 assembly (clang, -O0):
<velocity>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<velocity>:
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @velocity(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %1, double %2, double %0)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *s) {
  fprintf(stderr, "fatal error: %s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"fatal error: %s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"fatal error: %s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_rwlock_destroy(int /*<<< orphan*/ *);
void __attribute__((__unused__))
_hash_pthread_rwlock_dtor_hnode_hh(void *m,
                                   void *_HU_d __attribute__((__unused__))) {
  pthread_rwlock_t *rwlck = (pthread_rwlock_t *)m;
  pthread_rwlock_destroy(rwlck);
  free(rwlck);
}


x86 assembly (clang, -O0):
<_hash_pthread_rwlock_dtor_hnode_hh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pthread_rwlock_destroy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_hash_pthread_rwlock_dtor_hnode_hh(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @pthread_rwlock_destroy(i32* %8)
%10 = load i32*, i32** %5
%11 = call i32 @free(i32* %10)
ret void
}

LLVM IR (-O2):
define void @_hash_pthread_rwlock_dtor_hnode_hh(i8* %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @pthread_rwlock_destroy(i32* %3)
%5 = tail call i32 @free(i32* %3)
ret void
}
int dsfmt_get_min_array_size(void) { return (((19937 - 128) / 104 + 1) * 2); }


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

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

LLVM IR (-O0):
define i32 @dsfmt_get_min_array_size() {
ret i32 382
}

LLVM IR (-O2):
define i32 @dsfmt_get_min_array_size() {
ret i32 382
}
/* Variables and functions */
size_t calc_banner_len(const char *banner, size_t len) {
  while (len > 0 && banner[len - 1] == 0) {
    len--;
  }
  return len;
}


x86 assembly (clang, -O0):
<calc_banner_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1135 <calc_banner_len+0x35>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <calc_banner_len+0x45>
jmp    1156 <calc_banner_len+0x56>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <calc_banner_len+0xc>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_banner_len>:
mov    %rsi,%rax
sub    $0x1,%rsi
jb     1110 <calc_banner_len+0x10>
cmpb   $0x0,-0x1(%rdi,%rax,1)
je     1100 <calc_banner_len>
ret

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

LLVM IR (-O2):
define i64 @calc_banner_len(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i64 [ %1, %2 ], [ %7, %6 ]
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = add i64 %4, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %3, label %11
11: ; preds = %3, %6
ret i64 %4
}
IR0RX1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*p0) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0RX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1147 <IR0RX1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <IR0RX1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0RX1>:
movslq %esi,%rax
movsd  (%rcx,%rax,8),%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @IR0RX1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = load double, double* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds double, double* %5, i64 %8
%10 = load double, double* %9
%11 = fcmp ole double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int pow(double, int);
int power_2(int input) { return pow((double)2, input); }


x86 assembly (clang, -O0):
<power_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
movsd  0xeda(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_2>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i32 @power_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pow(double 2.000000e+00, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @power_2(i32 %0) {
%2 = tail call i32 @pow(double 2.000000e+00, i32 %0)
ret i32 %2
}
/* Variables and functions */
void stub1(float);
void testClosureFrV(void (*closure)(float), float a1) {
  if (closure != NULL)
    (*closure)(a1);
}


x86 assembly (clang, -O0):
<testClosureFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1127 <testClosureFrV+0x27>
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFrV>:
test   %rdi,%rdi
je     1107 <testClosureFrV+0x7>
jmp    *%rdi
ret

LLVM IR (-O0):
define void @testClosureFrV(void (float)* %0, float %1) {
%3 = alloca void (float)*
%4 = alloca float
store void (float)* %0, void (float)** %3
store float %1, float* %4
%5 = load void (float)*, void (float)** %3
%6 = icmp ne void (float)* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load void (float)*, void (float)** %3
%9 = load float, float* %4
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @testClosureFrV(void (float)* %0, float %1) {
%3 = icmp eq void (float)* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
tail call void %0(float %1)
br label %5
5: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FLEXCOMM0_DriverIRQHandler();
__attribute__((weak)) void FLEXCOMM0_IRQHandler(void) {
  FLEXCOMM0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @FLEXCOMM0_IRQHandler() {
%1 = call i32 (...) @FLEXCOMM0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @FLEXCOMM0_IRQHandler() {
%1 = tail call i32 (...) @FLEXCOMM0_DriverIRQHandler()
ret void
}
void ARGB4444ToUVRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGB4444ToUVRow_C() {
ret void
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <min+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void delay_us(unsigned int i) {
  while (i--) {
  }
}


x86 assembly (clang, -O0):
<delay_us>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1120 <delay_us+0x20>
jmp    1107 <delay_us+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay_us(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay_us(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct udev {
  int dummy;
};

/* Variables and functions */
int devnode_acl_all(struct udev *udev, const char *seat, bool flush, bool del,
                    uid_t old_uid, bool add, uid_t new_uid) {
  return 0;
}


x86 assembly (clang, -O0):
<devnode_acl_all>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.udev = type { i32 }
define i32 @devnode_acl_all(%struct.udev* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.udev*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store %struct.udev* %0, %struct.udev** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
ret i32 0
}

LLVM IR (-O2):
%struct.udev = type { i32 }
define i32 @devnode_acl_all(%struct.udev* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
ret i32 0
}
unsigned getval_472() { return 3525365389U; }


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

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

LLVM IR (-O0):
define i32 @getval_472() {
ret i32 -769601907
}

LLVM IR (-O2):
define i32 @getval_472() {
ret i32 -769601907
}
void free_headers(char **additional_headers, int n_additional_headers) {
  int index = 0;
  for (index = 0; index < n_additional_headers; index++)
    free(additional_headers[index]);
  free(additional_headers);
}


x86 assembly (clang, -O0):
<free_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <free_headers+0x48>
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    112d <free_headers+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_headers>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_headers+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_headers+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_headers(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *thread_func(void *p) {
  static int thread_index = 0;
  printf("thread id: %d\n", thread_index);
  thread_index++;
  while (1)
    ;
  return NULL;
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ef8(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eef(%rip)
jmp    113d <thread_func+0x2d>

x86 assembly (clang, -O2):
<thread_func>:
push   %rax
mov    0x2f15(%rip),%esi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
addl   $0x1,0x2f02(%rip)
nopw   0x0(%rax,%rax,1)
jmp    1130 <thread_func+0x20>

LLVM IR (-O0):
@thread_func.thread_index = internal global i32 0
@.str = [15 x i8] c"thread id: %d\0A\00"
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @thread_func.thread_index
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @thread_func.thread_index
%6 = add nsw i32 %5, 1
store i32 %6, i32* @thread_func.thread_index
br label %7
7: ; preds = %1, %7
br label %7
}

LLVM IR (-O2):
@thread_func.thread_index = internal unnamed_addr global i32 0
@.str = [15 x i8] c"thread id: %d\0A\00"
define noalias i8* @thread_func(i8* nocapture readnone %0) {
%2 = load i32, i32* @thread_func.thread_index
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @thread_func.thread_index
%5 = add nsw i32 %4, 1
store i32 %5, i32* @thread_func.thread_index
br label %6
6: ; preds = %1, %6
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ printd(int);
int /*<<< orphan*/ putchar(char);
int main() {
  printd(123);
  putchar('\n');
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @printd(i32 123)
%2 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printd(i32 123)
%2 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
signed char signedchar_ignoring_longlongint(signed char x, long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedchar_ignoring_longlongint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedchar_ignoring_longlongint>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @signedchar_ignoring_longlongint(i8 returned signext %0, i64 %1) {
ret i8 %0
}
int map(int i, int j, int ncols, char transpose) {
  if (transpose == 't') {
    return j * ncols + i;
  } else {
    return i * ncols + j;
  }
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x74,%eax
jne    1131 <map+0x31>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <map+0x3e>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
mov    %edx,%r8d
imul   %esi,%r8d
add    %edi,%r8d
imul   %edi,%edx
lea    (%rdx,%rsi,1),%eax
cmp    $0x74,%cl
cmove  %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @map(i32 %0, i32 %1, i32 %2, i8 signext %3) {
%5 = icmp eq i8 %3, 116
%6 = mul nsw i32 %2, %1
%7 = add nsw i32 %6, %0
%8 = mul nsw i32 %2, %0
%9 = add nsw i32 %8, %1
%10 = select i1 %5, i32 %7, i32 %9
ret i32 %10
}
/* Variables and functions */
char *getenv(char *);
scalar_t__ strlen(char *);
char *G_get_basename_separator() {
  char *envvar = "GRASS_BASENAME_SEPARATOR";
  char *envsep;
  envsep = getenv(envvar);
  return (envsep != NULL && strlen(envsep) > 0) ? envsep : "__";
}


x86 assembly (clang, -O0):
<G_get_basename_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <G_get_basename_separator+0x4b>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    116b <G_get_basename_separator+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    117b <G_get_basename_separator+0x5b>
lea    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    117b <G_get_basename_separator+0x5b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_get_basename_separator>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     114d <G_get_basename_separator+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
lea    0xed2(%rip),%rax
cmovg  %rbx,%rax
pop    %rbx
ret
lea    0xec5(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"GRASS_BASENAME_SEPARATOR\00"
@.str.1 = [3 x i8] c"__\00"
define i8* @G_get_basename_separator() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i8* @getenv(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8*, i8** %2
br label %14
13: ; preds = %7, %0
br label %14
14: ; preds = %13, %11
%15 = phi i8* [ %12, %11 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %13 ]
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"GRASS_BASENAME_SEPARATOR\00"
@.str.1 = [3 x i8] c"__\00"
define i8* @G_get_basename_separator() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @strlen(i8* %1)
%5 = icmp sgt i64 %4, 0
%6 = select i1 %5, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
br label %7
7: ; preds = %3, %0
%8 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %0 ], [ %6, %3 ]
ret i8* %8
}
/* Variables and functions */
long double cosl(long double);
__attribute__((__weak__, __always___)) long double
softboundcets_cosl(long double x) {
  return cosl(x);
}


x86 assembly (clang, -O0):
<softboundcets_cosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <cosl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_cosl>:
jmp    1030 <cosl@plt>

LLVM IR (-O0):
define weak x86_fp80 @softboundcets_cosl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @cosl(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define weak x86_fp80 @softboundcets_cosl(x86_fp80 %0) {
%2 = tail call x86_fp80 @cosl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_pop_bc(void) { op_write1(0xc1); }


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

x86 assembly (clang, -O2):
<op_enc_pop_bc>:
mov    $0xc1,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_pop_bc() {
%1 = call i32 @op_write1(i32 193)
ret void
}

LLVM IR (-O2):
define void @op_enc_pop_bc() {
%1 = tail call i32 @op_write1(i32 193)
ret void
}
int mod(int n) {
  if (n > 0)
    return n;
  else
    return (-n);
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111c <mod+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <mod+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void radiatepiece(int s, int gral, int c, int (*rtval)[26]) { s = rtval[2][3]; }


x86 assembly (clang, -O0):
<radiatepiece>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0xdc(%rax),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @radiatepiece(i32 %0, i32 %1, i32 %2, [26 x i32]* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [26 x i32]*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store [26 x i32]* %3, [26 x i32]** %8
%9 = load [26 x i32]*, [26 x i32]** %8
%10 = getelementptr inbounds [26 x i32], [26 x i32]* %9, i64 2
%11 = getelementptr inbounds [26 x i32], [26 x i32]* %10, i64 0, i64 3
%12 = load i32, i32* %11
store i32 %12, i32* %5
ret void
}

LLVM IR (-O2):
define void @radiatepiece(i32 %0, i32 %1, i32 %2, [26 x i32]* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: e-access <packet>\n");
  printf("Ex: 00000000_76543210_80800000_05\n");
  return;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: e-access <packet>\0A\00"
@.str.1 = [35 x i8] c"Ex: 00000000_76543210_80800000_05\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Usage: e-access <packet>\00"
@str.2 = [34 x i8] c"Ex: 00000000_76543210_80800000_05\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.2, i64 0, i64 0))
ret void
}
void gdk_cursor_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_cursor_type_get_type() {
ret void
}
double modf(double param, double *intpart) {
  *intpart = (int)param;
  return (param - *intpart);
}


x86 assembly (clang, -O0):
<modf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modf>:
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
movlpd %xmm1,(%rdi)
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @modf(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = fptosi double %5 to i32
%7 = sitofp i32 %6 to double
%8 = load double*, double** %4
store double %7, double* %8
%9 = load double, double* %3
%10 = load double*, double** %4
%11 = load double, double* %10
%12 = fsub double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @modf(double %0, double* nocapture writeonly %1) {
%3 = fptosi double %0 to i32
%4 = sitofp i32 %3 to double
store double %4, double* %1
%5 = fsub double %0, %4
ret double %5
}
/* Variables and functions */
int a();
int b() { return a() * a(); }


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <a@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <a@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rbx
xor    %eax,%eax
call   1030 <a@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <a@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @b() {
%1 = call i32 (...) @a()
%2 = call i32 (...) @a()
%3 = mul nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @b() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @a()
%3 = mul nsw i32 %2, %1
ret i32 %3
}
int test_imm_D0int16_mem(short *val) {
  return ((*val) & (-0xD0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D0int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -208
%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_D0int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -208
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}