xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ mgetline(char *, int);
int /*<<< orphan*/ printf(char *, int);
int strend(char *, char *);
int main(void) {
  char s[1000], t[1000];
  int ret;
  mgetline(s, 1000);
  mgetline(t, 1000);
  ret = strend(s, t);
  printf("%d", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <mgetline@plt>
lea    -0x7e0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <mgetline@plt>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1040 <strend@plt>
mov    %eax,-0x7e4(%rbp)
mov    -0x7e4(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7d8,%rsp
lea    0x3f0(%rsp),%r14
mov    %r14,%rdi
mov    $0x3e8,%esi
call   1050 <mgetline@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <mgetline@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strend@plt>
lea    0xe8f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x7d8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca [1000 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i32 @mgetline(i8* %5, i32 1000)
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%8 = call i32 @mgetline(i8* %7, i32 1000)
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%11 = call i32 @strend(i8* %9, i8* %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @mgetline(i8* %3, i32 1000)
%6 = call i32 @mgetline(i8* %4, i32 1000)
%7 = call i32 @strend(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
void quick_exit(const int status) { _Exit(status); }


x86 assembly (clang, -O0):
<quick_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_Exit@plt>

x86 assembly (clang, -O2):
<quick_exit>:
push   %rax
call   1030 <_Exit@plt>

LLVM IR (-O0):
define void @quick_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @quick_exit(i32 %0) {
tail call void @_Exit(i32 %0)
unreachable
}
/* Variables and functions */
int __ffs(unsigned long);
int ffz(unsigned long bitmask) { return __ffs(~bitmask); }


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

x86 assembly (clang, -O2):
<ffz>:
not    %rdi
jmp    1030 <__ffs@plt>

LLVM IR (-O0):
define i32 @ffz(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i32 @__ffs(i64 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ffz(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i32 @__ffs(i64 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ glk_put_string(char *);
void trm_xstr(char *str) { glk_put_string(str); }


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

x86 assembly (clang, -O2):
<trm_xstr>:
jmp    1030 <glk_put_string@plt>

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

LLVM IR (-O2):
define void @trm_xstr(i8* %0) {
%2 = tail call i32 @glk_put_string(i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int cpu_read_long(int);
uint32_t cpu_read_byte(uint32_t address) {
  uint32_t l = cpu_read_long(address & ~3);
  l >>= 24 - (address & 3) * 8;
  return l & 0xff;
}


x86 assembly (clang, -O0):
<cpu_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xfffffffc,%edi
call   1030 <cpu_read_long@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
shl    $0x3,%eax
mov    $0x18,%ecx
sub    %eax,%ecx
mov    -0x8(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_read_byte>:
push   %rbx
mov    %edi,%ebx
and    $0xfffffffc,%edi
call   1030 <cpu_read_long@plt>
shl    $0x3,%ebx
not    %bl
and    $0x18,%bl
mov    %ebx,%ecx
sar    %cl,%eax
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpu_read_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, -4
%6 = call i32 @cpu_read_long(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %7, 3
%9 = mul nsw i32 %8, 8
%10 = sub nsw i32 24, %9
%11 = load i32, i32* %3
%12 = ashr i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = and i32 %13, 255
ret i32 %14
}

LLVM IR (-O2):
define i32 @cpu_read_byte(i32 %0) {
%2 = and i32 %0, -4
%3 = tail call i32 @cpu_read_long(i32 %2)
%4 = shl i32 %0, 3
%5 = and i32 %4, 24
%6 = xor i32 %5, 24
%7 = ashr i32 %3, %6
%8 = and i32 %7, 255
ret i32 %8
}
void vset(double *v, double x, double y, double z) {
  v[0] = x;
  v[1] = y;
  v[2] = z;
}


x86 assembly (clang, -O0):
<vset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vset>:
movsd  %xmm0,(%rdi)
movsd  %xmm1,0x8(%rdi)
movsd  %xmm2,0x10(%rdi)
ret

LLVM IR (-O0):
define void @vset(double* %0, double %1, double %2, double %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double* %0, double** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double, double* %7
%13 = load double*, double** %5
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double, double* %8
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 2
store double %15, double* %17
ret void
}

LLVM IR (-O2):
define void @vset(double* nocapture writeonly %0, double %1, double %2, double %3) {
store double %1, double* %0
%5 = getelementptr inbounds double, double* %0, i64 1
store double %2, double* %5
%6 = getelementptr inbounds double, double* %0, i64 2
store double %3, double* %6
ret void
}
/* Variables and functions */
char const *tcbdberrmsg(int);
const char *tcqdberrmsg(int ecode) { return tcbdberrmsg(ecode); }


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

x86 assembly (clang, -O2):
<tcqdberrmsg>:
jmp    1030 <tcbdberrmsg@plt>

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

LLVM IR (-O2):
define i8* @tcqdberrmsg(i32 %0) {
%2 = tail call i8* @tcbdberrmsg(i32 %0)
ret i8* %2
}
/* Variables and functions */
long double expm1l(long double);
long double test4l(long double x) { return expm1l(x); }


x86 assembly (clang, -O0):
<test4l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expm1l@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4l>:
jmp    1030 <expm1l@plt>

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

LLVM IR (-O2):
define x86_fp80 @test4l(x86_fp80 %0) {
%2 = tail call x86_fp80 @expm1l(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
int read_pipe(int pipe, char *buffer) {
  int rd = read(pipe, buffer, 4096 - 1);
  if (rd == -1) {
    perror("read pipe");
    return 0;
  }
  buffer[rd] = 0;
  return rd;
}


x86 assembly (clang, -O0):
<read_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0xfff,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1165 <read_pipe+0x45>
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1177 <read_pipe+0x57>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pipe>:
push   %rbx
mov    %rsi,%rbx
mov    $0xfff,%edx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     113c <read_pipe+0x1c>
movslq %eax,%rcx
movb   $0x0,(%rbx,%rcx,1)
pop    %rbx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"read pipe\00"
define i32 @read_pipe(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = call i32 @read(i32 %7, i8* %8, i32 4095)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %20
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
%19 = load i32, i32* %6
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [10 x i8] c"read pipe\00"
define i32 @read_pipe(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i8* %1, i32 4095)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %2
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ 0, %5 ], [ %3, %7 ]
ret i32 %11
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
int ioctl(int /*<<< orphan*/, int /*<<< orphan*/, struct winsize *);
int main() {
  struct winsize s;
  int status = ioctl(0, TIOCGWINSZ, &s);
  return s.ws_col;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
xor    %edi,%edi
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.winsize
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 0, i32 %4, %struct.winsize* %2)
store i32 %5, i32* %3
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @main() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 0, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void yy_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<yy_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yy_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *);
int main(void) {
  char s[] = "Daniel Marchena Parreira";
  reverse(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed2(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xeee(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [25 x i8] c"Daniel Marchena Parreira\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8]
store i32 0, i32* %1
%3 = bitcast [25 x i8]* %2 to i8*
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = call i32 @reverse(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [25 x i8] c"Daniel Marchena Parreira\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char const *, char *);
int /*<<< orphan*/ synerr(char *);
void format_synerr(const char msg[], char arg[]) {
  char errmsg[2048];
  (void)sprintf(errmsg, msg, arg);
  synerr(errmsg);
}


x86 assembly (clang, -O0):
<format_synerr>:
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
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
call   1030 <synerr@plt>
add    $0x810,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @format_synerr(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 @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 @synerr(i8* %10)
ret void
}

LLVM IR (-O2):
define void @format_synerr(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 @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 @synerr(i8* %4)
ret void
}
/* Variables and functions */
double datetime_stamp_now();
int /*<<< orphan*/ printf(char *, double);
int main(int argc, const char *argv[]) {
  printf("timstamp (ms) for now is: %.3f ms\n", datetime_stamp_now());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <datetime_stamp_now@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <datetime_stamp_now@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"timstamp (ms) for now is: %.3f ms\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call double (...) @datetime_stamp_now()
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"timstamp (ms) for now is: %.3f ms\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double (...) @datetime_stamp_now()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ make_blocks();
void *thread_func(void *x_void_ptr) {
  make_blocks();
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @make_blocks()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_func(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @make_blocks()
ret i8* null
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t modrm_i_to_m() { return 0x05; }


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

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

LLVM IR (-O0):
define i32 @modrm_i_to_m() {
ret i32 5
}

LLVM IR (-O2):
define i32 @modrm_i_to_m() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ uprintf(char *);
void ShortReportMaxPoolUsages(void) {
  uprintf("\t----- Max usage not available--------");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"\09----- Max usage not available--------\00"
define void @ShortReportMaxPoolUsages() {
%1 = call i32 @uprintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"\09----- Max usage not available--------\00"
define void @ShortReportMaxPoolUsages() {
%1 = tail call i32 @uprintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_del(struct event *);
int /*<<< orphan*/ free(struct event *);
void rdns_libevent_del_read(void *priv_data, void *ev_data) {
  struct event *ev = ev_data;
  if (ev != NULL) {
    event_del(ev);
    free(ev);
  }
}


x86 assembly (clang, -O0):
<rdns_libevent_del_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1155 <rdns_libevent_del_read+0x35>
mov    -0x18(%rbp),%rdi
call   1040 <event_del@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdns_libevent_del_read>:
test   %rsi,%rsi
je     113a <rdns_libevent_del_read+0x1a>
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1040 <event_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.event = type { i32 }
define void @rdns_libevent_del_read(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.event*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.event*
store %struct.event* %7, %struct.event** %5
%8 = load %struct.event*, %struct.event** %5
%9 = icmp ne %struct.event* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load %struct.event*, %struct.event** %5
%12 = call i32 @event_del(%struct.event* %11)
%13 = load %struct.event*, %struct.event** %5
%14 = call i32 @free(%struct.event* %13)
br label %15
15: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.event = type { i32 }
define void @rdns_libevent_del_read(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.event*
%4 = icmp eq i8* %1, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @event_del(%struct.event* %3)
%7 = tail call i32 @free(%struct.event* %3)
br label %8
8: ; preds = %5, %2
ret void
}
/* Type definitions */
struct tree {
  int dummy;
};
struct node {
  int dummy;
};

/* Variables and functions */
struct node *tree_RB_MINMAX(struct tree *, int);
__attribute__((unused)) struct node *tree_max_node(struct tree *t) {
  return tree_RB_MINMAX(t, 1);
}


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
%struct.tree = type { i32 }
define %struct.node* @tree_max_node(%struct.tree* %0) {
%2 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %2
%3 = load %struct.tree*, %struct.tree** %2
%4 = call %struct.node* @tree_RB_MINMAX(%struct.tree* %3, i32 1)
ret %struct.node* %4
}

LLVM IR (-O2):
%struct.node = type { i32 }
%struct.tree = type { i32 }
define %struct.node* @tree_max_node(%struct.tree* %0) {
%2 = tail call %struct.node* @tree_RB_MINMAX(%struct.tree* %0, i32 1)
ret %struct.node* %2
}
int free_riva_power_on_lock(char *driver_name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @free_riva_power_on_lock(i8* nocapture readnone %0) {
ret i32 0
}
int phys_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @phys_init() {
ret i32 0
}
/* Type definitions */
struct floc {
  int dummy;
};

/* Variables and functions */
void *calloc(unsigned int, int);
int /*<<< orphan*/ fatal(struct floc *, int /*<<< orphan*/);
int /*<<< orphan*/ gettext(char *);
void *xcalloc(unsigned int size) {
  void *result = calloc(size ? size : 1, 1);
  if (result == 0)
    fatal(((struct floc *)0), gettext("virtual memory exhausted"));
  return result;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1150 <xcalloc+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    115d <xcalloc+0x2d>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <xcalloc+0x2d>
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1190 <xcalloc+0x60>
lea    0xe80(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1162 <xcalloc+0x32>
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1050 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.floc = type { i32 }
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xcalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i32 [ %7, %6 ], [ 1, %8 ]
%11 = call i8* @calloc(i32 %10, i32 1)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = call i32 @gettext(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @fatal(%struct.floc* null, i32 %15)
br label %17
17: ; preds = %14, %9
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
%struct.floc = type { i32 }
@.str = [25 x i8] c"virtual memory exhausted\00"
define noalias i8* @xcalloc(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @gettext(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @fatal(%struct.floc* null, i32 %7)
br label %9
9: ; preds = %6, %1
ret i8* %4
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void client_posix_sleep(unsigned msecs) {
  struct timespec ts;
  ts.tv_sec = msecs / 1000;
  ts.tv_nsec = (msecs % 1000) * 1000 * 1000;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<client_posix_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3e8,%edx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_posix_sleep>:
push   %rax
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %eax,(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @client_posix_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000
%9 = mul i32 %8, 1000
%10 = mul i32 %9, 1000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %10, i32* %11
%12 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @client_posix_sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = udiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = urem i32 %0, 1000
%7 = mul nuw nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
int main() { return boo((int[]){0, 2}); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x200000000,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <boo@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 0, i32* %2
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 2, i32* %3
%4 = call i32 (i32*, ...) bitcast (i32 (...)* @boo to i32 (i32*, ...)*)(i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void fatal(char *why) {
  perror(why);
  exit(1);
}


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

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

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void foo_1_2_1_1_1_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_1_2_2_1_2() {
ret void
}
int islow(char c) {
  if (c <= 'j') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<islow>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x6a,%eax
jg     1123 <islow+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <islow+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islow>:
xor    %eax,%eax
cmp    $0x6b,%dil
setl   %al
ret

LLVM IR (-O0):
define i32 @islow(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 106
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @islow(i8 signext %0) {
%2 = icmp slt i8 %0, 107
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct syslog_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
void syslog_r(int a, struct syslog_data *b, const char *c, ...) {
  (void)a;
  (void)b;
  (void)c;
  StubBug("STUB:"
          "syslog_r");
}


x86 assembly (clang, -O0):
<syslog_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <StubBug@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.syslog_data = type { i32 }
@.str = [14 x i8] c"STUB:syslog_r\00"
define void @syslog_r(i32 %0, %struct.syslog_data* %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca %struct.syslog_data*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.syslog_data* %1, %struct.syslog_data** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load %struct.syslog_data*, %struct.syslog_data** %5
%9 = load i8*, i8** %6
%10 = call i32 @StubBug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.syslog_data = type { i32 }
@.str = [14 x i8] c"STUB:syslog_r\00"
define void @syslog_r(i32 %0, %struct.syslog_data* nocapture readnone %1, i8* nocapture readnone %2, ...) {
%4 = tail call i32 @StubBug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generic_tower(double, double, double, double, int);
void tower(double x, double y, double r, double h) {
  generic_tower(x, y, r, h, 1);
}


x86 assembly (clang, -O0):
<tower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mov    $0x1,%edi
call   1030 <generic_tower@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @tower(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @generic_tower(double %0, double %1, double %2, double %3, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int ustrlen(wchar_t *s) {
  int len = 0;
  while (*s++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<ustrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,(%rax)
je     1135 <ustrlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ustrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustrlen>:
cmpl   $0x0,(%rdi)
je     111c <ustrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,0x4(%rdi,%rax,4)
lea    0x1(%rax),%rax
jne    1110 <ustrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ustrlen(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int restore_standard_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(48, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<restore_standard_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x30,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_standard_solutions>:
mov    $0x30,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @restore_standard_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 48, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @restore_standard_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 48, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
adrreg0imm1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[10000000]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl 0x1312d00(%rax),%eax
cmp    $0x21,%eax
jg     113f <adrreg0imm1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <adrreg0imm1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0imm1>:
xor    %eax,%eax
cmpw   $0x22,0x1312d00(%r8)
01 22
setb   %al
ret

LLVM IR (-O0):
define i32 @adrreg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
%18 = load i16, i16* %17
%19 = zext i16 %18 to i32
%20 = icmp sle i32 %19, 33
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @adrreg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = icmp ult i16 %8, 34
%10 = zext i1 %9 to i32
ret i32 %10
}
__attribute__((always_)) int string_poschar(char *str, char c) {
  int pos = 0;
  char *p = str;
  while (*p == c) {
    ++pos;
    ++p;
  }
  return ((pos == 0) ? 0 : (pos - 1));
}


x86 assembly (clang, -O0):
<string_poschar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <string_poschar+0x4a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111d <string_poschar+0x1d>
cmpl   $0x0,-0x10(%rbp)
jne    115e <string_poschar+0x5e>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1167 <string_poschar+0x67>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_poschar>:
xor    %eax,%eax
cmp    %sil,(%rdi)
jne    111f <string_poschar+0x1f>
add    $0x1,%rdi
mov    $0xffffffff,%eax
lea    0x1(%rdi),%rcx
add    $0x1,%eax
cmp    %sil,(%rdi)
mov    %rcx,%rdi
je     1110 <string_poschar+0x10>
ret

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

LLVM IR (-O2):
define i32 @string_poschar(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %0, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %1
br i1 %11, label %5, label %12
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %7, %5 ]
ret i32 %13
}
double inttofl(long int fl) { return (double)fl; }


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

x86 assembly (clang, -O2):
<inttofl>:
cvtsi2sd %rdi,%xmm0
ret

LLVM IR (-O0):
define double @inttofl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @inttofl(i64 %0) {
%2 = sitofp i64 %0 to double
ret double %2
}
int main() {
  int x, y, z;
  x = 0;
  if (y > 5) {
    x++;
    z++;
  } else {
    z++;
  }
  y++;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    1133 <main+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <main+0x3c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ control(int /*<<< orphan*/);
int /*<<< orphan*/ nextchar();
gin() { control(nextchar()); }


x86 assembly (clang, -O0):
<gin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <nextchar@plt>
mov    %eax,%edi
call   1030 <control@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gin>:
push   %rax
xor    %eax,%eax
call   1040 <nextchar@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <control@plt>

LLVM IR (-O0):
define i32 @gin() {
%1 = alloca i32
%2 = call i32 (...) @nextchar()
%3 = call i32 @control(i32 %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @gin() {
%1 = tail call i32 (...) @nextchar()
%2 = tail call i32 @control(i32 %1)
ret i32 undef
}
/* Variables and functions */
int fabs(float);
int unless_strategy(float expr_result) { return fabs(expr_result) < 1e-5; }


x86 assembly (clang, -O0):
<unless_strategy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @unless_strategy(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @fabs(float %3)
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, 1.000000e-05
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @unless_strategy(float %0) {
%2 = tail call i32 @fabs(float %0)
%3 = icmp slt i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
int hash_pointer(const void *p) { return (int)((long)p >> 3); }


x86 assembly (clang, -O0):
<hash_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_pointer>:
mov    %rdi,%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define i32 @hash_pointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = ashr i64 %4, 3
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @hash_pointer(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 3
%4 = trunc i64 %3 to i32
ret i32 %4
}
int nc_(char *carr, long len) { return len; }


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

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

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

LLVM IR (-O2):
define i32 @nc_(i8* nocapture readnone %0, i64 %1) {
%3 = trunc i64 %1 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __bsd___iconv_free_list(char **, size_t);
void __iconv_free_list_compat(char **a, size_t b) {
  __bsd___iconv_free_list(a, b);
}


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

x86 assembly (clang, -O2):
<__iconv_free_list_compat>:
jmp    1030 <__bsd___iconv_free_list@plt>

LLVM IR (-O0):
define void @__iconv_free_list_compat(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 i64, i64* %4
%7 = call i32 @__bsd___iconv_free_list(i8** %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @__iconv_free_list_compat(i8** %0, i64 %1) {
%3 = tail call i32 @__bsd___iconv_free_list(i8** %0, i64 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ selection;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xselection_selection(void *_p) {
  return (unsigned long)((XEvent *)_p)->xselection.selection;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xselection_selection(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xselection_selection(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}