xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: gpgenmult [-op d/s] [-silent] [-v] [-l/-h] [-c] "
                  "[-mwd maxwdiffs]\n");
  fprintf(stderr, "\t\t [-m maxeqns] [-ns] [-f] groupname.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xf00(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [73 x i8] c"Usage: gpgenmult [-op d/s] [-silent] [-v] [-l/-h] [-c] [-mwd maxwdiffs]\0A\00"
@.str.1 = [39 x i8] c"\09\09 [-m maxeqns] [-ns] [-f] groupname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [73 x i8] c"Usage: gpgenmult [-op d/s] [-silent] [-v] [-l/-h] [-c] [-mwd maxwdiffs]\0A\00"
@.str.1 = [39 x i8] c"\09\09 [-m maxeqns] [-ns] [-f] groupname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float sin(float);
float f_sin(float x) { return sin(x); }


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

x86 assembly (clang, -O2):
<f_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define float @f_sin(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x2c() {
  Assert_real((isalpha(44) == 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_isalpha.c",
              225, ("isalpha should be 0 for ,"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x2c>:
push   %rax
mov    $0x2c,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xe1,%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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for ,\00"
define void @t_isalpha_0x2c() {
%1 = call i64 @isalpha(i32 44)
%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 225, i8* getelementptr inbounds ([26 x i8], [26 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for ,\00"
define void @t_isalpha_0x2c() {
%1 = tail call i64 @isalpha(i32 44)
%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 225, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen2(char const *);
char *strndup2(char const *, int /*<<< orphan*/);
char *strdup2(const char *str) { return strndup2(str, strlen2(str)); }


x86 assembly (clang, -O0):
<strdup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen2@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <strndup2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup2>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen2@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <strndup2@plt>

LLVM IR (-O0):
define i8* @strdup2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen2(i8* %4)
%6 = call i8* @strndup2(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @strdup2(i8* %0) {
%2 = tail call i32 @strlen2(i8* %0)
%3 = tail call i8* @strndup2(i8* %0, i32 %2)
ret i8* %3
}
void out_dec2(fmt, n1, n2) const char fmt[];
int n1, n2;
{
  printf(fmt, n1, n2);
  out_line_count(fmt);
}


x86 assembly (clang, -O0):
<out_dec2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <out_line_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_dec2>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <out_line_count@plt>

LLVM IR (-O0):
define void @out_dec2(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* %7, i32 %8, i32 %9)
%11 = load i8*, i8** %4
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %11)
ret void
}

LLVM IR (-O2):
define void @out_dec2(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 %1, i32 %2)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *hello(void *arg) {
  printf("Hello Thread\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<hello>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello Thread\00"
define noalias i8* @hello(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i8* null
}
void do_mkdir(dirname) char *dirname;
{
  if (mkdir(dirname, 0777) == -1)
    perror(dirname);
}


x86 assembly (clang, -O0):
<do_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1ff,%esi
mov    $0x0,%al
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    1150 <do_mkdir+0x30>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mkdir>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1ff,%esi
xor    %eax,%eax
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
je     1137 <do_mkdir+0x17>
pop    %rbx
ret
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <perror@plt>

LLVM IR (-O0):
define void @do_mkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mkdir to i32 (i8*, i32, ...)*)(i8* %3, i32 511)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @do_mkdir(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mkdir to i32 (i8*, i32, ...)*)(i8* %0, i32 511)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int);
void DoLessEqual(void) { InlineWords(2, 23, 44); }


x86 assembly (clang, -O0):
<DoLessEqual>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x17,%esi
mov    $0x2c,%edx
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoLessEqual>:
mov    $0x2,%edi
mov    $0x17,%esi
mov    $0x2c,%edx
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoLessEqual() {
%1 = call i32 @InlineWords(i32 2, i32 23, i32 44)
ret void
}

LLVM IR (-O2):
define void @DoLessEqual() {
%1 = tail call i32 @InlineWords(i32 2, i32 23, i32 44)
ret void
}
unsigned la_version(unsigned version) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @la_version(i32 %0) {
ret i32 1
}
/* Variables and functions */
float Eval(int);
double fabs(float);
int /*<<< orphan*/ log_fail();
int /*<<< orphan*/ log_pass();
int main() {
  float val = Eval(10);
  if (((fabs(val - 45.437302) < 0.0001) ? 1 : 0))
    log_pass();
  else
    log_fail();
  return -1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <Eval@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe99(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xe79(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a0 <main+0x60>
mov    $0x1,%al
test   $0x1,%al
jne    11af <main+0x6f>
jmp    11bb <main+0x7b>
xor    %eax,%eax
test   $0x1,%al
jne    11af <main+0x6f>
jmp    11bb <main+0x7b>
mov    $0x0,%al
call   1030 <log_pass@plt>
jmp    11c2 <main+0x82>
mov    $0x0,%al
call   1060 <log_fail@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1050 <Eval@plt>
cvtss2sd %xmm0,%xmm0
addsd  0xea9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <fabs@plt>
movsd  0xea0(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
jbe    1177 <main+0x37>
call   1030 <log_pass@plt>
jmp    117c <main+0x3c>
call   1060 <log_fail@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float @Eval(i32 10)
store float %3, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fsub double %5, 0x4046B7F9830E3CDA
%7 = fptrunc double %6 to float
%8 = call double @fabs(float %7)
%9 = fcmp olt double %8, 1.000000e-04
br i1 %9, label %10, label %11
10: ; preds = %0
br i1 true, label %12, label %14
11: ; preds = %0
br i1 false, label %12, label %14
12: ; preds = %11, %10
%13 = call i32 (...) @log_pass()
br label %16
14: ; preds = %11, %10
%15 = call i32 (...) @log_fail()
br label %16
16: ; preds = %14, %12
ret i32 -1
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float @Eval(i32 10)
%2 = fpext float %1 to double
%3 = fadd double %2, 0xC046B7F9830E3CDA
%4 = fptrunc double %3 to float
%5 = tail call double @fabs(float %4)
%6 = fcmp olt double %5, 1.000000e-04
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 (...) @log_pass()
br label %11
9: ; preds = %0
%10 = tail call i32 (...) @log_fail()
br label %11
11: ; preds = %9, %7
ret i32 -1
}
double cubicEaseInOutd(double p) {
  if (p < 0.5) {
    return 4 * p * p * p;
  } else {
    double f = ((2 * p) - 2);
    return 0.5 * f * f * f + 1;
  }
}


x86 assembly (clang, -O0):
<cubicEaseInOutd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <cubicEaseInOutd+0x3d>
movsd  0xef4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <cubicEaseInOutd+0x83>
movsd  -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xec2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubicEaseInOutd>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1127 <cubicEaseInOutd+0x27>
movsd  0xf02(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
addsd  %xmm0,%xmm0
addsd  0xed5(%rip),%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xec1(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cubicEaseInOutd(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, 5.000000e-01
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fmul double 4.000000e+00, %8
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = load double, double* %3
%13 = fmul double %11, %12
store double %13, double* %2
br label %23
14: ; preds = %1
%15 = load double, double* %3
%16 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %15, double -2.000000e+00)
store double %16, double* %4
%17 = load double, double* %4
%18 = fmul double 5.000000e-01, %17
%19 = load double, double* %4
%20 = fmul double %18, %19
%21 = load double, double* %4
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double 1.000000e+00)
store double %22, double* %2
br label %23
23: ; preds = %14, %7
%24 = load double, double* %2
ret double %24
}

LLVM IR (-O2):
define double @cubicEaseInOutd(double %0) {
%2 = fcmp olt double %0, 5.000000e-01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fmul double %0, 4.000000e+00
%5 = fmul double %4, %0
%6 = fmul double %5, %0
br label %12
7: ; preds = %1
%8 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -2.000000e+00)
%9 = fmul double %8, 5.000000e-01
%10 = fmul double %8, %9
%11 = tail call double @llvm.fmuladd.f64(double %10, double %8, double 1.000000e+00)
br label %12
12: ; preds = %7, %3
%13 = phi double [ %6, %3 ], [ %11, %7 ]
ret double %13
}
/* Variables and functions */
long strtol(char const *, int /*<<< orphan*/ *, int);
long atol(const char *str) { return strtol(str, NULL, 10); }


x86 assembly (clang, -O0):
<atol>:
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 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
ret i64 %2
}
void tst_branch(void) {
  printf("tst_branch --");
  goto *&&a;
  printf(" dummy");
a:;
  printf(" --\n");
}


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

x86 assembly (clang, -O2):
<tst_branch>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"tst_branch --\00"
@.str.1 = [5 x i8] c" --\0A\00"
define void @tst_branch() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"tst_branch --\00"
@str = [4 x i8] c" --\00"
define void @tst_branch() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
int isA(char c) {
  return c != '\0' && c != '&' && c != '|' && c != '^' && c != '!' &&
         c != '~' && c != ')';
}


x86 assembly (clang, -O0):
<isA>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isA+0x83>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x26,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isA+0x83>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x7c,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isA+0x83>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x5e,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isA+0x83>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x21,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isA+0x83>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x7e,%ecx
mov    %al,-0x2(%rbp)
je     1183 <isA+0x83>
movsbl -0x1(%rbp),%eax
cmp    $0x29,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isA>:
xor    %eax,%eax
cmp    $0x26,%dil
jbe    112d <isA+0x2d>
lea    -0x5e(%rdi),%ecx
cmp    $0x20,%cl
ja     1123 <isA+0x23>
movzbl %cl,%ecx
movabs $0x140000001,%rdx
bt     %rcx,%rdx
jb     1141 <isA+0x41>
xor    %eax,%eax
cmp    $0x29,%dil
setne  %al
ret
movzbl %dil,%ecx
movabs $0x4200000001,%rdx
bt     %rcx,%rdx
jae    1108 <isA+0x8>
ret

LLVM IR (-O0):
define i32 @isA(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %30
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 38
br i1 %9, label %10, label %30
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 124
br i1 %13, label %14, label %30
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 94
br i1 %17, label %18, label %30
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 33
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 126
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 41
br label %30
30: ; preds = %26, %22, %18, %14, %10, %6, %1
%31 = phi i1 [ false, %22 ], [ false, %18 ], [ false, %14 ], [ false, %10 ], [ false, %6 ], [ false, %1 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @isA(i8 signext %0) {
switch i8 %0, label %2 [
i8 126, label %5
i8 124, label %5
i8 94, label %5
i8 38, label %5
i8 33, label %5
i8 0, label %5
]
2: ; preds = %1
%3 = icmp ne i8 %0, 41
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 0, %1 ], [ %4, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
unsigned char _mm_aesencwide256kl_u8(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *, void const *);
unsigned char test__mm_aesencwide256kl_u8(__m128i odata[8],
                                          const __m128i idata[8],
                                          const void *h) {
  return _mm_aesencwide256kl_u8(odata, idata, h);
}


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

x86 assembly (clang, -O2):
<test__mm_aesencwide256kl_u8>:
jmp    1030 <_mm_aesencwide256kl_u8@plt>

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

LLVM IR (-O2):
define zeroext i8 @test__mm_aesencwide256kl_u8(i32* %0, i32* %1, i8* %2) {
%4 = tail call zeroext i8 @_mm_aesencwide256kl_u8(i32* %0, i32* %1, i8* %2)
ret i8 %4
}
void main() {
  int p1;
  int p2;
  while (0) {
    if (p1) {
      goto M;
    }
  }
M:
  while (0) {
    if (p2) {
      goto E;
    }
  }
E:
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
test   $0x1,%al
jne    1113 <main+0x13>
jmp    1127 <main+0x27>
cmpl   $0x0,-0x4(%rbp)
je     1122 <main+0x22>
jmp    112c <main+0x2c>
jmp    1104 <main+0x4>
jmp    112c <main+0x2c>
jmp    1131 <main+0x31>
xor    %eax,%eax
test   $0x1,%al
jne    1140 <main+0x40>
jmp    1154 <main+0x54>
cmpl   $0x0,-0x8(%rbp)
je     114f <main+0x4f>
jmp    1159 <main+0x59>
jmp    1131 <main+0x31>
jmp    1159 <main+0x59>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
unsigned int swap_uint(unsigned int lt) {
  lt = ((lt << 8) & 0xFF00FF00) | ((lt >> 8) & 0xFF00FF);
  return ((lt << 16) | (lt >> 16));
}


x86 assembly (clang, -O0):
<swap_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap_uint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, -16711936
%6 = load i32, i32* %2
%7 = lshr i32 %6, 8
%8 = and i32 %7, 16711935
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = shl i32 %10, 16
%12 = load i32, i32* %2
%13 = lshr i32 %12, 16
%14 = or i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap_uint(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
unsigned xrop3_131_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~S;
  stk3 = D | stk4;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_131_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_131_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rdi,%rax,1),%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
not    %eax
and    %edx,%eax
xor    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_131_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %24, -1
store i32 %25, i32* %11
%26 = load i32, i32* %5
%27 = load i32, i32* %11
%28 = or i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %7
%30 = load i32, i32* %10
%31 = and i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = xor i32 %35, -1
store i32 %36, i32* %8
%37 = load i32, i32* %8
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_131_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = xor i32 %5, %9
%11 = xor i32 %10, -1
ret i32 %11
}
unsigned int scan_ulonglong(const char *src, unsigned long long *dest) {
  register const char *tmp = src;
  register unsigned long long int l = 0;
  register unsigned char c;
  while ((c = *tmp - '0') < 10) {
    l = l * 10 + c;
    ++tmp;
  }
  *dest = l;
  return tmp - src;
}


x86 assembly (clang, -O0):
<scan_ulonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %al,-0x21(%rbp)
movzbl %al,%eax
cmp    $0xa,%eax
jge    1156 <scan_ulonglong+0x56>
imul   $0xa,-0x20(%rbp),%rax
movzbl -0x21(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <scan_ulonglong+0x1c>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_ulonglong>:
mov    (%rdi),%dl
add    $0xd0,%dl
xor    %ecx,%ecx
mov    %rdi,%rax
cmp    $0x9,%dl
ja     112b <scan_ulonglong+0x2b>
nop
lea    (%rcx,%rcx,4),%rcx
movzbl %dl,%edx
lea    (%rdx,%rcx,2),%rcx
movzbl 0x1(%rax),%edx
add    $0x1,%rax
add    $0xd0,%dl
cmp    $0xa,%dl
jb     1110 <scan_ulonglong+0x10>
mov    %rcx,(%rsi)
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @scan_ulonglong(i8* %0, i64* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %17
6: ; preds = %2, %6
%7 = phi i8 [ %15, %6 ], [ %4, %2 ]
%8 = phi i8* [ %13, %6 ], [ %0, %2 ]
%9 = phi i64 [ %12, %6 ], [ 0, %2 ]
%10 = mul i64 %9, 10
%11 = zext i8 %7 to i64
%12 = add i64 %10, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %6, label %17
17: ; preds = %6, %2
%18 = phi i64 [ 0, %2 ], [ %12, %6 ]
%19 = phi i8* [ %0, %2 ], [ %13, %6 ]
store i64 %18, i64* %1
%20 = ptrtoint i8* %19 to i64
%21 = ptrtoint i8* %0 to i64
%22 = sub i64 %20, %21
%23 = trunc i64 %22 to i32
ret i32 %23
}
void swap(void **a, void **b) {
  void *tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Type definitions */
struct tm {
  int tm_hour;
};

/* Variables and functions */
int tm_gethour(struct tm date) { return date.tm_hour; }


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

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @tm_gethour(i32 %0) {
%2 = alloca %struct.tm
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @tm_gethour(i32 returned %0) {
ret i32 %0
}
unsigned char STPV3_IsErrorResponse(unsigned int code) {
  return (((code & 0x0000F000) == 0x00008000) ||
          ((code & 0x0000F000) == 0x00009000));
}


x86 assembly (clang, -O0):
<STPV3_IsErrorResponse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xf000,%ecx
mov    $0x1,%al
cmp    $0x8000,%ecx
mov    %al,-0x5(%rbp)
je     1134 <STPV3_IsErrorResponse+0x34>
mov    -0x4(%rbp),%eax
and    $0xf000,%eax
cmp    $0x9000,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<STPV3_IsErrorResponse>:
and    $0xe000,%edi
cmp    $0x8000,%edi
sete   %al
ret

LLVM IR (-O0):
define zeroext i8 @STPV3_IsErrorResponse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 61440
%5 = icmp eq i32 %4, 32768
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 61440
%9 = icmp eq i32 %8, 36864
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @STPV3_IsErrorResponse(i32 %0) {
%2 = and i32 %0, 57344
%3 = icmp eq i32 %2, 32768
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void existingUserBillsLoader(char *userName) {
  printf("Inside previous bills loader function\n");
}


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

x86 assembly (clang, -O2):
<existingUserBillsLoader>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Inside previous bills loader function\0A\00"
define void @existingUserBillsLoader(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Inside previous bills loader function\00"
define void @existingUserBillsLoader(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned long EthernetConfigGet(unsigned long ulBase) {
  unsigned long ulConfig;
  ;
  ulConfig = (*((volatile unsigned long *)(ulBase + 0x0000003C))) << 16;
  ulConfig |=
      ((*((volatile unsigned long *)(ulBase + 0x00000008))) & ~(0x00000001))
      << 8;
  ulConfig |=
      (*((volatile unsigned long *)(ulBase + 0x0000000C))) & ~(0x00000001);
  return (ulConfig);
}


x86 assembly (clang, -O0):
<EthernetConfigGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%rax
shl    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
and    $0xfffffffffffffffe,%rax
shl    $0x8,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rax
and    $0xfffffffffffffffe,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetConfigGet>:
mov    0x3c(%rdi),%rcx
shl    $0x10,%rcx
mov    0x8(%rdi),%rdx
and    $0xfffffffffffffffe,%rdx
shl    $0x8,%rdx
mov    0xc(%rdi),%rax
and    $0xfffffffffffffffe,%rax
or     %rcx,%rax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @EthernetConfigGet(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 60
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = shl i64 %7, 16
store i64 %8, i64* %3
%9 = load i64, i64* %2
%10 = add i64 %9, 8
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, -2
%14 = shl i64 %13, 8
%15 = load i64, i64* %3
%16 = or i64 %15, %14
store i64 %16, i64* %3
%17 = load i64, i64* %2
%18 = add i64 %17, 12
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = and i64 %20, -2
%22 = load i64, i64* %3
%23 = or i64 %22, %21
store i64 %23, i64* %3
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
define i64 @EthernetConfigGet(i64 %0) {
%2 = add i64 %0, 60
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = shl i64 %4, 16
%6 = add i64 %0, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = shl i64 %8, 8
%10 = and i64 %9, -512
%11 = or i64 %10, %5
%12 = add i64 %0, 12
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = and i64 %14, -2
%16 = or i64 %11, %15
ret i64 %16
}
int fifo_search(int *actuel, int nbValeurs, int valeur) {
  int i;
  for (i = 0; i < nbValeurs; i++)
    if (actuel[i] == valeur)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<fifo_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <fifo_search+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <fifo_search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <fifo_search+0x5a>
jmp    1145 <fifo_search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <fifo_search+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_search>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <fifo_search+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <fifo_search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <fifo_search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fifo_search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
int main(int argc, char *argv[]) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1112 <main+0x12>

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

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
br label %6
6: ; preds = %2, %6
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
int pddlwrap() { return 1; }


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

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

LLVM IR (-O0):
define i32 @pddlwrap() {
ret i32 1
}

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

/* Variables and functions */
uint32_t cigar_int_to_len(uint32_t cigar_int) { return cigar_int >> 4; }


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

x86 assembly (clang, -O2):
<cigar_int_to_len>:
mov    %edi,%eax
sar    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @cigar_int_to_len(i32 %0) {
%2 = ashr i32 %0, 4
ret i32 %2
}
unsigned xrop3_68_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~D;
  stk1 = S & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_68_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_68_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = xor i32 %15, -1
store i32 %16, i32* %8
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = and i32 %17, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = load i32, i32* %6
%22 = xor i32 %21, -1
%23 = and i32 %20, %22
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = and i32 %24, %25
%27 = or i32 %23, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @xrop3_68_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
double bn(int n) {
  int k = n / 2;
  if (n % 2)
    return (2. * (k % 2 ? 1 : -1)) / (3.14159265 * n * n);
  return 0;
}


x86 assembly (clang, -O0):
<bn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     117c <bn+0x7c>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeb8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm2
movsd  0xe9f(%rip),%xmm1
mulsd  %xmm2,%xmm1
cvtsi2sdl -0xc(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <bn+0x84>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn>:
xorpd  %xmm0,%xmm0
test   $0x1,%dil
je     1145 <bn+0x45>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
bt     $0x1,%eax
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmovae %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
addsd  %xmm0,%xmm0
cvtsi2sd %edi,%xmm1
movsd  0xec7(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @bn(i32 %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 2
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = srem i32 %7, 2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %1
%11 = load i32, i32* %4
%12 = srem i32 %11, 2
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 -1
%16 = sitofp i32 %15 to double
%17 = fmul double 2.000000e+00, %16
%18 = load i32, i32* %3
%19 = sitofp i32 %18 to double
%20 = fmul double 0x400921FB53C8D4F1, %19
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to double
%23 = fmul double %20, %22
%24 = fdiv double %17, %23
store double %24, double* %2
br label %26
25: ; preds = %1
store double 0.000000e+00, double* %2
br label %26
26: ; preds = %25, %10
%27 = load double, double* %2
ret double %27
}

LLVM IR (-O2):
define double @bn(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = sdiv i32 %0, 2
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 -1, i32 1
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 2.000000e+00
%11 = sitofp i32 %0 to double
%12 = fmul double %11, 0x400921FB53C8D4F1
%13 = fmul double %12, %11
%14 = fdiv double %10, %13
br label %15
15: ; preds = %1, %4
%16 = phi double [ %14, %4 ], [ 0.000000e+00, %1 ]
ret double %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void barf(char *message, char *extra) {
  printf(message, extra);
  exit(1);
}


x86 assembly (clang, -O0):
<barf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<barf>:
push   %rax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @barf(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 = call i32 @printf(i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @barf(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CyEEPROM_Stop();
void EEPROM_Real_Stop(void) { CyEEPROM_Stop(); }


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

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

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

LLVM IR (-O2):
define void @EEPROM_Real_Stop() {
%1 = tail call i32 (...) @CyEEPROM_Stop()
ret void
}
void clear_ts(void) { __asm__ volatile("clts"); }


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

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

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

LLVM IR (-O2):
define void @clear_ts() {
tail call void asm sideeffect "clts", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EEPROM_1_Enable();
void EEPROM_1_Start(void) { EEPROM_1_Enable(); }


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

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

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

LLVM IR (-O2):
define void @EEPROM_1_Start() {
%1 = tail call i32 (...) @EEPROM_1_Enable()
ret void
}