xunge/DecIR huggingface dataset:
void addEpilogue(unsigned char *code, int codeByte) {
  code[codeByte] = 0x89;
  code[(codeByte + 1)] = 0xec;
  code[(codeByte + 2)] = 0x5d;
  code[(codeByte + 3)] = 0xc3;
}


x86 assembly (clang, -O0):
<addEpilogue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x89,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0xec,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x5d,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movb   $0xc3,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addEpilogue>:
movslq %esi,%rax
movl   $0xc35dec89,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @addEpilogue(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 -119, i8* %8
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8 -20, i8* %13
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
store i8 93, i8* %18
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 -61, i8* %23
ret void
}

LLVM IR (-O2):
define void @addEpilogue(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 -119, i8* %4
%5 = add nsw i32 %1, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 -20, i8* %7
%8 = add nsw i32 %1, 2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 93, i8* %10
%11 = add nsw i32 %1, 3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 -61, i8* %13
ret void
}
int *test2(int *I) { return I - 1; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
lea    -0x4(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @test2(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
ret i32* %2
}
void i2d_PKCS8PrivateKeyInfo_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PKCS8PrivateKeyInfo_bio() {
ret void
}
void Hibernate_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @Hibernate_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
void *MAP_FAILED;
int /*<<< orphan*/ munmap(void *, size_t);
void unmapmem(void **pmem, size_t size) {
  if (*pmem == MAP_FAILED)
    return;
  munmap(*pmem, size);
  *pmem = MAP_FAILED;
}


x86 assembly (clang, -O0):
<unmapmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%rax
jne    113c <unmapmem+0x2c>
jmp    115d <unmapmem+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmapmem>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    0x2ebf(%rip),%r14
cmp    (%r14),%rdi
je     1131 <unmapmem+0x21>
call   1030 <munmap@plt>
mov    (%r14),%rax
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@MAP_FAILED = global i8* null
define void @unmapmem(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
store i8** %0, i8*** %3
store i64 %1, i64* %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load i8*, i8** @MAP_FAILED
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
br label %17
10: ; preds = %2
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = load i64, i64* %4
%14 = call i32 @munmap(i8* %12, i64 %13)
%15 = load i8*, i8** @MAP_FAILED
%16 = load i8**, i8*** %3
store i8* %15, i8** %16
br label %17
17: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@MAP_FAILED = global i8* null
define void @unmapmem(i8** nocapture %0, i64 %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** @MAP_FAILED
%5 = icmp eq i8* %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @munmap(i8* %3, i64 %1)
%8 = load i8*, i8** @MAP_FAILED
store i8* %8, i8** %0
br label %9
9: ; preds = %2, %6
ret void
}
void genni(void) {}


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

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

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

LLVM IR (-O2):
define void @genni() {
ret void
}
/* Variables and functions */
int assume_default_colors(int, int);
int wrap_assume_default_colors(int f, int b) {
  return assume_default_colors(f, b);
}


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

x86 assembly (clang, -O2):
<wrap_assume_default_colors>:
jmp    1030 <assume_default_colors@plt>

LLVM IR (-O0):
define i32 @wrap_assume_default_colors(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 @assume_default_colors(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @wrap_assume_default_colors(i32 %0, i32 %1) {
%3 = tail call i32 @assume_default_colors(i32 %0, i32 %1)
ret i32 %3
}
void foo313(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo313(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HD44780_DisplayN_POS(unsigned long, int, int /*<<< orphan*/,
                                        int, int /*<<< orphan*/);
void DISPLAY_RPM(unsigned long rpm) {
  HD44780_DisplayN_POS(rpm, 5 + 4, 0, 5, 0);
}


x86 assembly (clang, -O0):
<DISPLAY_RPM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
xor    %r8d,%r8d
mov    $0x5,%ecx
mov    %r8d,%edx
call   1030 <HD44780_DisplayN_POS@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DISPLAY_RPM>:
mov    $0x9,%esi
xor    %edx,%edx
mov    $0x5,%ecx
xor    %r8d,%r8d
jmp    1030 <HD44780_DisplayN_POS@plt>

LLVM IR (-O0):
define void @DISPLAY_RPM(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @HD44780_DisplayN_POS(i64 %3, i32 9, i32 0, i32 5, i32 0)
ret void
}

LLVM IR (-O2):
define void @DISPLAY_RPM(i64 %0) {
%2 = tail call i32 @HD44780_DisplayN_POS(i64 %0, i32 9, i32 0, i32 5, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fabs(double);
double log(int /*<<< orphan*/);
double pow(double, double);
double f(double x) {
  return pow(x, 3.0) * log(fabs((x * x - 1.0) * (x * x - 2.0)));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
call   1050 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe7c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
movsd  0xebf(%rip),%xmm1
call   1050 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm1
unpcklpd %xmm1,%xmm1
addpd  0xeae(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <log@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 3.000000e+00)
%5 = load double, double* %2
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double %5, double %6, double -1.000000e+00)
%8 = load double, double* %2
%9 = load double, double* %2
%10 = call double @llvm.fmuladd.f64(double %8, double %9, double -2.000000e+00)
%11 = fmul double %7, %10
%12 = call i32 @fabs(double %11)
%13 = call double @log(i32 %12)
%14 = fmul double %4, %13
ret double %14
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @pow(double %0, double 3.000000e+00)
%3 = insertelement <2 x double> poison, double %0, i64 0
%4 = shufflevector <2 x double> %3, <2 x double> poison, <2 x i32> zeroinitializer
%5 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %4, <2 x double> %4, <2 x double> <double -1.000000e+00, double -2.000000e+00>)
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%7 = fmul <2 x double> %5, %6
%8 = extractelement <2 x double> %7, i64 0
%9 = tail call i32 @fabs(double %8)
%10 = tail call double @log(i32 %9)
%11 = fmul double %2, %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ seg(int *, int);
int main(void) {
  int a[10] = {2, 2, 2, 5, 8, 1, 1, 4, 1};
  seg(a, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1040 <seg@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <seg@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 2, i32 2, i32 2, i32 5, i32 8, i32 1, i32 1, i32 4, i32 1, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @seg(i32* %4, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 2, i32 2, i32 2, i32 5, i32 8, i32 1, i32 1, i32 4, i32 1, i32 0]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @seg(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printiln(int i) { printf("%d\n", i); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printiln(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x0a() {
  Assert_real((isprint(10) == 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_isprint.c",
              55, ("isprint should be 0 for 0x0a"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x0a>:
push   %rax
mov    $0xa,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x0a\00"
define void @t_isprint_0x0a() {
%1 = call i64 @isprint(i32 10)
%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 55, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x0a\00"
define void @t_isprint_0x0a() {
%1 = tail call i64 @isprint(i32 10)
%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 55, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int fchmodat(int, char const *, int /*<<< orphan*/, int);
__attribute__((__weak__, __always___)) int
softboundcets_fchmodat(int dirfd, const char *pathname, mode_t mode,
                       int flags) {
  return fchmodat(dirfd, pathname, mode, flags);
}


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

x86 assembly (clang, -O2):
<softboundcets_fchmodat>:
jmp    1030 <fchmodat@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_fchmodat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @fchmodat(i32 %9, i8* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define weak i32 @softboundcets_fchmodat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @fchmodat(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
int rev(int num) {
  int rev = 0, rem;
  while (num > 0) {
    rem = num % 10;
    rev = rev * 10 + rem;
    num /= 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<rev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1143 <rev+0x43>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <rev+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <rev+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <rev+0x10>
ret

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

LLVM IR (-O2):
define i32 @rev(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = urem i32 %4, 10
%7 = mul nsw i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %4, 10
%10 = icmp ult i32 %4, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
void clear_stdin() {
  char trash[256];
  scanf("%s", trash);
}


x86 assembly (clang, -O0):
<clear_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1030 <scanf@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_stdin>:
sub    $0x108,%rsp
lea    0xee2(%rip),%rdi
mov    %rsp,%rsi
call   1030 <scanf@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @clear_stdin() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @clear_stdin() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
void fc221(int n) {
a : {
  typedef int(*b)[n];
  {
    typedef int(*c)[n];
    0;
  }
  {
    typedef int(*d)[n];
    0;
  };
  typedef int(*e)[n];
  0;
};
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    goto a;
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc221>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc221+0x7>

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

LLVM IR (-O0):
define void @fc221(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %3
20: ; No predecessors!
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc221(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int lscale(unsigned short int u) {
  int ii;
  unsigned short int sign_mask = 0x8000;
  unsigned short int scal_mask = 0x7fff;
  ii = u & scal_mask;
  if ((u & sign_mask) == sign_mask) {
    ii = ii * -1;
  }
  return ii;
}


x86 assembly (clang, -O0):
<lscale>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x8000,-0xa(%rbp)
movw   $0x7fff,-0xc(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0xa(%rbp),%ecx
and    %ecx,%eax
movzwl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jne    1141 <lscale+0x41>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lscale>:
mov    %edi,%ecx
and    $0x7fff,%ecx
mov    %ecx,%eax
neg    %eax
test   $0x8000,%edi
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @lscale(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %2
store i16 -32768, i16* %4
store i16 32767, i16* %5
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = load i16, i16* %5
%9 = zext i16 %8 to i32
%10 = and i32 %7, %9
store i32 %10, i32* %3
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = load i16, i16* %4
%14 = zext i16 %13 to i32
%15 = and i32 %12, %14
%16 = load i16, i16* %4
%17 = zext i16 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %22
19: ; preds = %1
%20 = load i32, i32* %3
%21 = mul nsw i32 %20, -1
store i32 %21, i32* %3
br label %22
22: ; preds = %19, %1
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @lscale(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = and i32 %2, 32767
%4 = and i32 %2, 32768
%5 = icmp eq i32 %4, 0
%6 = sub nsw i32 0, %3
%7 = select i1 %5, i32 %3, i32 %6
ret i32 %7
}
/* Variables and functions */
int main_called();
int shlib_maincall() { return main_called(); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_cell_layout_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
func() {
  char param[30];
  gets(param);
  printf("%s\n", param);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x30(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @func() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ be_uint24_write(void *, unsigned int);
void cpu_uint24_write(void *ptr, unsigned v) { be_uint24_write(ptr, v); }


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

x86 assembly (clang, -O2):
<cpu_uint24_write>:
jmp    1030 <be_uint24_write@plt>

LLVM IR (-O0):
define void @cpu_uint24_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @be_uint24_write(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @cpu_uint24_write(i8* %0, i32 %1) {
%3 = tail call i32 @be_uint24_write(i8* %0, i32 %1)
ret void
}
void lerrsf(msg, arg) char msg[], arg[];
{
  char errmsg[2048];
  (void)sprintf(errmsg, msg, arg);
  flexerror(errmsg);
}


x86 assembly (clang, -O0):
<lerrsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
mov    $0x0,%al
call   1030 <flexerror@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerrsf>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <flexerror@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @lerrsf(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @flexerror to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
define void @lerrsf(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @flexerror to i32 (i8*, ...)*)(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, unsigned long);
char *strdup(char const *);
scalar_t__ strlen(char const *);
char *xstrdup(const char *s) {
  char *ret;
  if (!s)
    return NULL;
  ret = strdup(s);
  if (!ret)
    die("Can't strdup %lu bytes\n", (unsigned long)strlen(s) + 1);
  return ret;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1190 <xstrdup+0x60>
mov    -0x10(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1188 <xstrdup+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
add    $0x1,%rsi
lea    0xe7d(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
test   %rdi,%rdi
je     115d <xstrdup+0x2d>
mov    %rdi,%rbx
call   1050 <strdup@plt>
test   %rax,%rax
je     1145 <xstrdup+0x15>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
lea    0xea8(%rip),%rdi
call   1040 <die@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Can't strdup %lu bytes\0A\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i64 @strlen(i8* %14)
%16 = add i64 %15, 1
%17 = call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %16)
br label %18
18: ; preds = %13, %8
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %7
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@.str = [24 x i8] c"Can't strdup %lu bytes\0A\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @strlen(i8* %0)
%8 = add i64 %7, 1
%9 = tail call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %3, %6, %1
%11 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %11
}
unsigned uDivTest16(unsigned X, unsigned Y) { return -X / 2; }


x86 assembly (clang, -O0):
<uDivTest16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
shr    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @uDivTest16(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 = sub i32 0, %5
%7 = udiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @uDivTest16(i32 %0, i32 %1) {
%3 = sub i32 0, %0
%4 = lshr i32 %3, 1
ret i32 %4
}
int IterativeSolver_NumVectors() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @IterativeSolver_NumVectors() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ernie(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  ernie("How are you Bert?");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <ernie@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <ernie@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"How are you Bert?\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ernie(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"How are you Bert?\00"
define i32 @main() {
%1 = tail call i32 @ernie(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
bool utf8_check_boundary(uint8_t *position, uint32_t n, uint8_t *max) {
  if ((position + n) >= max) {
    return (true);
  }
  return (false);
}


x86 assembly (clang, -O0):
<utf8_check_boundary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
cmp    -0x20(%rbp),%rax
jb     1134 <utf8_check_boundary+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <utf8_check_boundary+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_check_boundary>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rcx
xor    %eax,%eax
cmp    %rdx,%rcx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @utf8_check_boundary(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = icmp uge i32* %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
float getsample_abort(float *, int, int, int, int, int, int);
int gmod(int, int);
float getsample_per(float *x, int w, int h, int pd, int i, int j, int l) {
  i = gmod(i, w);
  j = gmod(j, h);
  return getsample_abort(x, w, h, pd, i, j, l);
}


x86 assembly (clang, -O0):
<getsample_per>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gmod@plt>
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <gmod@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1040 <getsample_abort@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsample_per>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r15d
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r12
mov    %r8d,%edi
call   1030 <gmod@plt>
mov    %eax,%r13d
mov    %r15d,%edi
mov    %ebp,%esi
call   1030 <gmod@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %r13d,%r8d
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <getsample_abort@plt>

LLVM IR (-O0):
define float @getsample_per(float* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca float*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store float* %0, float** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %12
%16 = load i32, i32* %9
%17 = call i32 @gmod(i32 %15, i32 %16)
store i32 %17, i32* %12
%18 = load i32, i32* %13
%19 = load i32, i32* %10
%20 = call i32 @gmod(i32 %18, i32 %19)
store i32 %20, i32* %13
%21 = load float*, float** %8
%22 = load i32, i32* %9
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = load i32, i32* %12
%26 = load i32, i32* %13
%27 = load i32, i32* %14
%28 = call float @getsample_abort(float* %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27)
ret float %28
}

LLVM IR (-O2):
define float @getsample_per(float* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @gmod(i32 %4, i32 %1)
%9 = tail call i32 @gmod(i32 %5, i32 %2)
%10 = tail call float @getsample_abort(float* %0, i32 %1, i32 %2, i32 %3, i32 %8, i32 %9, i32 %6)
ret float %10
}
void foo(unsigned long ul) {
  unsigned int u;
  u = *(unsigned long *)ul;
}


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

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

LLVM IR (-O0):
define void @foo(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i64*
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0) {
ret void
}
void testOdd() {}


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

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

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

LLVM IR (-O2):
define void @testOdd() {
ret void
}
/* Variables and functions */
int MemcmpLowercase(void const *, void const *, size_t);
int SCMemcmpLowercase(const void *s1, const void *s2, size_t len) {
  return MemcmpLowercase(s1, s2, len);
}


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

x86 assembly (clang, -O2):
<SCMemcmpLowercase>:
jmp    1030 <MemcmpLowercase@plt>

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

LLVM IR (-O2):
define i32 @SCMemcmpLowercase(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @MemcmpLowercase(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int sym_equal_fn(void *x, void *y) { return !strcmp((char *)x, (char *)y); }


x86 assembly (clang, -O0):
<sym_equal_fn>:
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 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sym_equal_fn>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sym_equal_fn(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 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @sym_equal_fn(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_carry_scmul_121666(uintptr_t, uintptr_t);
void fiat_25519_carry_scmul_121666(uint32_t out1[10], const uint32_t arg1[10]) {
  internal_fiat_25519_carry_scmul_121666((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_25519_carry_scmul_121666>:
jmp    1030 <internal_fiat_25519_carry_scmul_121666@plt>

LLVM IR (-O0):
define void @fiat_25519_carry_scmul_121666(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_25519_carry_scmul_121666(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_carry_scmul_121666(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_25519_carry_scmul_121666(i64 %3, i64 %4)
ret void
}
void lws_latency_pre(struct libwebsocket_context *context,
                     struct libwebsocket *wsi) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<lws_latency_pre>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1111 <lws_latency_pre+0x11>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.libwebsocket_context = type opaque
%struct.libwebsocket = type opaque
define void @lws_latency_pre(%struct.libwebsocket_context* %0, %struct.libwebsocket* %1) {
%3 = alloca %struct.libwebsocket_context*
%4 = alloca %struct.libwebsocket*
store %struct.libwebsocket_context* %0, %struct.libwebsocket_context** %3
store %struct.libwebsocket* %1, %struct.libwebsocket** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.libwebsocket_context = type opaque
%struct.libwebsocket = type opaque
define void @lws_latency_pre(%struct.libwebsocket_context* nocapture %0, %struct.libwebsocket* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ start_ccw(int, int, int, void *);
void ccw_write_tapemark(void) { start_ccw(0x1f, 0x20, 0x1, ((void *)0)); }


x86 assembly (clang, -O0):
<ccw_write_tapemark>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f,%edi
mov    $0x20,%esi
mov    $0x1,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <start_ccw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccw_write_tapemark>:
mov    $0x1f,%edi
mov    $0x20,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
jmp    1030 <start_ccw@plt>

LLVM IR (-O0):
define void @ccw_write_tapemark() {
%1 = call i32 @start_ccw(i32 31, i32 32, i32 1, i8* null)
ret void
}

LLVM IR (-O2):
define void @ccw_write_tapemark() {
%1 = tail call i32 @start_ccw(i32 31, i32 32, i32 1, i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void fsetown(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


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

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

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

LLVM IR (-O2):
define void @fsetown() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cursorsave(void) {
  printf("\x1b"
         "7");
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"\1B7\00"
define void @cursorsave() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1B7\00"
define void @cursorsave() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
assert(b) {
  if (!b) {
    void abort(void);
    abort();
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112a <assert+0x1a>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
push   %rax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
ret i32 undef
}
/* Variables and functions */
__attribute__((const)) size_t order(size_t l) {
  size_t order = 0;
  size_t current = 1;
  if (!l)
    return 0;
  while ((l & current) == 0) {
    current <<= 1;
    order++;
  }
  return order;
}


x86 assembly (clang, -O0):
<order>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1130 <order+0x30>
movq   $0x0,-0x8(%rbp)
jmp    116c <order+0x6c>
jmp    1135 <order+0x35>
mov    -0x10(%rbp),%rax
and    -0x20(%rbp),%rax
cmp    $0x0,%rax
jne    1164 <order+0x64>
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <order+0x35>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<order>:
xor    %eax,%eax
test   %rdi,%rdi
je     112c <order+0x2c>
mov    %edi,%ecx
and    $0x1,%ecx
test   %rcx,%rcx
jne    112c <order+0x2c>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    %rcx,%rcx
add    $0x1,%rax
test   %rdi,%rcx
je     1120 <order+0x20>
ret

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

LLVM IR (-O2):
define i64 @order(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = and i64 %0, 1
%4 = icmp eq i64 %3, 0
%5 = and i1 %2, %4
br i1 %5, label %6, label %13
6: ; preds = %1, %6
%7 = phi i64 [ %9, %6 ], [ 1, %1 ]
%8 = phi i64 [ %10, %6 ], [ 0, %1 ]
%9 = shl i64 %7, 1
%10 = add i64 %8, 1
%11 = and i64 %9, %0
%12 = icmp eq i64 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %1
%14 = phi i64 [ 0, %1 ], [ %10, %6 ]
ret i64 %14
}
int test_imm_04int16_mem(short *val) {
  return ((*val) & (0x04 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_04int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 4
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int clock_t;

/* Variables and functions */
clock_t times(struct tms *buf) { return -1; }


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

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

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @times(%struct.tms* nocapture readnone %0) {
ret i32 -1
}