xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int iupUnixIsFile(const char *name) {
  struct stat status;
  if (stat(name, &status) != 0)
    return 0;
  if (S_ISDIR(status.st_mode))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<iupUnixIsFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <iupUnixIsFile+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1174 <iupUnixIsFile+0x54>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     116d <iupUnixIsFile+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1174 <iupUnixIsFile+0x54>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupUnixIsFile>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <iupUnixIsFile+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @iupUnixIsFile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i64 @S_ISDIR(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 0, i32* %2
br label %16
15: ; preds = %9
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @iupUnixIsFile(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
_Bool failed_ctor(const void *key, void *placement) {
  (void)key;
  (void)placement;
  return 0;
}


x86 assembly (clang, -O0):
<failed_ctor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i1 @failed_ctor(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i1 false
}
void ajRefseqoutExit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ajRefseqoutExit() {
ret void
}
IR0RX1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*p0) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     1145 <IR0RX1+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <IR0RX1+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0RX1>:
mov    (%r8),%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,1),%dl
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture %5) {
%7 = load i8, i8* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = icmp ule i8 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
float sqrt(float);
float yotrig(float v1, float v2) { return v1 + v2 + sqrt(v1 * v1 + v2 * v2); }


x86 assembly (clang, -O0):
<yotrig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yotrig>:
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <yotrig+0x21>
sqrtss %xmm0,%xmm0
jmp    1147 <yotrig+0x37>
push   %rax
movss  %xmm2,0x4(%rsp)
call   1030 <sqrt@plt>
movss  0x4(%rsp),%xmm2
add    $0x8,%rsp
addss  %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @yotrig(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
%8 = load float, float* %3
%9 = load float, float* %3
%10 = load float, float* %4
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %8, float %9, float %12)
%14 = call float @sqrt(float %13)
%15 = fadd float %7, %14
ret float %15
}

LLVM IR (-O2):
define float @yotrig(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = tail call float @sqrt(float %5)
%7 = fadd float %3, %6
ret float %7
}
/* Variables and functions */
int ___get_netmask(int);
int ___ip_switch(int);
int zget_ip_min(int ip, int masklen) {
  int nip = ___ip_switch(ip);
  int mask = ___get_netmask(masklen);
  return ___ip_switch((nip & mask) + 1);
}


x86 assembly (clang, -O0):
<zget_ip_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <___ip_switch@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <___get_netmask@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
and    -0x10(%rbp),%edi
add    $0x1,%edi
call   1030 <___ip_switch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zget_ip_min>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <___ip_switch@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <___get_netmask@plt>
and    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <___ip_switch@plt>

LLVM IR (-O0):
define i32 @zget_ip_min(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i32 @___ip_switch(i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @___get_netmask(i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = call i32 @___ip_switch(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @zget_ip_min(i32 %0, i32 %1) {
%3 = tail call i32 @___ip_switch(i32 %0)
%4 = tail call i32 @___get_netmask(i32 %1)
%5 = and i32 %4, %3
%6 = add nsw i32 %5, 1
%7 = tail call i32 @___ip_switch(i32 %6)
ret i32 %7
}
int isBootFromNorFlash(void) {
  volatile int *p = (volatile int *)0;
  int val;
  val = *p;
  *p = 0x12345678;
  if (*p == 0x12345678) {
    *p = val;
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isBootFromNorFlash>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x12345678,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    $0x12345678,%eax
jne    1145 <isBootFromNorFlash+0x45>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    114c <isBootFromNorFlash+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBootFromNorFlash>:
mov    0x0,%ecx
movl   $0x12345678,0x0
78 56 34 12
mov    0x0,%edx
mov    $0x1,%eax
cmp    $0x12345678,%edx
jne    112f <isBootFromNorFlash+0x2f>
mov    %ecx,0x0
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isBootFromNorFlash() {
%1 = load volatile i32, i32* null
store volatile i32 305419896, i32* null
%2 = load volatile i32, i32* null
%3 = icmp eq i32 %2, 305419896
br i1 %3, label %4, label %5
4: ; preds = %0
store volatile i32 %1, i32* null
br label %5
5: ; preds = %0, %4
%6 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *sentence = "This is the sentence.";
  printf("%s\n", sentence);
  printf("%s\n", sentence);
  sentence = "This is another sentence.";
  printf("%s", sentence);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xefb(%rip),%rbx
lea    0xede(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"This is the sentence.\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [26 x i8] c"This is another sentence.\00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"This is the sentence.\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [26 x i8] c"This is another sentence.\00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void unsigned_char_add_signed_char_unsigned_int(unsigned char *LHS,
                                                unsigned int RHS) {
  (*LHS) += RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_add_signed_char_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_add_signed_char_unsigned_int>:
add    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_add_signed_char_unsigned_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = add i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @unsigned_char_add_signed_char_unsigned_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = add i8 %3, %4
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int fdwrite(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int fdputs(int fd, char *msg) { return fdwrite(fd, msg, strlen(msg)); }


x86 assembly (clang, -O0):
<fdputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <fdwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fdputs(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @fdwrite(i32 %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @fdputs(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @fdwrite(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
void rfcomm_cleanup_ttys(void) {}


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

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

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

LLVM IR (-O2):
define void @rfcomm_cleanup_ttys() {
ret void
}
int ti_sma_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_sma_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_sma_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_sma_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_sma_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Type definitions */
struct packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct packet *);
void listener_freepkt(struct packet *pk) { free(pk); }


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

x86 assembly (clang, -O2):
<listener_freepkt>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.packet = type { i32 }
define void @listener_freepkt(%struct.packet* nocapture %0) {
%2 = tail call i32 @free(%struct.packet* %0)
ret void
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  void *next_key;
  void *key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_GET_NEXT_KEY;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
void *ptr_to_u64(void *);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_map_get_next_key(int fd, void *key, void *next_key) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.map_fd = fd;
  attr.key = ptr_to_u64(key);
  attr.next_key = ptr_to_u64(next_key);
  return sys_bpf(BPF_MAP_GET_NEXT_KEY, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_map_get_next_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1050 <bzero@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %rax,-0x20(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <sys_bpf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_map_get_next_key>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%rdi
call   1040 <ptr_to_u64@plt>
mov    %rbx,%rdi
call   1040 <ptr_to_u64@plt>
mov    %rax,0x8(%rsp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i8* }
@BPF_MAP_GET_NEXT_KEY = global i32 0
define i32 @bpf_map_get_next_key(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i32 @bzero(%union.bpf_attr* %7, i32 8)
%9 = load i32, i32* %4
%10 = bitcast %union.bpf_attr* %7 to i32*
store i32 %9, i32* %10
%11 = load i8*, i8** %5
%12 = call i8* @ptr_to_u64(i8* %11)
%13 = bitcast %union.bpf_attr* %7 to i8**
store i8* %12, i8** %13
%14 = load i8*, i8** %6
%15 = call i8* @ptr_to_u64(i8* %14)
%16 = bitcast %union.bpf_attr* %7 to i8**
store i8* %15, i8** %16
%17 = load i32, i32* @BPF_MAP_GET_NEXT_KEY
%18 = call i32 @sys_bpf(i32 %17, %union.bpf_attr* %7, i32 8)
ret i32 %18
}

LLVM IR (-O2):
%union.bpf_attr = type { i8* }
@BPF_MAP_GET_NEXT_KEY = global i32 0
define i32 @bpf_map_get_next_key(i32 %0, i8* %1, i8* %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = tail call i8* @ptr_to_u64(i8* %1)
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
%8 = tail call i8* @ptr_to_u64(i8* %2)
store i8* %8, i8** %7
%9 = load i32, i32* @BPF_MAP_GET_NEXT_KEY
%10 = call i32 @sys_bpf(i32 %9, %union.bpf_attr* %4, i32 8)
ret i32 %10
}
/* Variables and functions */
size_t ZBUFF_recommendedDOutSize() { return (128 * 1024); }


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

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

LLVM IR (-O0):
define i64 @ZBUFF_recommendedDOutSize() {
ret i64 131072
}

LLVM IR (-O2):
define i64 @ZBUFF_recommendedDOutSize() {
ret i64 131072
}
int first() { return 1001; }


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

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

LLVM IR (-O0):
define i32 @first() {
ret i32 1001
}

LLVM IR (-O2):
define i32 @first() {
ret i32 1001
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int main() {
  while (1)
    usleep(500);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1f4,%edi
call   1030 <usleep@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1f4,%edi
call   1030 <usleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @usleep(i32 500)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @usleep(i32 500)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __mode_t;
typedef int /*<<< orphan*/ __dev_t;

/* Variables and functions */
int __xmknodat(int, int, char const *, int /*<<< orphan*/,
               int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int
softboundcets___xmknodat(int __ver, int __fd, const char *__path,
                         __mode_t __mode, __dev_t *__dev) {
  return __xmknodat(__ver, __fd, __path, __mode, __dev);
}


x86 assembly (clang, -O0):
<softboundcets___xmknodat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <__xmknodat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets___xmknodat>:
jmp    1030 <__xmknodat@plt>

LLVM IR (-O0):
define weak i32 @softboundcets___xmknodat(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32*, i32** %10
%16 = call i32 @__xmknodat(i32 %11, i32 %12, i8* %13, i32 %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define weak i32 @softboundcets___xmknodat(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4) {
%6 = tail call i32 @__xmknodat(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void OptickAPI_AttachTag_Int32(uint64_t inEventDescription, uint32_t inValue) {}


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

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

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

LLVM IR (-O2):
define void @OptickAPI_AttachTag_Int32(i32 %0, i32 %1) {
ret void
}
int kvmppc_uvmem_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kvmppc_uvmem_init() {
ret i32 0
}
float foo(float x, float y) {
  volatile int i = 0;
  return i > 0 ? x : y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    1130 <foo+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    113a <foo+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jg     1112 <foo+0x12>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @foo(float %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, float %0, float %1
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void test_for() {
  printf("\n===== test_for\n");
  int result = 1;
  for (int i = 1; i < 10; ++i) {
    ++result;
  }
  assert(result == 10);
}


x86 assembly (clang, -O0):
<test_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1163 <test_for+0x43>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <test_for+0x22>
cmpl   $0xa,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_for>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

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

LLVM IR (-O2):
@str = [16 x i8] c"\0A===== test_for\00"
define void @test_for() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
unsigned long xt_core_hash_djb2_xor(char *string) {
  assert(string);
  unsigned long hash;
  int c;
  hash = 5381;
  while ((c = *string++)) {
    hash = ((hash << 5) + hash) ^ c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<xt_core_hash_djb2_xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1167 <xt_core_hash_djb2_xor+0x57>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    112d <xt_core_hash_djb2_xor+0x1d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_core_hash_djb2_xor>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     114e <xt_core_hash_djb2_xor+0x3e>
add    $0x1,%rbx
mov    $0x1505,%eax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
xor    %rdx,%rax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <xt_core_hash_djb2_xor+0x20>
pop    %rbx
ret
mov    $0x1505,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @xt_core_hash_djb2_xor(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %13, %5 ], [ %3, %1 ]
%7 = phi i8* [ %9, %5 ], [ %0, %1 ]
%8 = phi i64 [ %12, %5 ], [ 5381, %1 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i64 %8, 33
%11 = sext i8 %6 to i64
%12 = xor i64 %10, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %1
%16 = phi i64 [ 5381, %1 ], [ %12, %5 ]
ret i64 %16
}
void foo365() {}


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

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

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

LLVM IR (-O2):
define void @foo365() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int util_option(char *arg, char *flag, char *verbose) {
  return strcmp(arg, flag) == 0 || strcmp(arg, verbose) == 0;
}


x86 assembly (clang, -O0):
<util_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     115a <util_option+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_option>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcmp@plt>
test   %rax,%rax
je     113c <util_option+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
jmp    1141 <util_option+0x31>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @util_option(i8* %0, i8* %1, i8* %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** %5
%9 = call i64 @strcmp(i8* %7, i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %6
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp eq i64 %14, 0
br label %16
16: ; preds = %11, %3
%17 = phi i1 [ true, %3 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @util_option(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @strcmp(i8* %0, i8* %2)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
int __test() {
  int x = 0;
  int y = 0;
  while (x < 3) {
    x++;
    y += x;
  }
  return y;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1133 <__test+0x33>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <__test+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ DecodeI_xxxxxxxxssmmmrrr();
int /*<<< orphan*/ DoBinOpAnd(int /*<<< orphan*/);
void DoCodeAndI(void) { DoBinOpAnd(DecodeI_xxxxxxxxssmmmrrr()); }


x86 assembly (clang, -O0):
<DoCodeAndI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <DecodeI_xxxxxxxxssmmmrrr@plt>
mov    %eax,%edi
call   1030 <DoBinOpAnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeAndI>:
push   %rax
xor    %eax,%eax
call   1040 <DecodeI_xxxxxxxxssmmmrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <DoBinOpAnd@plt>

LLVM IR (-O0):
define void @DoCodeAndI() {
%1 = call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = call i32 @DoBinOpAnd(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeAndI() {
%1 = tail call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = tail call i32 @DoBinOpAnd(i32 %1)
ret void
}
void oil_param_get_source_data(void) {}


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

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

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

LLVM IR (-O2):
define void @oil_param_get_source_data() {
ret void
}
void g_queue_reverse() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_reverse() {
ret void
}
void tmpi_prog_user_init_default() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *stderr;
FILE *get_stderr(void) { return stderr; }


x86 assembly (clang, -O0):
<get_stderr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_stderr>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stderr = global i32* null
define i32* @get_stderr() {
%1 = load i32*, i32** @stderr
ret i32* %1
}

LLVM IR (-O2):
@stderr = global i32* null
define i32* @get_stderr() {
%1 = load i32*, i32** @stderr
ret i32* %1
}
int test_imm_95int64_highword_reg(long long val) {
  return ((val >> 32) & (0x95 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_95int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x95,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_95int64_highword_reg>:
movabs $0x9500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_95int64_highword_reg(i64 %0) {
%2 = and i64 %0, 639950127104
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long double test_atanl(long double x) { return __builtin_atanl(x); }


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

x86 assembly (clang, -O2):
<test_atanl>:
jmp    1030 <atanl@plt>

LLVM IR (-O0):
define x86_fp80 @test_atanl(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 @atanl(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test_atanl(x86_fp80 %0) {
%2 = tail call x86_fp80 @atanl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
struct aatree_node {
  int dummy;
};

/* Variables and functions */
struct aatree_node *__aatree_end(struct aatree_node *, int /*<<< orphan*/);
struct aatree_node *aatree_first(struct aatree_node *tree) {
  return __aatree_end(tree, 0);
}


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

x86 assembly (clang, -O2):
<aatree_first>:
xor    %esi,%esi
jmp    1030 <__aatree_end@plt>

LLVM IR (-O0):
%struct.aatree_node = type { i32 }
define %struct.aatree_node* @aatree_first(%struct.aatree_node* %0) {
%2 = alloca %struct.aatree_node*
store %struct.aatree_node* %0, %struct.aatree_node** %2
%3 = load %struct.aatree_node*, %struct.aatree_node** %2
%4 = call %struct.aatree_node* @__aatree_end(%struct.aatree_node* %3, i32 0)
ret %struct.aatree_node* %4
}

LLVM IR (-O2):
%struct.aatree_node = type { i32 }
define %struct.aatree_node* @aatree_first(%struct.aatree_node* %0) {
%2 = tail call %struct.aatree_node* @__aatree_end(%struct.aatree_node* %0, i32 0)
ret %struct.aatree_node* %2
}
char char_to_lowercase(char ch) {
  if (ch >= 'a' && ch <= 'z')
    return ch;
  if (ch >= 'A' && ch <= 'Z')
    return ch + 32;
  return 0;
}


x86 assembly (clang, -O0):
<char_to_lowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     112f <char_to_lowercase+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     112f <char_to_lowercase+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    115c <char_to_lowercase+0x5c>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1158 <char_to_lowercase+0x58>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1158 <char_to_lowercase+0x58>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    115c <char_to_lowercase+0x5c>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_lowercase>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
xor    %edx,%edx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edx,%eax
lea    -0x61(%rdi),%ecx
cmp    $0x1a,%cl
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @char_to_lowercase(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %27
13: ; preds = %7, %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 90
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %2
br label %27
26: ; preds = %17, %13
store i8 0, i8* %2
br label %27
27: ; preds = %26, %21, %11
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @char_to_lowercase(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 26
%6 = add i8 %0, 32
%7 = select i1 %5, i8 %6, i8 0
%8 = select i1 %3, i8 %0, i8 %7
ret i8 %8
}
int f_gt_mr2(float *a1, float a2) { return !(((*a1) > (a2))); }


x86 assembly (clang, -O0):
<f_gt_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_gt_mr2>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_gt_mr2(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp ogt float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_gt_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp ule float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ logCmdOption(char *, char *);
void logUnicodeCmdOption() {
  logCmdOption("-u, --unicode",
               "Use TSS UNICODE encoding for passwords to comply with "
               "applications using TSS popup boxes");
}


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

x86 assembly (clang, -O2):
<logUnicodeCmdOption>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <logCmdOption@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"-u, --unicode\00"
@.str.1 = [89 x i8] c"Use TSS UNICODE encoding for passwords to comply with applications using TSS popup boxes\00"
define void @logUnicodeCmdOption() {
%1 = call i32 @logCmdOption(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"-u, --unicode\00"
@.str.1 = [89 x i8] c"Use TSS UNICODE encoding for passwords to comply with applications using TSS popup boxes\00"
define void @logUnicodeCmdOption() {
%1 = tail call i32 @logCmdOption(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct xdg_popup_listener {
  int dummy;
};
struct xdg_popup {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int wl_proxy_add_listener(struct wl_proxy *, void (*)(), void *);
int xdg_popup_add_listener(struct xdg_popup *xdg_popup,
                           const struct xdg_popup_listener *listener,
                           void *data) {
  return wl_proxy_add_listener((struct wl_proxy *)xdg_popup,
                               (void (**)(void))listener, data);
}


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

x86 assembly (clang, -O2):
<xdg_popup_add_listener>:
jmp    1030 <wl_proxy_add_listener@plt>

LLVM IR (-O0):
%struct.xdg_popup = type { i32 }
%struct.xdg_popup_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @xdg_popup_add_listener(%struct.xdg_popup* %0, %struct.xdg_popup_listener* %1, i8* %2) {
%4 = alloca %struct.xdg_popup*
%5 = alloca %struct.xdg_popup_listener*
%6 = alloca i8*
store %struct.xdg_popup* %0, %struct.xdg_popup** %4
store %struct.xdg_popup_listener* %1, %struct.xdg_popup_listener** %5
store i8* %2, i8** %6
%7 = load %struct.xdg_popup*, %struct.xdg_popup** %4
%8 = bitcast %struct.xdg_popup* %7 to %struct.wl_proxy*
%9 = load %struct.xdg_popup_listener*, %struct.xdg_popup_listener** %5
%10 = bitcast %struct.xdg_popup_listener* %9 to void ()**
%11 = bitcast void ()** %10 to void (...)*
%12 = load i8*, i8** %6
%13 = call i32 @wl_proxy_add_listener(%struct.wl_proxy* %8, void (...)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.xdg_popup = type { i32 }
%struct.xdg_popup_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @xdg_popup_add_listener(%struct.xdg_popup* %0, %struct.xdg_popup_listener* %1, i8* %2) {
%4 = bitcast %struct.xdg_popup* %0 to %struct.wl_proxy*
%5 = bitcast %struct.xdg_popup_listener* %1 to void (...)*
%6 = tail call i32 @wl_proxy_add_listener(%struct.wl_proxy* %4, void (...)* %5, i8* %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ chdir_empty();
int /*<<< orphan*/ test_chdir_path();
void test_chdir(void) {
  test_chdir_path();
  chdir_empty();
}


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

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

LLVM IR (-O0):
define void @test_chdir() {
%1 = call i32 (...) @test_chdir_path()
%2 = call i32 (...) @chdir_empty()
ret void
}

LLVM IR (-O2):
define void @test_chdir() {
%1 = tail call i32 (...) @test_chdir_path()
%2 = tail call i32 (...) @chdir_empty()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
void pr6293() { free(0); }


x86 assembly (clang, -O0):
<pr6293>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr6293>:
xor    %edi,%edi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @pr6293() {
%1 = call i32 @free(i32 0)
ret void
}

LLVM IR (-O2):
define void @pr6293() {
%1 = tail call i32 @free(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remquo(double, double, int *);
int /*<<< orphan*/ remquof(float, float, int *);
int /*<<< orphan*/ remquol(long double, long double, int *);
void uninitvar_remquo(void) {
  float f1, f2;
  int *i1;
  (void)remquof(f1, f2, i1);
  double d1, d2;
  int *i2;
  (void)remquo(d1, d2, i2);
  long double ld1, ld2;
  int *i3;
  (void)remquol(ld1, ld2, i3);
}


x86 assembly (clang, -O0):
<uninitvar_remquo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rdi
call   1040 <remquof@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x28(%rbp),%rdi
call   1050 <remquo@plt>
fldt   -0x40(%rbp)
fldt   -0x50(%rbp)
mov    -0x58(%rbp),%rdi
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <remquol@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_remquo>:
sub    $0x28,%rsp
call   1040 <remquof@plt>
call   1050 <remquo@plt>
call   1030 <remquol@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_remquo() {
%1 = alloca float
%2 = alloca float
%3 = alloca i32*
%4 = alloca double
%5 = alloca double
%6 = alloca i32*
%7 = alloca x86_fp80
%8 = alloca x86_fp80
%9 = alloca i32*
%10 = load float, float* %1
%11 = load float, float* %2
%12 = load i32*, i32** %3
%13 = call i32 @remquof(float %10, float %11, i32* %12)
%14 = load double, double* %4
%15 = load double, double* %5
%16 = load i32*, i32** %6
%17 = call i32 @remquo(double %14, double %15, i32* %16)
%18 = load x86_fp80, x86_fp80* %7
%19 = load x86_fp80, x86_fp80* %8
%20 = load i32*, i32** %9
%21 = call i32 @remquol(x86_fp80 %18, x86_fp80 %19, i32* %20)
ret void
}

LLVM IR (-O2):
define void @uninitvar_remquo() {
%1 = tail call i32 @remquof(float undef, float undef, i32* undef)
%2 = tail call i32 @remquo(double undef, double undef, i32* undef)
%3 = tail call i32 @remquol(x86_fp80 undef, x86_fp80 undef, i32* undef)
ret void
}