xunge/DecIR huggingface dataset:
/* Variables and functions */
int AngleDir4(float);
int RadianAngleDir4(float angle) { return AngleDir4(angle * 57.2958); }


x86 assembly (clang, -O0):
<RadianAngleDir4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <AngleDir4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RadianAngleDir4>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <AngleDir4@plt>

LLVM IR (-O0):
define i32 @RadianAngleDir4(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 5.729580e+01
%6 = fptrunc double %5 to float
%7 = call i32 @AngleDir4(float %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @RadianAngleDir4(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 5.729580e+01
%4 = fptrunc double %3 to float
%5 = tail call i32 @AngleDir4(float %4)
ret i32 %5
}
/* Variables and functions */
long lrint(int);
int psi_to_bar(double);
long psi_to_mbar(double psi) { return lrint(psi_to_bar(psi) * 1000); }


x86 assembly (clang, -O0):
<psi_to_mbar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <psi_to_bar@plt>
imul   $0x3e8,%eax,%edi
call   1030 <lrint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_to_mbar>:
push   %rax
call   1040 <psi_to_bar@plt>
imul   $0x3e8,%eax,%edi
pop    %rax
jmp    1030 <lrint@plt>

LLVM IR (-O0):
define i64 @psi_to_mbar(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @psi_to_bar(double %3)
%5 = mul nsw i32 %4, 1000
%6 = call i64 @lrint(i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @psi_to_mbar(double %0) {
%2 = tail call i32 @psi_to_bar(double %0)
%3 = mul nsw i32 %2, 1000
%4 = tail call i64 @lrint(i32 %3)
ret i64 %4
}
int test_imm_FFuint8_reg(unsigned char val) {
  return ((val) & (-0xFF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FFuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff01,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FFuint8_reg>:
test   $0x1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FFuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 1
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t z80_cb_f8_set_7(uint8_t value) { return value | 0x80; }


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

x86 assembly (clang, -O2):
<z80_cb_f8_set_7>:
mov    %edi,%eax
or     $0x80,%eax
ret

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

LLVM IR (-O2):
define i32 @z80_cb_f8_set_7(i32 %0) {
%2 = or i32 %0, 128
ret i32 %2
}
void perm(int *p, int *q) {
  int x;
  x = *p;
  *p = *q;
  *q = x;
}


x86 assembly (clang, -O0):
<perm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<perm>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @perm(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @perm(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ np_werror(char *, int);
int /*<<< orphan*/ strerror_r(int, char *, int);
void np_uerror(int ecode) {
  char buf[256];
  strerror_r(ecode, buf, sizeof(buf));
  np_werror(buf, ecode);
}


x86 assembly (clang, -O0):
<np_uerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1040 <strerror_r@plt>
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <np_werror@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<np_uerror>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x100,%edx
call   1040 <strerror_r@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <np_werror@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @np_uerror(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = call i32 @strerror_r(i32 %4, i8* %5, i32 256)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @np_werror(i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @np_uerror(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @strerror_r(i32 %0, i8* %3, i32 256)
%5 = call i32 @np_werror(i8* %3, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
long main() {
  long x;
  x = 2 * 7 + 3;
  printf("%ld\n", x);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x11,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i64 @main() {
%1 = alloca i64
%2 = alloca i64
store i64 17, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = load i64, i64* %1
ret i64 %5
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i64 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 17)
ret i64 undef
}
/* Variables and functions */
int strlen(char *);
void remove_final_slashes(char *path) {
  int n;
  n = strlen(path);
  while (path[n - 1] == '/') {
    n--;
  }
  path[n] = '\0';
}


x86 assembly (clang, -O0):
<remove_final_slashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1150 <remove_final_slashes+0x40>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <remove_final_slashes+0x18>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_final_slashes>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rdx
lea    (%rdx,%rbx,1),%rcx
add    $0xffffffffffffffff,%rcx
shl    $0x20,%rdx
movabs $0x100000000,%rax
add    %rdx,%rax
movabs $0xffffffff00000000,%rdx
ff ff ff
nop
add    %rdx,%rax
cmpb   $0x2f,(%rcx)
lea    -0x1(%rcx),%rcx
je     1140 <remove_final_slashes+0x30>
sar    $0x20,%rax
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @remove_final_slashes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ %6, %4 ], [ %3, %1 ]
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 47
br i1 %9, label %4, label %10
10: ; preds = %4
%11 = shl i64 %5, 32
%12 = ashr exact i64 %11, 32
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 0, i8* %13
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ getcNofail(int /*<<< orphan*/ *const);
void pm_readchar(FILE *const ifP, char *const cP) {
  *cP = (char)getcNofail(ifP);
}


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

x86 assembly (clang, -O2):
<pm_readchar>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getcNofail@plt>
mov    %al,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @pm_readchar(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i64 @getcNofail(i32* %5)
%7 = trunc i64 %6 to i8
%8 = load i8*, i8** %4
store i8 %7, i8* %8
ret void
}

LLVM IR (-O2):
define void @pm_readchar(i32* %0, i8* nocapture writeonly %1) {
%3 = tail call i64 @getcNofail(i32* %0)
%4 = trunc i64 %3 to i8
store i8 %4, i8* %1
ret void
}
/* Variables and functions */
int statlibfunc();
int main(int argc, char **argv) { return statlibfunc(); }


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    $0x0,%al
call   1030 <statlibfunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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 (...) @statlibfunc()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @statlibfunc()
ret i32 %3
}
unsigned int hash_function(unsigned long value) {
  return value & ((1 << 4) - 1);
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_function>:
mov    %rdi,%rax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @hash_function(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 15
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @hash_function(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 15
ret i32 %3
}
__attribute__((optnone)) void fluff() {}


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

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

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

LLVM IR (-O2):
define void @fluff() {
ret void
}
void delayacct_init(void) {}


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

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

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

LLVM IR (-O2):
define void @delayacct_init() {
ret void
}
/* Variables and functions */
scalar_t__ yylex();
int main(void) {
  while (yylex())
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <yylex@plt>
cmp    $0x0,%rax
je     1135 <main+0x25>
jmp    111f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <yylex@plt>
test   %rax,%rax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @yylex()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 0
}
/* Variables and functions */
int ziplistLen(unsigned char *);
unsigned int zzlLength(unsigned char *zl) { return ziplistLen(zl) / 2; }


x86 assembly (clang, -O0):
<zzlLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ziplistLen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zzlLength>:
push   %rax
call   1030 <ziplistLen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @zzlLength(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ziplistLen(i8* %3)
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @zzlLength(i8* %0) {
%2 = tail call i32 @ziplistLen(i8* %0)
%3 = sdiv i32 %2, 2
ret i32 %3
}
unsigned long bn_div_words(unsigned long h, unsigned long l, unsigned long d) {
  unsigned long ret, waste;
  asm("divq	%4" : "=a"(ret), "=d"(waste) : "a"(l), "d"(h), "g"(d) : "cc");
  return ret;
}


x86 assembly (clang, -O0):
<bn_div_words>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x30(%rbp)
divq   -0x30(%rbp)
mov    %rax,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_div_words>:
mov    %rsi,%rax
mov    %rdx,-0x8(%rsp)
mov    %rdi,%rdx
divq   -0x8(%rsp)
ret

LLVM IR (-O0):
define i64 @bn_div_words(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = load i64, i64* %6
%12 = call { i64, i64 } asm "divq\09$4", "={ax},={dx},{ax},{dx},imr,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %9, i64 %10, i64 %11)
%13 = extractvalue { i64, i64 } %12, 0
%14 = extractvalue { i64, i64 } %12, 1
store i64 %13, i64* %7
store i64 %14, i64* %8
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
define i64 @bn_div_words(i64 %0, i64 %1, i64 %2) {
%4 = tail call { i64, i64 } asm "divq\09$4", "={ax},={dx},{ax},{dx},imr,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %1, i64 %0, i64 %2)
%5 = extractvalue { i64, i64 } %4, 0
ret i64 %5
}
int main() {
  int i = 32;
  int j;
  if (i == 32) {
    j = 5;
  } else {
    j = 7;
  }
  return j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jne    1128 <main+0x28>
movl   $0x5,-0xc(%rbp)
jmp    112f <main+0x2f>
movl   $0x7,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
long double cos(double);
__attribute__((weak)) long double cosl(long double x) { return cos((double)x); }


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

x86 assembly (clang, -O2):
<cosl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define weak x86_fp80 @cosl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @cos(double %2)
ret x86_fp80 %3
}
int Z(int N) {
  int i = 0, j;
  for (j = 5; j <= N; j *= 5) {
    i += N / j;
  }
  return i;
}


x86 assembly (clang, -O0):
<Z>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113a <Z+0x3a>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0x5,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <Z+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Z>:
xor    %ecx,%ecx
cmp    $0x5,%edi
jl     111e <Z+0x1e>
xor    %ecx,%ecx
mov    $0x5,%esi
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
add    %eax,%ecx
lea    (%rsi,%rsi,4),%esi
cmp    %edi,%esi
jle    1110 <Z+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Z(i32 %0) {
%2 = icmp slt i32 %0, 5
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 5, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = sdiv i32 %0, %4
%7 = add nsw i32 %6, %5
%8 = mul nsw i32 %4, 5
%9 = icmp sgt i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
void TA2_0_IRQHandler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @TA2_0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int vldot(int, double *, double *);
int /*<<< orphan*/ vlscale(int, int, double *, double *);
void vlproj(int l, double v[l], double u[l], double vo[l]) {
  vlscale(vldot(l, u, v) / vldot(l, u, u), l, u, vo);
}


x86 assembly (clang, -O0):
<vlproj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <vldot@plt>
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <vldot@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <vlscale@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlproj>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %edi,%ebp
mov    %rbx,%rsi
call   1030 <vldot@plt>
mov    %eax,%r15d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <vldot@plt>
mov    %eax,%ecx
mov    %r15d,%eax
cltd
idiv   %ecx
mov    %eax,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <vlscale@plt>

LLVM IR (-O0):
define void @vlproj(i32 %0, double* %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = load i32, i32* %5
%12 = zext i32 %11 to i64
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = load i32, i32* %5
%16 = load double*, double** %7
%17 = load double*, double** %6
%18 = call i32 @vldot(i32 %15, double* %16, double* %17)
%19 = load i32, i32* %5
%20 = load double*, double** %7
%21 = load double*, double** %7
%22 = call i32 @vldot(i32 %19, double* %20, double* %21)
%23 = sdiv i32 %18, %22
%24 = load i32, i32* %5
%25 = load double*, double** %7
%26 = load double*, double** %8
%27 = call i32 @vlscale(i32 %23, i32 %24, double* %25, double* %26)
ret void
}

LLVM IR (-O2):
define void @vlproj(i32 %0, double* %1, double* %2, double* %3) {
%5 = tail call i32 @vldot(i32 %0, double* %2, double* %1)
%6 = tail call i32 @vldot(i32 %0, double* %2, double* %2)
%7 = sdiv i32 %5, %6
%8 = tail call i32 @vlscale(i32 %7, i32 %0, double* %2, double* %3)
ret void
}
int sys$readef(unsigned int efn, unsigned int *state) {
  return ({
    unsigned long resultvar;
    register long int _a2 asm("rsi") = (long)(state);
    register long int _a1 asm("rdi") = (long)(efn);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(25), "r"(_a1), "r"(_a2)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$readef>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x19,%rax
int    $0x81
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$readef>:
mov    %edi,%edi
mov    $0x19,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$readef"(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %3
store i32* %1, i32** %4
%9 = load i32*, i32** %4
%10 = ptrtoint i32* %9 to i64
store i64 %10, i64* %6
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i64, i64* %6
%15 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 25, i64 %13, i64 %14)
store i64 %15, i64* %5
%16 = load i64, i64* %5
store i64 %16, i64* %8
%17 = load i64, i64* %8
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @"sys$readef"(i32 %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = zext i32 %0 to i64
%5 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 25, i64 %4, i64 %3)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int jsY_isnewline(int c) {
  return c == 0xA || c == 0xD || c == 0x2028 || c == 0x2029;
}


x86 assembly (clang, -O0):
<jsY_isnewline>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <jsY_isnewline+0x44>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <jsY_isnewline+0x44>
mov    $0x1,%al
cmpl   $0x2028,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <jsY_isnewline+0x44>
cmpl   $0x2029,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsY_isnewline>:
mov    $0x1,%eax
cmp    $0xa,%edi
je     1122 <jsY_isnewline+0x22>
cmp    $0xd,%edi
je     1122 <jsY_isnewline+0x22>
cmp    $0x2028,%edi
je     1122 <jsY_isnewline+0x22>
xor    %eax,%eax
cmp    $0x2029,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @jsY_isnewline(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 13
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 8232
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 8233
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @jsY_isnewline(i32 %0) {
switch i32 %0, label %2 [
i32 8232, label %5
i32 13, label %5
i32 10, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 8233
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank3High(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vrc2_4_SetChrROMBank3();
void vrc2_4_setParamsCXX3(uint16_t addr, uint8_t val) {
  __setCHRBank3High(addr, val);
  vrc2_4_SetChrROMBank3();
}


x86 assembly (clang, -O0):
<vrc2_4_setParamsCXX3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <__setCHRBank3High@plt>
mov    $0x0,%al
call   1030 <vrc2_4_SetChrROMBank3@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vrc2_4_setParamsCXX3(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 = call i32 @__setCHRBank3High(i32 %5, i32 %6)
%8 = call i32 (...) @vrc2_4_SetChrROMBank3()
ret void
}

LLVM IR (-O2):
define void @vrc2_4_setParamsCXX3(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank3High(i32 %0, i32 %1)
%4 = tail call i32 (...) @vrc2_4_SetChrROMBank3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void str_swap_free(char **target, char *source) {
  free(*target);
  *target = source;
}


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

x86 assembly (clang, -O2):
<str_swap_free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @str_swap_free(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** %5
%7 = call i32 @free(i8* %6)
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %3
store i8* %8, i8** %9
ret void
}

LLVM IR (-O2):
define void @str_swap_free(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @free(i8* %3)
store i8* %1, i8** %0
ret void
}
void post_assignment() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ vwarnx(char const *, int /*<<< orphan*/);
void verrx(int status, const char *fmt, va_list ap) {
  vwarnx(fmt, ap);
  exit(status);
}


x86 assembly (clang, -O0):
<verrx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <vwarnx@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<verrx>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <vwarnx@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @verrx(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @vwarnx(i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
define void @verrx(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @vwarnx(i8* %1, i32 %2)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
void ubi_fastmap_close(struct ubi_device *ubi) {}


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

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

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

LLVM IR (-O2):
%struct.ubi_device = type opaque
define void @ubi_fastmap_close(%struct.ubi_device* nocapture %0) {
ret void
}
void av_image_fill_max_pixsteps() {}


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

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

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

LLVM IR (-O2):
define void @av_image_fill_max_pixsteps() {
ret void
}
int mmc_register_key_type(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mmc_register_key_type() {
ret i32 0
}
int comp_desc(const void *a, const void *b) { return *(int *)b - *(int *)a; }


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

x86 assembly (clang, -O2):
<comp_desc>:
mov    (%rsi),%eax
sub    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @comp_desc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void foo748() {}


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

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

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

LLVM IR (-O2):
define void @foo748() {
ret void
}
unsigned long long h(unsigned long long i) { return (i << 4) & 0xfff; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x4,%rax
and    $0xfff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
movzbl %dil,%eax
shl    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @h(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 4
%5 = and i64 %4, 4095
ret i64 %5
}

LLVM IR (-O2):
define i64 @h(i64 %0) {
%2 = shl i64 %0, 4
%3 = and i64 %2, 4080
ret i64 %3
}
int check_palindrome(unsigned long int n) {
  unsigned long int t1, t2, r;
  t1 = n;
  while (t1) {
    r = t1 % 10;
    t1 = t1 / 10;
    t2 = t2 * 10 + r;
  }
  if (t2 == n)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_palindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <check_palindrome+0x51>
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
imul   $0xa,-0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1110 <check_palindrome+0x10>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    116b <check_palindrome+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <check_palindrome+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_palindrome>:
test   %rdi,%rdi
je     114b <check_palindrome+0x4b>
movabs $0xcccccccccccccccd,%r8
cc cc cc
mov    %rdi,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rsi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rsi,%rcx
sub    %rax,%rcx
lea    (%r9,%r9,4),%rax
lea    (%rcx,%rax,2),%r9
cmp    $0x9,%rsi
mov    %rdx,%rsi
ja     1120 <check_palindrome+0x20>
jmp    114b <check_palindrome+0x4b>
xor    %eax,%eax
cmp    %rdi,%r9
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_palindrome(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %9, %3 ], [ undef, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = urem i64 %5, 10
%7 = udiv i64 %5, 10
%8 = mul i64 %4, 10
%9 = add i64 %8, %6
%10 = icmp ult i64 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ undef, %1 ], [ %9, %3 ]
%13 = icmp eq i64 %12, %0
%14 = zext i1 %13 to i32
ret i32 %14
}
void modemcontrol(int sfd, int dtr) {}


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

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

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

LLVM IR (-O2):
define void @modemcontrol(i32 %0, i32 %1) {
ret void
}
unsigned kol_mouse_posw() { asm("int $0x40" ::"a"(37), "b"(1)); }


x86 assembly (clang, -O0):
<kol_mouse_posw>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
mov    $0x1,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_mouse_posw>:
push   %rbx
mov    $0x25,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_mouse_posw() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 1)
ret i32 undef
}
unsigned int DRV_ABB_WRX_CTRL(unsigned char ucStatus) { return 0; }


x86 assembly (clang, -O0):
<DRV_ABB_WRX_CTRL>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @DRV_ABB_WRX_CTRL(i8 zeroext %0) {
ret i32 0
}
_trace(i) int i;
{ printf("[%d]", i); }


x86 assembly (clang, -O0):
<_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_trace>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"[%d]\00"
define i32 @_trace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"[%d]\00"
define i32 @_trace(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
long _xte_utf8_strlen(char const *in_string) {
  if (!in_string)
    in_string = "";
  long count = 0;
  while (*(in_string++)) {
    if ((in_string[0] & 0xC0) != 0x80)
      count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<_xte_utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111e <_xte_utf8_strlen+0x1e>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1166 <_xte_utf8_strlen+0x66>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1161 <_xte_utf8_strlen+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1126 <_xte_utf8_strlen+0x26>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xte_utf8_strlen>:
test   %rdi,%rdi
lea    0xef6(%rip),%rcx
cmovne %rdi,%rcx
cmpb   $0x0,(%rcx)
je     113e <_xte_utf8_strlen+0x3e>
add    $0x1,%rcx
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rcx),%esi
mov    %esi,%edx
and    $0xc0,%dl
xor    %edi,%edi
cmp    $0x80,%dl
setne  %dil
add    %rdi,%rax
add    $0x1,%rcx
test   %sil,%sil
jne    1120 <_xte_utf8_strlen+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i64 @_xte_utf8_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %1
store i64 0, i64* %3
br label %8
8: ; preds = %23, %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = and i32 %17, 192
%19 = icmp ne i32 %18, 128
br i1 %19, label %20, label %23
20: ; preds = %13
%21 = load i64, i64* %3
%22 = add nsw i64 %21, 1
store i64 %22, i64* %3
br label %23
23: ; preds = %20, %13
br label %8
24: ; preds = %8
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i64 @_xte_utf8_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1, %6
%7 = phi i8* [ %9, %6 ], [ %3, %1 ]
%8 = phi i64 [ %14, %6 ], [ 0, %1 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = and i8 %10, -64
%12 = icmp ne i8 %11, -128
%13 = zext i1 %12 to i64
%14 = add nuw nsw i64 %8, %13
%15 = icmp eq i8 %10, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %1
%17 = phi i64 [ 0, %1 ], [ %14, %6 ]
ret i64 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_pid_notifyf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_pid_notifyf>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_pid_notifyf(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* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_pid_notifyf(i32 %0, i32 %1, i8* nocapture readnone %2, ...) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL;

/* Variables and functions */
int mysql_errno(int /*<<< orphan*/ *);
char *mysql_error(int /*<<< orphan*/ *);
scalar_t__ mysql_query(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *, int, char *);
void dropDefaultTable(MYSQL *connection) {
  if (mysql_query(connection, "DROP TABLE benchmark.user")) {
    printf("dropDefaultTable::Error %u: %s\n", mysql_errno(connection),
           mysql_error(connection));
  }
}


x86 assembly (clang, -O0):
<dropDefaultTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <mysql_query@plt>
cmp    $0x0,%rax
je     118d <dropDefaultTable+0x4d>
mov    -0x8(%rbp),%rdi
call   1050 <mysql_errno@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <mysql_error@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropDefaultTable>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb3(%rip),%rsi
call   1030 <mysql_query@plt>
test   %rax,%rax
je     1180 <dropDefaultTable+0x40>
mov    %rbx,%rdi
call   1050 <mysql_errno@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <mysql_error@plt>
lea    0xeaa(%rip),%rdi
mov    %ebp,%esi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"DROP TABLE benchmark.user\00"
@.str.1 = [32 x i8] c"dropDefaultTable::Error %u: %s\0A\00"
define void @dropDefaultTable(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @mysql_query(i32* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @mysql_errno(i32* %7)
%9 = load i32*, i32** %2
%10 = call i8* @mysql_error(i32* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %8, i8* %10)
br label %12
12: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"DROP TABLE benchmark.user\00"
@.str.1 = [32 x i8] c"dropDefaultTable::Error %u: %s\0A\00"
define void @dropDefaultTable(i32* %0) {
%2 = tail call i64 @mysql_query(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @mysql_errno(i32* %0)
%6 = tail call i8* @mysql_error(i32* %0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %5, i8* %6)
br label %8
8: ; preds = %4, %1
ret void
}
int compare_integers(const void *av, const void *bv) {
  const int *a = (const int *)av;
  const int *b = (const int *)bv;
  if (*a < *b)
    return -1;
  else if (*a > *b)
    return +1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_integers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <compare_integers+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <compare_integers+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    1158 <compare_integers+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <compare_integers+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_integers>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_integers(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
uint64_t zigzagenc64(int64_t x) { return x << 1 ^ x >> 63; }


x86 assembly (clang, -O0):
<zigzagenc64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%edx
mov    $0x3f,%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @zigzagenc64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 63
%7 = xor i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @zigzagenc64(i32 %0) {
ret i32 poison
}