xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x9b() {
  Assert_real((isalnum(155) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              780, ("isalnum should be 0 for 0x9b"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x9b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9b,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x30c,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x9b>:
push   %rax
mov    $0x9b,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x30c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x9b\00"
define void @t_isalnum_0x9b() {
%1 = call i64 @isalnum(i32 155)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x9b\00"
define void @t_isalnum_0x9b() {
%1 = tail call i64 @isalnum(i32 155)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr,
          " ---------------------------------------------------------------\n"
          " Help for output plugin..: "
          "RTSP output plugin"
          "\n"
          " ---------------------------------------------------------------\n"
          " The following parameters can be passed to this plugin:\n\n"
          " [-p | --port ]..........: UDP port to listen for picture requests. "
          "UDP message is the filename to save\n\n"
          " [-i | --input ].......: read frames from the specified input "
          "plugin (first input plugin between the arguments is the 0th)\n\n"
          " ---------------------------------------------------------------\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [528 x i8] c" ---------------------------------------------------------------\0A Help for output plugin..: RTSP output plugin\0A ---------------------------------------------------------------\0A The following parameters can be passed to this plugin:\0A\0A [-p | --port ]..........: UDP port to listen for picture requests. UDP message is the filename to save\0A\0A [-i | --input ].......: read frames from the specified input plugin (first input plugin between the arguments is the 0th)\0A\0A ---------------------------------------------------------------\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([528 x i8], [528 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [528 x i8] c" ---------------------------------------------------------------\0A Help for output plugin..: RTSP output plugin\0A ---------------------------------------------------------------\0A The following parameters can be passed to this plugin:\0A\0A [-p | --port ]..........: UDP port to listen for picture requests. UDP message is the filename to save\0A\0A [-i | --input ].......: read frames from the specified input plugin (first input plugin between the arguments is the 0th)\0A\0A ---------------------------------------------------------------\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([528 x i8], [528 x i8]* @.str, i64 0, i64 0))
ret void
}
int dceil(double n) { return dceil(n) + 1; }


x86 assembly (clang, -O0):
<dceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <dceil@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @dceil(double %3)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @dceil(double %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
char *lst2fd(string)
char *string;
{
  double sdj, dj;
  sdj = fd2jd(string);
  dj = lst2jd(sdj);
  return (jd2fd(dj));
}


x86 assembly (clang, -O0):
<lst2fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1050 <lst2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2fd@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lst2fd>:
push   %rax
xor    %eax,%eax
call   1030 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1050 <lst2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1040 <jd2fd@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @lst2fd(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %5)
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 (double, ...) bitcast (i32 (...)* @lst2jd to i32 (double, ...)*)(double %8)
%10 = sitofp i32 %9 to double
store double %10, double* %4
%11 = load double, double* %4
%12 = call i32 (double, ...) bitcast (i32 (...)* @jd2fd to i32 (double, ...)*)(double %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
define i8* @lst2fd(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @lst2jd to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2fd to i32 (double, ...)*)(double %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Variables and functions */
double asin(double);
double Dasin(double x) { return asin(x); }


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

x86 assembly (clang, -O2):
<Dasin>:
jmp    1030 <asin@plt>

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

LLVM IR (-O2):
define double @Dasin(double %0) {
%2 = tail call double @asin(double %0)
ret double %2
}
/* Variables and functions */
int uart0_getc();
int cc3_uart0_getchar(void) { return uart0_getc(); }


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

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

LLVM IR (-O0):
define i32 @cc3_uart0_getchar() {
%1 = call i32 (...) @uart0_getc()
ret i32 %1
}

LLVM IR (-O2):
define i32 @cc3_uart0_getchar() {
%1 = tail call i32 (...) @uart0_getc()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f(int);
main() {
  if (f(3) != sizeof(short) * 2 * 3 * 3)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <f@plt>
cltq
cmp    $0x24,%rax
je     114c <main+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <f@plt>
cmp    $0x24,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 3)
%3 = sext i32 %2 to i64
%4 = icmp ne i64 %3, 36
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 3)
%2 = icmp eq i32 %1, 36
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void posix_class_neg2NP_PUNCT() {}


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

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

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

LLVM IR (-O2):
define void @posix_class_neg2NP_PUNCT() {
ret void
}
int lib_div(const int a, const int b) { return a / b; }


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

x86 assembly (clang, -O2):
<lib_div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @lib_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void error(char *msg, char *arg) {
  fprintf(stderr, msg, arg);
  fprintf(stderr, "\n");
  exit(EX_SOFTWARE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2eb2(%rip),%rbx
mov    (%rbx),%edi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@EX_SOFTWARE = global i32 0
define void @error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* %0, i8* %1)
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EX_SOFTWARE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
void test22() {
  if ("help")
    (void)0;
  if (test22)
    (void)0;
}


x86 assembly (clang, -O0):
<test22>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
test   $0x1,%al
jne    1113 <test22+0x13>
jmp    1118 <test22+0x18>
jmp    1118 <test22+0x18>
mov    $0x1,%al
test   $0x1,%al
jne    1127 <test22+0x27>
jmp    112c <test22+0x2c>
jmp    112c <test22+0x2c>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"help\00"
define void @test22() {
br i1 true, label %1, label %2
1: ; preds = %0
br label %2
2: ; preds = %1, %0
br i1 true, label %3, label %4
3: ; preds = %2
br label %4
4: ; preds = %3, %2
ret void
}

LLVM IR (-O2):
define void @test22() {
ret void
}
int approx(int a, int b) {
  int diff = (a > b) ? (a - b) : (b - a);
  return ((float)diff / (float)b) < 0.04;
}


x86 assembly (clang, -O0):
<approx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <approx+0x24>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112d <approx+0x2d>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb3(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<approx>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovle %eax,%edi
cvtsi2ss %edi,%xmm0
cvtsi2ss %esi,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedd(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @approx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
br label %17
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %13, %9
%18 = phi i32 [ %12, %9 ], [ %16, %13 ]
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = sitofp i32 %19 to float
%21 = load i32, i32* %4
%22 = sitofp i32 %21 to float
%23 = fdiv float %20, %22
%24 = fpext float %23 to double
%25 = fcmp olt double %24, 4.000000e-02
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @approx(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub nsw i32 %0, %1
%5 = sub nsw i32 %1, %0
%6 = select i1 %3, i32 %4, i32 %5
%7 = sitofp i32 %6 to float
%8 = sitofp i32 %1 to float
%9 = fdiv float %7, %8
%10 = fpext float %9 to double
%11 = fcmp olt double %10, 4.000000e-02
%12 = zext i1 %11 to i32
ret i32 %12
}
void INT_Excep_SCI1_ERI1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI1_ERI1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndexedIndirectE0(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op81E0M1(void) { STA8(DirectIndexedIndirectE0(2)); }


x86 assembly (clang, -O0):
<Op81E0M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <DirectIndexedIndirectE0@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op81E0M1>:
push   %rax
mov    $0x2,%edi
call   1030 <DirectIndexedIndirectE0@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op81E0M1() {
%1 = call i32 @DirectIndexedIndirectE0(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op81E0M1() {
%1 = tail call i32 @DirectIndexedIndirectE0(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Type definitions */
struct vec4i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4i_zero(int /*<<< orphan*/ *);
__attribute__((always_)) struct vec4i *psvec4i_zero(struct vec4i *result) {
  vec4i_zero((int32_t *)result);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec4i_zero>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4i_zero@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_zero(%struct.vec4i* %0) {
%2 = alloca %struct.vec4i*
store %struct.vec4i* %0, %struct.vec4i** %2
%3 = load %struct.vec4i*, %struct.vec4i** %2
%4 = bitcast %struct.vec4i* %3 to i32*
%5 = call i32 @vec4i_zero(i32* %4)
%6 = load %struct.vec4i*, %struct.vec4i** %2
ret %struct.vec4i* %6
}

LLVM IR (-O2):
%struct.vec4i = type { i32 }
define %struct.vec4i* @psvec4i_zero(%struct.vec4i* returned %0) {
%2 = getelementptr %struct.vec4i, %struct.vec4i* %0, i64 0, i32 0
%3 = tail call i32 @vec4i_zero(i32* %2)
ret %struct.vec4i* %0
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *);
int print_line(const char *begin, const char *end) {
  if (begin > end) {
    print_error("memory address wrong");
    return 1;
  }
  int len;
  char str[25];
  return 1;
}


x86 assembly (clang, -O0):
<print_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1146 <print_line+0x36>
lea    0xecb(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x1,-0x4(%rbp)
jmp    114d <print_line+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line>:
cmp    %rsi,%rdi
jbe    1126 <print_line+0x16>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <print_error@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"memory address wrong\00"
define i32 @print_line(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [25 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = icmp ugt i8* %8, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @print_error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [21 x i8] c"memory address wrong\00"
define i32 @print_line(i8* readnone %0, i8* readnone %1) {
%3 = icmp ugt i8* %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @print_error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %2, %4
ret i32 1
}
int is_nan(float x) {
  float var = x;
  return (var != var) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_nan>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
setp   %sil
setne  %dl
or     %sil,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_nan>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @is_nan(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
store float %4, float* %3
%5 = load float, float* %3
%6 = load float, float* %3
%7 = fcmp une float %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_nan(float %0) {
%2 = fcmp uno float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void RTFileSetSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileSetSize() {
ret void
}
void NCONF_get_number_e(void) {}


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

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

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

LLVM IR (-O2):
define void @NCONF_get_number_e() {
ret void
}
long math_div(long a, long b) { return a / b - (a % b < 0); }


x86 assembly (clang, -O0):
<math_div>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    -0x18(%rbp),%rax
cmp    $0x0,%rdx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_div>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <math_div+0x16>
cqto
idiv   %rsi
jmp    111a <math_div+0x1a>
xor    %edx,%edx
div    %esi
sar    $0x3f,%rdx
add    %rax,%rdx
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @math_div(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sdiv i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = srem i64 %8, %9
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
%13 = sext i32 %12 to i64
%14 = sub nsw i64 %7, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @math_div(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = ashr i64 %4, 63
%6 = add i64 %5, %3
ret i64 %6
}
float abs_v(float x) {
  if (x < 0) {
    x = -x;
  }
  return x;
}


x86 assembly (clang, -O0):
<abs_v>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <abs_v+0x2d>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_v>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @abs_v(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
store float %7, float* %2
br label %8
8: ; preds = %5, %1
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @abs_v(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
int authenticate(const char *password) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @authenticate(i8* nocapture readnone %0) {
ret i32 1
}
float smnormtv(float sample_rate, float t) { return t * sample_rate; }


x86 assembly (clang, -O0):
<smnormtv>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<smnormtv>:
mulss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @smnormtv(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
extern unsigned short rbits16(unsigned short w) {
  w = ((w >> 1) & 0x5555) | ((w << 1) & 0xaaaa);
  w = ((w >> 2) & 0x3333) | ((w << 2) & 0xcccc);
  w = ((w >> 4) & 0x0f0f) | ((w << 4) & 0xf0f0);
  w = ((w >> 8) & 0x00ff) | ((w << 8) & 0xff00);
  return w;
}


x86 assembly (clang, -O0):
<rbits16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
and    $0x5555,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x1,%ecx
and    $0xaaaa,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x2,%eax
and    $0x3333,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x2,%ecx
and    $0xcccc,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x4,%eax
and    $0xf0f,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x4,%ecx
and    $0xf0f0,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbits16>:
rol    $0x8,%di
mov    %edi,%eax
and    $0xf0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x5555,%ecx
shr    %eax
and    $0x5555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define zeroext i16 @rbits16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 1
%6 = and i32 %5, 21845
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = shl i32 %8, 1
%10 = and i32 %9, 43690
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %2
%13 = load i16, i16* %2
%14 = zext i16 %13 to i32
%15 = ashr i32 %14, 2
%16 = and i32 %15, 13107
%17 = load i16, i16* %2
%18 = zext i16 %17 to i32
%19 = shl i32 %18, 2
%20 = and i32 %19, 52428
%21 = or i32 %16, %20
%22 = trunc i32 %21 to i16
store i16 %22, i16* %2
%23 = load i16, i16* %2
%24 = zext i16 %23 to i32
%25 = ashr i32 %24, 4
%26 = and i32 %25, 3855
%27 = load i16, i16* %2
%28 = zext i16 %27 to i32
%29 = shl i32 %28, 4
%30 = and i32 %29, 61680
%31 = or i32 %26, %30
%32 = trunc i32 %31 to i16
store i16 %32, i16* %2
%33 = load i16, i16* %2
%34 = zext i16 %33 to i32
%35 = ashr i32 %34, 8
%36 = and i32 %35, 255
%37 = load i16, i16* %2
%38 = zext i16 %37 to i32
%39 = shl i32 %38, 8
%40 = and i32 %39, 65280
%41 = or i32 %36, %40
%42 = trunc i32 %41 to i16
store i16 %42, i16* %2
%43 = load i16, i16* %2
ret i16 %43
}

LLVM IR (-O2):
define zeroext i16 @rbits16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bitreverse.i16(i16 %0)
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m512i;

/* Variables and functions */
int _mm512_cvtsi512_si32(int /*<<< orphan*/);
int test_mm512_cvtsi512_si32(__m512i a) { return _mm512_cvtsi512_si32(a); }


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

x86 assembly (clang, -O2):
<test_mm512_cvtsi512_si32>:
jmp    1030 <_mm512_cvtsi512_si32@plt>

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

LLVM IR (-O2):
define i32 @test_mm512_cvtsi512_si32(i32 %0) {
%2 = tail call i32 @_mm512_cvtsi512_si32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int f1(int);
void f2() {
  int x;
  x = f1(1);
}


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

x86 assembly (clang, -O2):
<f2>:
mov    $0x1,%edi
jmp    1030 <f1@plt>

LLVM IR (-O0):
define void @f2() {
%1 = alloca i32
%2 = call i32 @f1(i32 1)
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32 @f1(i32 1)
ret void
}
void myfunction2(int fruit[][3][5]) {}


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

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

LLVM IR (-O0):
define void @myfunction2([3 x [5 x i32]]* %0) {
%2 = alloca [3 x [5 x i32]]*
store [3 x [5 x i32]]* %0, [3 x [5 x i32]]** %2
ret void
}

LLVM IR (-O2):
define void @myfunction2([3 x [5 x i32]]* nocapture %0) {
ret void
}
/* Variables and functions */
double log(double);
double log2(double x) { return (log(x) * ((double)1.44269504088906)); }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = fmul double %4, 0x3FF71547652B84B1
ret double %5
}

LLVM IR (-O2):
define double @log2(double %0) {
%2 = tail call double @log(double %0)
%3 = fmul double %2, 0x3FF71547652B84B1
ret double %3
}
/* Variables and functions */
void *lwalloc_var(size_t);
void *lwalloc(size_t size) {
  void *mem = lwalloc_var(size);
  ((void)0);
  return mem;
}


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

x86 assembly (clang, -O2):
<lwalloc>:
jmp    1030 <lwalloc_var@plt>

LLVM IR (-O0):
define i8* @lwalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @lwalloc_var(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @lwalloc(i64 %0) {
%2 = tail call i8* @lwalloc_var(i64 %0)
ret i8* %2
}
void mc_user_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @mc_user_exit() {
ret void
}
void abcdefghi() {}


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

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

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

LLVM IR (-O2):
define void @abcdefghi() {
ret void
}
/* Variables and functions */
int Convert(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Usage: %s infile\n", argv[0]);
    return 0;
  }
  return Convert(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <Convert@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1139 <main+0x19>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1030 <Convert@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s infile\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @Convert(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
double f6(double x) { return 2 * x * x * x + 4 * x - 1; }


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xee0(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xee8(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f6(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 2.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fmul double 4.000000e+00, %8
%10 = call double @llvm.fmuladd.f64(double %6, double %7, double %9)
%11 = fsub double %10, 1.000000e+00
ret double %11
}

LLVM IR (-O2):
define double @f6(double %0) {
%2 = fmul double %0, 2.000000e+00
%3 = fmul double %2, %0
%4 = fmul double %0, 4.000000e+00
%5 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %4)
%6 = fadd double %5, -1.000000e+00
ret double %6
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lobject *lobject_method_call(struct lemon *, struct lobject *, int, int,
                                    struct lobject **);
struct lobject *lobject_binop(struct lemon *lemon, int method,
                              struct lobject *a, struct lobject *b) {
  struct lobject *argv[1];
  argv[0] = b;
  return lobject_method_call(lemon, a, method, 1, argv);
}


x86 assembly (clang, -O0):
<lobject_binop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    -0x28(%rbp),%r8
mov    $0x1,%ecx
call   1030 <lobject_method_call@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lobject_binop>:
push   %rax
mov    %esi,%eax
mov    %rcx,(%rsp)
mov    %rsp,%r8
mov    %rdx,%rsi
mov    %eax,%edx
mov    $0x1,%ecx
call   1030 <lobject_method_call@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_binop(%struct.lemon* %0, i32 %1, %struct.lobject* %2, %struct.lobject* %3) {
%5 = alloca %struct.lemon*
%6 = alloca i32
%7 = alloca %struct.lobject*
%8 = alloca %struct.lobject*
%9 = alloca [1 x %struct.lobject*]
store %struct.lemon* %0, %struct.lemon** %5
store i32 %1, i32* %6
store %struct.lobject* %2, %struct.lobject** %7
store %struct.lobject* %3, %struct.lobject** %8
%10 = load %struct.lobject*, %struct.lobject** %8
%11 = getelementptr inbounds [1 x %struct.lobject*], [1 x %struct.lobject*]* %9, i64 0, i64 0
store %struct.lobject* %10, %struct.lobject** %11
%12 = load %struct.lemon*, %struct.lemon** %5
%13 = load %struct.lobject*, %struct.lobject** %7
%14 = load i32, i32* %6
%15 = getelementptr inbounds [1 x %struct.lobject*], [1 x %struct.lobject*]* %9, i64 0, i64 0
%16 = call %struct.lobject* @lobject_method_call(%struct.lemon* %12, %struct.lobject* %13, i32 %14, i32 1, %struct.lobject** %15)
ret %struct.lobject* %16
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_binop(%struct.lemon* %0, i32 %1, %struct.lobject* %2, %struct.lobject* %3) {
%5 = alloca [1 x %struct.lobject*]
%6 = bitcast [1 x %struct.lobject*]* %5 to i8*
%7 = getelementptr inbounds [1 x %struct.lobject*], [1 x %struct.lobject*]* %5, i64 0, i64 0
store %struct.lobject* %3, %struct.lobject** %7
%8 = call %struct.lobject* @lobject_method_call(%struct.lemon* %0, %struct.lobject* %2, i32 %1, i32 1, %struct.lobject** %7)
ret %struct.lobject* %8
}
int fun183() { return 183; }


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

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

LLVM IR (-O0):
define i32 @fun183() {
ret i32 183
}

LLVM IR (-O2):
define i32 @fun183() {
ret i32 183
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_userdata_describe2(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_userdata_describe2() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_userdata_describe2() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ grow(int);
int main(int argc, char *argv[]) {
  grow(1);
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @grow(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @grow(i32 1)
ret i32 0
}
/* Variables and functions */
int preced(int);
int precedGEQ(int lfttok, int rhttok) {
  int pl = preced(lfttok);
  int pr = preced(rhttok);
  if (pl == 3 && pr >= 3)
    pl = 0;
  if (pl == 2 && pr >= 2)
    pl = 0;
  return pl >= pr;
}


x86 assembly (clang, -O0):
<precedGEQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <preced@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <preced@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    114f <precedGEQ+0x3f>
cmpl   $0x3,-0x10(%rbp)
jl     114f <precedGEQ+0x3f>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    116a <precedGEQ+0x5a>
cmpl   $0x2,-0x10(%rbp)
jl     116a <precedGEQ+0x5a>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedGEQ>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <preced@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <preced@plt>
xor    %edx,%edx
cmp    $0x3,%eax
mov    %ebp,%ecx
cmovge %edx,%ecx
cmp    $0x3,%ebp
cmovne %ebp,%ecx
cmp    $0x2,%eax
cmovl  %ecx,%edx
cmp    $0x2,%ecx
cmovne %ecx,%edx
xor    %ecx,%ecx
cmp    %eax,%edx
setge  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @precedGEQ(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 @preced(i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @preced(i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 3
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* %6
%15 = icmp sge i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 0, i32* %5
br label %17
17: ; preds = %16, %13, %2
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %6
%22 = icmp sge i32 %21, 2
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 0, i32* %5
br label %24
24: ; preds = %23, %20, %17
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = icmp sge i32 %25, %26
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @precedGEQ(i32 %0, i32 %1) {
%3 = tail call i32 @preced(i32 %0)
%4 = tail call i32 @preced(i32 %1)
%5 = icmp eq i32 %3, 3
%6 = icmp sgt i32 %4, 2
%7 = select i1 %5, i1 %6, i1 false
%8 = select i1 %7, i32 0, i32 %3
%9 = icmp eq i32 %8, 2
%10 = icmp sgt i32 %4, 1
%11 = select i1 %9, i1 %10, i1 false
%12 = select i1 %11, i32 0, i32 %8
%13 = icmp sge i32 %12, %4
%14 = zext i1 %13 to i32
ret i32 %14
}
void run_hooks(void (*const list[])(void)) {
  while (*++list)
    (**list)();
}


x86 assembly (clang, -O0):
<run_hooks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,0x8(%rax)
je     1131 <run_hooks+0x31>
mov    -0x8(%rbp),%rax
call   *(%rax)
jmp    110c <run_hooks+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_hooks>:
push   %rbx
mov    0x8(%rdi),%rax
test   %rax,%rax
je     112e <run_hooks+0x2e>
mov    %rdi,%rbx
add    $0x10,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   *%rax
mov    (%rbx),%rax
add    $0x8,%rbx
test   %rax,%rax
jne    1120 <run_hooks+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @run_hooks(void ()** nocapture %0) {
%2 = getelementptr inbounds void ()*, void ()** %0, i64 1
%3 = load void ()*, void ()** %2
%4 = icmp eq void ()* %3, null
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi void ()* [ %9, %5 ], [ %3, %1 ]
%7 = phi void ()** [ %8, %5 ], [ %2, %1 ]
tail call void %6()
%8 = getelementptr inbounds void ()*, void ()** %7, i64 1
%9 = load void ()*, void ()** %8
%10 = icmp eq void ()* %9, null
br i1 %10, label %11, label %5
11: ; preds = %5, %1
ret void
}
int test_imm_44uint8_mem(unsigned char *val) {
  return ((*val) & (0x44 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_44uint8_mem>:
testb  $0x44,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_44uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 68
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float test2(float x) { return x + 2; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
addss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @test2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 2.000000e+00
ret float %4
}

LLVM IR (-O2):
define float @test2(float %0) {
%2 = fadd float %0, 2.000000e+00
ret float %2
}
void setCode(unsigned char *packet, unsigned int code) {
  packet[7] = (code >> 12) & 0xff;
  packet[8] = (code >> 4) & 0xff;
  packet[9] &= 0xf;
  ;
  packet[9] |= ((code)&0xf) << 4;
}


x86 assembly (clang, -O0):
<setCode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xc,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0xc(%rbp),%eax
shr    $0x4,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x8(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x9(%rax),%ecx
and    $0xf,%ecx
mov    %cl,0x9(%rax)
mov    -0xc(%rbp),%edx
and    $0xf,%edx
shl    $0x4,%edx
mov    -0x8(%rbp),%rax
movzbl 0x9(%rax),%ecx
or     %edx,%ecx
mov    %cl,0x9(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCode>:
mov    %esi,%eax
shr    $0xc,%eax
mov    %al,0x7(%rdi)
mov    %esi,%eax
shr    $0x4,%eax
mov    %al,0x8(%rdi)
mov    0x9(%rdi),%al
and    $0xf,%al
shl    $0x4,%sil
or     %al,%sil
mov    %sil,0x9(%rdi)
ret

LLVM IR (-O0):
define void @setCode(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 = lshr i32 %5, 12
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 7
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 4
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 8
store i8 %14, i8* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 9
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %20, 15
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
%23 = load i32, i32* %4
%24 = and i32 %23, 15
%25 = shl i32 %24, 4
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 9
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = or i32 %29, %25
%31 = trunc i32 %30 to i8
store i8 %31, i8* %27
ret void
}

LLVM IR (-O2):
define void @setCode(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 12
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %4, i8* %5
%6 = lshr i32 %1, 4
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 9
%10 = load i8, i8* %9
%11 = and i8 %10, 15
%12 = trunc i32 %1 to i8
%13 = shl i8 %12, 4
%14 = or i8 %11, %13
store i8 %14, i8* %9
ret void
}