xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
char *ctime(int /*<<< orphan*/ *);
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  struct tm *ptr;
  time_t timeptr;
  time(&timeptr);
  ptr = gmtime(&timeptr);
  printf("UTC time is:   %s", asctime(ptr));
  printf("Local time is: %s", ctime(&timeptr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rdi
call   1060 <time@plt>
lea    -0x14(%rbp),%rdi
call   1070 <gmtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,%rsi
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe72(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <time@plt>
mov    %rbx,%rdi
call   1070 <gmtime@plt>
mov    %rax,%rdi
call   1040 <asctime@plt>
lea    0xe87(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
lea    0xe82(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"UTC time is: %s\00"
@.str.1 = [18 x i8] c"Local time is: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* %3)
%5 = call %struct.tm* @gmtime(i32* %3)
store %struct.tm* %5, %struct.tm** %2
%6 = load %struct.tm*, %struct.tm** %2
%7 = call i8* @asctime(%struct.tm* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i8* @ctime(i32* %3)
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"UTC time is: %s\00"
@.str.1 = [18 x i8] c"Local time is: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @gmtime(i32* %1)
%5 = call i8* @asctime(%struct.tm* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i8* @ctime(i32* %1)
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
void sam3ams2timeval(struct timeval *tv, uint64_t ms) {
  tv->tv_sec = ms / 1000;
  tv->tv_usec = (ms % 1000) * 1000;
}


x86 assembly (clang, -O0):
<sam3ams2timeval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam3ams2timeval>:
movslq %esi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rdi)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @sam3ams2timeval(%struct.timeval* %0, i32 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = srem i32 %9, 1000
%11 = mul nsw i32 %10, 1000
%12 = load %struct.timeval*, %struct.timeval** %3
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @sam3ams2timeval(%struct.timeval* nocapture writeonly %0, i32 %1) {
%3 = sdiv i32 %1, 1000
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i32 %3, i32* %4
%5 = srem i32 %1, 1000
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int getInstanceAttribute(int, int);
int getVisits(int location) { return getInstanceAttribute(location, 1); }


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

x86 assembly (clang, -O2):
<getVisits>:
mov    $0x1,%esi
jmp    1030 <getInstanceAttribute@plt>

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

LLVM IR (-O2):
define i32 @getVisits(i32 %0) {
%2 = tail call i32 @getInstanceAttribute(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exp(double);
double logOnePlus(int /*<<< orphan*/);
double logAdd(double x, double y) {
  return y <= x ? x + logOnePlus(exp(y - x)) : y + logOnePlus(exp(x - y));
}


x86 assembly (clang, -O0):
<logAdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     117c <logAdd+0x5c>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1030 <logOnePlus@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11ad <logAdd+0x8d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1030 <logOnePlus@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logAdd>:
ucomisd %xmm1,%xmm0
jb     1130 <logAdd+0x10>
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
jmp    1138 <logAdd+0x18>
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
sub    $0x18,%rsp
movapd %xmm1,%xmm3
cmpnlesd %xmm0,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
movapd %xmm3,(%rsp)
movapd %xmm2,%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1030 <logOnePlus@plt>
addsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @logAdd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fcmp ole double %5, %6
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = call i32 @exp(double %12)
%14 = call double @logOnePlus(i32 %13)
%15 = fadd double %9, %14
br label %24
16: ; preds = %2
%17 = load double, double* %4
%18 = load double, double* %3
%19 = load double, double* %4
%20 = fsub double %18, %19
%21 = call i32 @exp(double %20)
%22 = call double @logOnePlus(i32 %21)
%23 = fadd double %17, %22
br label %24
24: ; preds = %16, %8
%25 = phi double [ %15, %8 ], [ %23, %16 ]
ret double %25
}

LLVM IR (-O2):
define double @logAdd(double %0, double %1) {
%3 = fcmp ugt double %1, %0
%4 = fsub double %0, %1
%5 = fsub double %1, %0
%6 = select i1 %3, double %4, double %5
%7 = select i1 %3, double %1, double %0
%8 = tail call i32 @exp(double %6)
%9 = tail call double @logOnePlus(i32 %8)
%10 = fadd double %9, %7
ret double %10
}
int attr_crc32_words_block_compare(const void *a, const void *b) {
  unsigned int i = *((unsigned int *)a), j = *((unsigned int *)b);
  if (i > j)
    return +1;
  if (i < j)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<attr_crc32_words_block_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    1136 <attr_crc32_words_block_compare+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <attr_crc32_words_block_compare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    114e <attr_crc32_words_block_compare+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <attr_crc32_words_block_compare+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<attr_crc32_words_block_compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
sbb    %edx,%edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @attr_crc32_words_block_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ugt i32 %4, %6
%8 = icmp ult i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEif_icmplt(int, int /*<<< orphan*/ *);
void code_if_icmplt(int label) { appendCODE(makeCODEif_icmplt(label, NULL)); }


x86 assembly (clang, -O0):
<code_if_icmplt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <makeCODEif_icmplt@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_if_icmplt>:
push   %rax
xor    %esi,%esi
call   1040 <makeCODEif_icmplt@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <appendCODE@plt>

LLVM IR (-O0):
define void @code_if_icmplt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @makeCODEif_icmplt(i32 %3, i32* null)
%5 = call i32 @appendCODE(i32 %4)
ret void
}

LLVM IR (-O2):
define void @code_if_icmplt(i32 %0) {
%2 = tail call i32 @makeCODEif_icmplt(i32 %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
int builddia(int day, int month, int year) {
  return (year * 10000 + month * 100 + day);
}


x86 assembly (clang, -O0):
<builddia>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x2710,-0xc(%rbp),%eax
imul   $0x64,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<builddia>:
imul   $0x2710,%edx,%ecx
imul   $0x64,%esi,%eax
add    %edi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @builddia(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 10000
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 100
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @builddia(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, 10000
%5 = mul nsw i32 %1, 100
%6 = add i32 %5, %0
%7 = add i32 %6, %4
ret i32 %7
}
/* Variables and functions */
double exp(double);
double log(double);
double PDFloglogistic(double x, double loc, double s) {
  double y = (log(x) - loc) / s, e = exp(-y);
  return 1 / (s * x) * e / ((1 + e) * (1 + e));
}


x86 assembly (clang, -O0):
<PDFloglogistic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe78(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xe67(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
movsd  0xe5a(%rip),%xmm2
addsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDFloglogistic>:
sub    $0x18,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1040 <log@plt>
subsd  0x8(%rsp),%xmm0
xorpd  0xeb8(%rip),%xmm0
divsd  (%rsp),%xmm0
call   1030 <exp@plt>
movsd  0x10(%rsp),%xmm3
mulsd  (%rsp),%xmm3
movsd  0xeab(%rip),%xmm2
movapd %xmm2,%xmm1
divsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @PDFloglogistic(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = call double @log(double %9)
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = load double, double* %6
%14 = fdiv double %12, %13
store double %14, double* %7
%15 = load double, double* %7
%16 = fneg double %15
%17 = call double @exp(double %16)
store double %17, double* %8
%18 = load double, double* %6
%19 = load double, double* %4
%20 = fmul double %18, %19
%21 = fdiv double 1.000000e+00, %20
%22 = load double, double* %8
%23 = fmul double %21, %22
%24 = load double, double* %8
%25 = fadd double 1.000000e+00, %24
%26 = load double, double* %8
%27 = fadd double 1.000000e+00, %26
%28 = fmul double %25, %27
%29 = fdiv double %23, %28
ret double %29
}

LLVM IR (-O2):
define double @PDFloglogistic(double %0, double %1, double %2) {
%4 = tail call double @log(double %0)
%5 = fsub double %4, %1
%6 = fneg double %5
%7 = fdiv double %6, %2
%8 = tail call double @exp(double %7)
%9 = fmul double %0, %2
%10 = fdiv double 1.000000e+00, %9
%11 = fmul double %10, %8
%12 = fadd double %8, 1.000000e+00
%13 = fmul double %12, %12
%14 = fdiv double %11, %13
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exithelp() {
  printf(" --bind-addr=<ipv4_addr>|<ipv6_addr>\n --port=<port>\n "
         "--maxconn=<max_connections>\n --split-http-req=method|host\n "
         "--split-pos=<numeric_offset>\t; split at specified pos. invalidates "
         "split-http-req.\n --hostcase\t\t; change Host: => host:\n "
         "--hostspell\t\t; exact spelling of \"Host\" header. must be 4 chars. "
         "default is \"host\"\n --hostdot\t\t; add \".\" after Host: name\n "
         "--methodspace\t\t; add extra space after method\n --daemon\t\t; "
         "daemonize\n --user=<username>\t; drop root privs\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [463 x i8] c" --bind-addr=<ipv4_addr>|<ipv6_addr>\0A --port=<port>\0A --maxconn=<max_connections>\0A --split-http-req=method|host\0A --split-pos=<numeric_offset>\09; split at specified pos. invalidates split-http-req.\0A --hostcase\09\09; change Host: => host:\0A --hostspell\09\09; exact spelling of \22Host\22 header. must be 4 chars. default is \22host\22\0A --hostdot\09\09; add \22.\22 after Host: name\0A --methodspace\09\09; add extra space after method\0A --daemon\09\09; daemonize\0A --user=<username>\09; drop root privs\0A\00"
define void @exithelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([463 x i8], [463 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [462 x i8] c" --bind-addr=<ipv4_addr>|<ipv6_addr>\0A --port=<port>\0A --maxconn=<max_connections>\0A --split-http-req=method|host\0A --split-pos=<numeric_offset>\09; split at specified pos. invalidates split-http-req.\0A --hostcase\09\09; change Host: => host:\0A --hostspell\09\09; exact spelling of \22Host\22 header. must be 4 chars. default is \22host\22\0A --hostdot\09\09; add \22.\22 after Host: name\0A --methodspace\09\09; add extra space after method\0A --daemon\09\09; daemonize\0A --user=<username>\09; drop root privs\00"
define void @exithelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([462 x i8], [462 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int jit_function_XXXX() { return 42; }


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

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

LLVM IR (-O0):
define i32 @jit_function_XXXX() {
ret i32 42
}

LLVM IR (-O2):
define i32 @jit_function_XXXX() {
ret i32 42
}
int iscntrl(int c) { return (c < ' ' || c == 0x7f); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <iscntrl+0x20>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setl   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp slt i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("PATH: %s\n", getenv("PATH"));
  printf("HOME: %s\n", getenv("HOME"));
  printf("ROOT: %s\n", getenv("ROOT"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xedf(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <getenv@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <getenv@plt>
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <getenv@plt>
lea    0xeb4(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"PATH: %s\0A\00"
@.str.1 = [5 x i8] c"PATH\00"
@.str.2 = [10 x i8] c"HOME: %s\0A\00"
@.str.3 = [5 x i8] c"HOME\00"
@.str.4 = [10 x i8] c"ROOT: %s\0A\00"
@.str.5 = [5 x i8] c"ROOT\00"
define i32 @main() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"PATH: %s\0A\00"
@.str.1 = [5 x i8] c"PATH\00"
@.str.2 = [10 x i8] c"HOME: %s\0A\00"
@.str.3 = [5 x i8] c"HOME\00"
@.str.4 = [10 x i8] c"ROOT: %s\0A\00"
@.str.5 = [5 x i8] c"ROOT\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %5)
ret i32 0
}
int main() {
  int *p;
  int a;
  p = &a;
  *(p++) = 3;
  --p;
  return *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int bind(int, struct sockaddr const *, int /*<<< orphan*/);
int os_bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
  return bind(sockfd, addr, addrlen);
}


x86 assembly (clang, -O0):
<os_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bind@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_bind>:
jmp    1030 <bind@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @os_bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32, i32* %6
%10 = call i32 @bind(i32 %7, %struct.sockaddr* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @os_bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
ret i32 %4
}
void tegra_edp_notify_gpu_load(unsigned int load, unsigned int freq_in_hz) {}


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

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

LLVM IR (-O0):
define void @tegra_edp_notify_gpu_load(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 @tegra_edp_notify_gpu_load(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qux(int, int, int);
void quux(int a1, int a2, int a3) { qux(a1, a2, a3); }


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

x86 assembly (clang, -O2):
<quux>:
jmp    1030 <qux@plt>

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

LLVM IR (-O2):
define void @quux(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @qux(i32 %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int main(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 0, i32* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
ret i32 0
}
int typeNameIsEqual(void *object1, void *object2) { return object1 == object2; }


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

x86 assembly (clang, -O2):
<typeNameIsEqual>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @typeNameIsEqual(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @typeNameIsEqual(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int find(int, int);
int /*<<< orphan*/ printf(char *, int);
main() { printf("%d\n", find(200, 6)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc8,%edi
mov    $0x6,%esi
call   1040 <find@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc8,%edi
mov    $0x6,%esi
call   1040 <find@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @find(i32 200, i32 6)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @find(i32 200, i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void s5pc100_default_sdhci2(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @s5pc100_default_sdhci2() {
ret void
}
double fixed_to_f(long int val, int precision) {
  return val / (1L << precision);
}


x86 assembly (clang, -O0):
<fixed_to_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
cqto
idiv   %rcx
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_to_f>:
mov    %esi,%ecx
mov    $0x1,%esi
shl    %cl,%rsi
mov    %rdi,%rax
mov    %rdi,%rdx
bts    %rcx,%rdx
shr    $0x20,%rdx
je     1125 <fixed_to_f+0x25>
cqto
idiv   %rsi
cvtsi2sd %rax,%xmm0
ret
xor    %edx,%edx
div    %esi
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @fixed_to_f(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = sdiv i64 %5, %8
%10 = sitofp i64 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @fixed_to_f(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl nuw i64 1, %3
%5 = sdiv i64 %0, %4
%6 = sitofp i64 %5 to double
ret double %6
}
void RTMemProtect(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemProtect() {
ret void
}
int scard_verify_pin(struct scard_data *scard, char *pin) { return -1; }


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

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

LLVM IR (-O0):
%struct.scard_data = type opaque
define i32 @scard_verify_pin(%struct.scard_data* %0, i8* %1) {
%3 = alloca %struct.scard_data*
%4 = alloca i8*
store %struct.scard_data* %0, %struct.scard_data** %3
store i8* %1, i8** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.scard_data = type opaque
define i32 @scard_verify_pin(%struct.scard_data* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver32_getbox(int, int, int, int, void *, int);
void __svgalib_driver32_getboxpart(int x, int y, int w, int h, int ow, int oh,
                                   void *b, int xo, int yo) {
  __svgalib_driver32_getbox(x, y, w, h, b + yo * ow * 4 + xo * 4, ow);
}


x86 assembly (clang, -O0):
<__svgalib_driver32_getboxpart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    0x20(%rbp),%eax
imul   -0x14(%rbp),%eax
shl    $0x2,%eax
cltq
add    %rax,%r8
mov    0x18(%rbp),%eax
shl    $0x2,%eax
cltq
add    %rax,%r8
mov    -0x14(%rbp),%r9d
call   1030 <__svgalib_driver32_getbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver32_getboxpart>:
mov    %r8d,%r9d
mov    0x18(%rsp),%eax
imul   %r8d,%eax
shl    $0x2,%eax
movslq %eax,%r10
add    0x8(%rsp),%r10
mov    0x10(%rsp),%eax
shl    $0x2,%eax
movslq %eax,%r8
add    %r10,%r8
jmp    1030 <__svgalib_driver32_getbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver32_getboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i8*, i8** %16
%24 = load i32, i32* %18
%25 = load i32, i32* %14
%26 = mul nsw i32 %24, %25
%27 = mul nsw i32 %26, 4
%28 = sext i32 %27 to i64
%29 = getelementptr i8, i8* %23, i64 %28
%30 = load i32, i32* %17
%31 = mul nsw i32 %30, 4
%32 = sext i32 %31 to i64
%33 = getelementptr i8, i8* %29, i64 %32
%34 = load i32, i32* %14
%35 = call i32 @__svgalib_driver32_getbox(i32 %19, i32 %20, i32 %21, i32 %22, i8* %33, i32 %34)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver32_getboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = shl i32 %4, 2
%11 = mul i32 %10, %8
%12 = sext i32 %11 to i64
%13 = getelementptr i8, i8* %6, i64 %12
%14 = shl nsw i32 %7, 2
%15 = sext i32 %14 to i64
%16 = getelementptr i8, i8* %13, i64 %15
%17 = tail call i32 @__svgalib_driver32_getbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %16, i32 %4)
ret void
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ARG_UNUSED(struct device *);
int shell_run(struct device *dev) {
  ARG_UNUSED(dev);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.device = type { i32 }
define i32 @shell_run(%struct.device* %0) {
%2 = tail call i32 @ARG_UNUSED(%struct.device* %0)
ret i32 0
}
/* Variables and functions */
unsigned int strtoul(char const *, char **, int);
unsigned int atou(const char buf[]) { return strtoul(buf, (char **)NULL, 10); }


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

x86 assembly (clang, -O2):
<atou>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtoul@plt>

LLVM IR (-O0):
define i32 @atou(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtoul(i8* %3, i8** null, i32 10)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atou(i8* nocapture %0) {
%2 = tail call i32 @strtoul(i8* nocapture %0, i8** null, i32 10)
ret i32 %2
}
unsigned int tune8(unsigned int t) {
  return ((t * ("36364689"[t >> 13 & 7] & 15)) / 12 & 128) +
         ((((((t >> 12) ^ (t >> 12)) - 2) % 11 * t) / 4 | t >> 13) & 127);
}


x86 assembly (clang, -O0):
<tune8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0xd,%ecx
and    $0x7,%ecx
mov    %ecx,%ecx
mov    %ecx,%edx
lea    0xee2(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
and    $0xf,%ecx
imul   %ecx,%eax
mov    $0xc,%ecx
xor    %edx,%edx
div    %ecx
and    $0x80,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xc,%eax
mov    -0x4(%rbp),%ecx
shr    $0xc,%ecx
xor    %ecx,%eax
sub    $0x2,%eax
mov    $0xb,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x8(%rbp),%eax
mov    %edx,%ecx
imul   -0x4(%rbp),%ecx
shr    $0x2,%ecx
mov    -0x4(%rbp),%edx
shr    $0xd,%edx
or     %edx,%ecx
and    $0x7f,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tune8>:
mov    %edi,%eax
shr    $0xd,%eax
mov    %eax,%ecx
and    $0x7,%ecx
lea    0xeef(%rip),%rdx
movzbl (%rcx,%rdx,1),%ecx
and    $0xf,%ecx
imul   %edi,%ecx
mov    $0xaaaaaaab,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
and    $0x80,%edx
shr    %edi
or     %edi,%eax
and    $0x7f,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"36364689\00"
define i32 @tune8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 13
%6 = and i32 %5, 7
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [9 x i8], [9 x i8]* @.str, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = and i32 %10, 15
%12 = mul i32 %3, %11
%13 = udiv i32 %12, 12
%14 = and i32 %13, 128
%15 = load i32, i32* %2
%16 = lshr i32 %15, 12
%17 = load i32, i32* %2
%18 = lshr i32 %17, 12
%19 = xor i32 %16, %18
%20 = sub i32 %19, 2
%21 = urem i32 %20, 11
%22 = load i32, i32* %2
%23 = mul i32 %21, %22
%24 = udiv i32 %23, 4
%25 = load i32, i32* %2
%26 = lshr i32 %25, 13
%27 = or i32 %24, %26
%28 = and i32 %27, 127
%29 = add i32 %14, %28
ret i32 %29
}

LLVM IR (-O2):
@.str = [9 x i8] c"36364689\00"
define i32 @tune8(i32 %0) {
%2 = lshr i32 %0, 13
%3 = and i32 %2, 7
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [9 x i8], [9 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = and i8 %6, 15
%8 = zext i8 %7 to i32
%9 = mul i32 %8, %0
%10 = udiv i32 %9, 12
%11 = and i32 %10, 128
%12 = lshr i32 %0, 1
%13 = or i32 %12, %2
%14 = and i32 %13, 127
%15 = or i32 %11, %14
ret i32 %15
}
void ADC1Seq2_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<ADC1Seq2_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <ADC1Seq2_Handler+0x9>
jmp    1109 <ADC1Seq2_Handler+0x9>

x86 assembly (clang, -O2):
<ADC1Seq2_Handler>:
jmp    1100 <ADC1Seq2_Handler>

LLVM IR (-O0):
define void @ADC1Seq2_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @ADC1Seq2_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int litend(void) {
  int i = 0;
  ((char *)(&i))[0] = 1;
  return (i == 1);
}


x86 assembly (clang, -O0):
<litend>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @litend() {
%1 = alloca i32
store i32 0, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 0
store i8 1, i8* %3
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @litend() {
ret i32 1
}
int f_ne_rm1(float a1, float *a2) { return (((a1) != (*a2))); }


x86 assembly (clang, -O0):
<f_ne_rm1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ne_rm1>:
cmpneqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_ne_rm1(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 = load float, float* %6
%8 = fcmp une float %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_ne_rm1(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp une float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void glVertexAttribI4ui(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttribI4ui() {
ret void
}
void test__gai_connect(void) {}


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

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

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

LLVM IR (-O2):
define void @test__gai_connect() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bitswap32(uint32_t x) {
  return ((x << 24) & 0xff000000) | ((x << 8) & 0x00ff0000) |
         ((x << 8) & 0x0000ff00) | ((x << 24) & 0x000000ff);
}


x86 assembly (clang, -O0):
<bitswap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitswap32>:
movzwl %di,%ecx
shl    $0x8,%edi
bswap  %ecx
movzwl %di,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bitswap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = and i32 %4, -16777216
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = and i32 %7, 16711680
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = shl i32 %10, 8
%12 = and i32 %11, 65280
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = shl i32 %14, 24
%16 = and i32 %15, 255
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @bitswap32(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %0, 65535
%4 = tail call i32 @llvm.bswap.i32(i32 %3)
%5 = and i32 %2, 65280
%6 = or i32 %4, %5
ret i32 %6
}
normal(int a) {}


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

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

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

LLVM IR (-O2):
define i32 @normal(i32 %0) {
ret i32 undef
}
void delay(int x) {
  int i;
  int count;
  for (i = 0; i < x; i++) {
    count++;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1131 <delay+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ INADDR_NONE;
scalar_t__ __inet_aton(char const *, struct in_addr *);
in_addr_t inet_addr(const char *cp) {
  struct in_addr val;
  if (__inet_aton(cp, &val))
    return (val.s_addr);
  return (INADDR_NONE);
}


x86 assembly (clang, -O0):
<inet_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <__inet_aton@plt>
cmp    $0x0,%rax
je     113e <inet_addr+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <inet_addr+0x3a>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_addr>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <__inet_aton@plt>
test   %rax,%rax
jne    112e <inet_addr+0x1e>
mov    0x2eba(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i64 @__inet_aton(i8* %0, %struct.in_addr* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @INADDR_NONE
%9 = select i1 %5, i32 %8, i32 %7
ret i32 %9
}
const char *c4_get_version(void) {
  return "$Id: c4.c,v 3.7 2000/05/19 16:49:46 pomakis Exp pomakis $";
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"$Id: c4.c,v 3.7 2000/05/19 16:49:46 pomakis Exp pomakis $\00"
define i8* @c4_get_version() {
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [58 x i8] c"$Id: c4.c,v 3.7 2000/05/19 16:49:46 pomakis Exp pomakis $\00"
define i8* @c4_get_version() {
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0)
}
float test_erfcf(float x) { return __builtin_erfcf(x); }


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

x86 assembly (clang, -O2):
<test_erfcf>:
jmp    1030 <erfcf@plt>

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

LLVM IR (-O2):
define float @test_erfcf(float %0) {
%2 = tail call float @erfcf(float %0)
ret float %2
}
min(a, b) char *a, *b;
{
  if (a < b)
    return (a);
  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
jae    1126 <min+0x26>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    112d <min+0x2d>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
%4 = select i1 %3, i8* %0, i8* %1
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
ret i32 %6
}