xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *wmemchr(int /*<<< orphan*/ const *, int /*<<< orphan*/,
                            size_t);
size_t wcsnlen(const wchar_t *s, size_t n) {
  const wchar_t *z = wmemchr(s, 0, n);
  if (z)
    n = z - s;
  return n;
}


x86 assembly (clang, -O0):
<wcsnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <wmemchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <wcsnlen+0x41>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <wmemchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
sar    $0x2,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @wcsnlen(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i64, i64* %4
%8 = call i32* @wmemchr(i32* %6, i32 0, i64 %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32*, i32** %5
%13 = load i32*, i32** %3
%14 = ptrtoint i32* %12 to i64
%15 = ptrtoint i32* %13 to i64
%16 = sub i64 %14, %15
%17 = sdiv exact i64 %16, 4
store i64 %17, i64* %4
br label %18
18: ; preds = %11, %2
%19 = load i64, i64* %4
ret i64 %19
}

LLVM IR (-O2):
define i64 @wcsnlen(i32* %0, i64 %1) {
%3 = tail call i32* @wmemchr(i32* %0, i32 0, i64 %1)
%4 = icmp eq i32* %3, null
%5 = ptrtoint i32* %3 to i64
%6 = ptrtoint i32* %0 to i64
%7 = sub i64 %5, %6
%8 = ashr exact i64 %7, 2
%9 = select i1 %4, i64 %1, i64 %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ external_clocks_on();
int /*<<< orphan*/ init_external_clocks();
void init_clocks() {
  init_external_clocks();
  external_clocks_on();
}


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

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

LLVM IR (-O0):
define void @init_clocks() {
%1 = call i32 (...) @init_external_clocks()
%2 = call i32 (...) @external_clocks_on()
ret void
}

LLVM IR (-O2):
define void @init_clocks() {
%1 = tail call i32 (...) @init_external_clocks()
%2 = tail call i32 (...) @external_clocks_on()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _debugprint(char *);
int /*<<< orphan*/ _testhalt();
void bootentry() {
  _debugprint("Hello again.\n");
  _testhalt();
}


x86 assembly (clang, -O0):
<bootentry>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <_debugprint@plt>
mov    $0x0,%al
call   1040 <_testhalt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bootentry>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <_debugprint@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_testhalt@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello again.\0A\00"
define void @bootentry() {
%1 = call i32 @_debugprint(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @_testhalt()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello again.\0A\00"
define void @bootentry() {
%1 = tail call i32 @_debugprint(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @_testhalt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rpt(char *cc, int n) {
  while (n--)
    printf(cc);
}


x86 assembly (clang, -O0):
<rpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1141 <rpt+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
jmp    111f <rpt+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpt>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     112d <rpt+0x1d>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1120 <rpt+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @rpt(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @printf(i8* dereferenceable(1) %0)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ empty();
int /*<<< orphan*/ test();
int main() {
  test();
  empty();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test@plt>
mov    $0x0,%al
call   1030 <empty@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test@plt>
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test()
%3 = call i32 (...) @empty()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 (...) @empty()
ret i32 0
}
void rop3_162_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = *D & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_162_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_162_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8, i8* %6
%48 = zext i8 %47 to i32
%49 = and i32 %46, %48
%50 = or i32 %43, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_162_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
int test_imm_F3int8_mem(signed char *val) {
  return ((*val) & (-0xF3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F3int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff0d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F3int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -243
%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_F3int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -243
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thr_fn1(void *arg) {
  printf("this is thread 1\n");
  return ((void *)1);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"this is thread 1\0A\00"
define i8* @thr_fn1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
@str = [17 x i8] c"this is thread 1\00"
define i8* @thr_fn1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}
double DegreesToRadians(const double degrees) {
  return (3.14159265358979323846264338327950288419716939937510 * degrees /
          180.0);
}


x86 assembly (clang, -O0):
<DegreesToRadians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DegreesToRadians>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @DegreesToRadians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x400921FB54442D18, %3
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @DegreesToRadians(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ nocbreak();
void exitapp() {
  nocbreak();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<exitapp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <nocbreak@plt>
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exitapp>:
push   %rax
xor    %eax,%eax
call   1040 <nocbreak@plt>
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @exitapp() {
%1 = call i32 (...) @nocbreak()
%2 = call i32 (...) @endwin()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exitapp() {
%1 = tail call i32 (...) @nocbreak()
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @exit(i32 0)
unreachable
}
char *strcpy(char *destination, const char *source) {
  char *res = destination;
  while (*source)
    *(destination++) = *(source++);
  *destination = 0;
  return res;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ ungetkey(int /*<<< orphan*/);
int /*<<< orphan*/ xgetkey(int, size_t);
void waitkey(size_t timeout) { ungetkey(xgetkey(0001, timeout)); }


x86 assembly (clang, -O0):
<waitkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1040 <xgetkey@plt>
mov    %eax,%edi
call   1030 <ungetkey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitkey>:
push   %rax
mov    %rdi,%rsi
mov    $0x1,%edi
call   1040 <xgetkey@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ungetkey@plt>

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

LLVM IR (-O2):
define void @waitkey(i64 %0) {
%2 = tail call i32 @xgetkey(i32 1, i64 %0)
%3 = tail call i32 @ungetkey(i32 %2)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int rand();
uint64_t rand8(void) { return rand() & 0xff; }


x86 assembly (clang, -O0):
<rand8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand8>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand8() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 255
ret i32 %2
}

LLVM IR (-O2):
define i32 @rand8() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void putt(int level) {
  while (level--)
    putchar('\t');
}


x86 assembly (clang, -O0):
<putt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <putt+0x2e>
mov    $0x9,%edi
call   1030 <putchar@plt>
jmp    111b <putt+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putt>:
push   %rbx
test   %edi,%edi
je     112f <putt+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <putt+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @putt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @putchar(i8 signext 9)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @putt(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 9)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double acosl(long double x) { return __infer_nondet_long_double(); }


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

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

LLVM IR (-O0):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
void caller_1_2_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_2_2_2_1_2() {
ret void
}
/* Type definitions */
typedef size_t uint8_t;
typedef size_t int8_t;

/* Variables and functions */
uint8_t pop(int8_t *stack, uint8_t *sp) { return stack[--*sp]; }


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0xffffffffffffffff,%rsi
mov    %rsi,(%rdx)
mov    -0x8(%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
mov    (%rsi),%rax
lea    -0x1(%rax),%rcx
mov    %rcx,(%rsi)
mov    -0x8(%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i64 @pop(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64*, i64** %4
%7 = load i64, i64* %6
%8 = add i64 %7, -1
store i64 %8, i64* %6
%9 = getelementptr inbounds i64, i64* %5, i64 %8
%10 = load i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @pop(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = add i64 %3, -1
store i64 %4, i64* %1
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
ret i64 %6
}
void foo(void) {
  int a, b, c;
#pragma omp target enter data map(alloc : a) map(to : b) map(alloc : c)
#pragma omp target exit data map(from : a) map(release : b) map(from : c)
#pragma omp target map(alloc : a) map(tofrom : b) map(alloc : c)
  a = b = c = 1;
#pragma omp target enter data map(to : a) map(alloc : b) map(to : c)
#pragma omp target exit data map(from : a) map(delete : b) map(from : c)
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
unicode_to_utf8() {}


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

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

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

LLVM IR (-O2):
define i32 @unicode_to_utf8() {
ret i32 undef
}
/* Variables and functions */
int mult(int, int);
extern long random(void) {
  int seed;
  int tmp;
  {
    {
      seed = 23456;
      tmp = mult(seed, 31415821);
      seed = tmp + 1;
    }
    return ((long)seed);
  }
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5ba0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1df5e0d,%esi
call   1030 <mult@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
push   %rax
mov    $0x5ba0,%edi
mov    $0x1df5e0d,%esi
call   1030 <mult@plt>
add    $0x1,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @random() {
%1 = alloca i32
%2 = alloca i32
store i32 23456, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @mult(i32 %3, i32 31415821)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @random() {
%1 = tail call i32 @mult(i32 23456, i32 31415821)
%2 = add nsw i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Type definitions */
struct btf_type {
  int dummy;
};
struct btf_param {
  int dummy;
};

/* Variables and functions */
struct btf_param *btf_params(const struct btf_type *t) {
  return (struct btf_param *)(t + 1);
}


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

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

LLVM IR (-O0):
%struct.btf_param = type { i32 }
%struct.btf_type = type { i32 }
define %struct.btf_param* @btf_params(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i64 1
%5 = bitcast %struct.btf_type* %4 to %struct.btf_param*
ret %struct.btf_param* %5
}

LLVM IR (-O2):
%struct.btf_param = type { i32 }
%struct.btf_type = type { i32 }
define %struct.btf_param* @btf_params(%struct.btf_type* readnone %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 1
%3 = bitcast %struct.btf_type* %2 to %struct.btf_param*
ret %struct.btf_param* %3
}
/* Variables and functions */
double trunc(double);
__attribute__((__target__("sse4.1"))) double
get_fractional_part_signed(double f) {
  return f - trunc(f);
}


x86 assembly (clang, -O0):
<get_fractional_part_signed>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
roundsd $0xb,%xmm1,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fractional_part_signed>:
roundsd $0xb,%xmm0,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @get_fractional_part_signed(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.trunc.f64(double %4)
%6 = fsub double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @get_fractional_part_signed(double %0) {
%2 = tail call double @llvm.trunc.f64(double %0)
%3 = fsub double %0, %2
ret double %3
}
/* Variables and functions */
unsigned long gcd(unsigned long, unsigned long);
unsigned long lcm(unsigned long x, unsigned long y) {
  return (x * y) / gcd(x, y);
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
xor    %edx,%edx
div    %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %rsi,%rbx
imul   %rdi,%rbx
call   1030 <gcd@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1133 <lcm+0x23>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @lcm(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i64 @gcd(i64 %8, i64 %9)
%11 = udiv i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @lcm(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i64 @gcd(i64 %0, i64 %1)
%5 = udiv i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_glsl_block_comment() {
  test_parser_verify_parse(test_parser_sourcefile("glsl", "/*glsl*/"), "glsl",
                           "", "/*glsl*/", 0);
}


x86 assembly (clang, -O0):
<test_glsl_block_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec6(%rip),%rdx
lea    0xeb7(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_glsl_block_comment>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed3(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xec9(%rip),%rdx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"glsl\00"
@.str.1 = [9 x i8] c"/*glsl*/\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_glsl_block_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"glsl\00"
@.str.1 = [9 x i8] c"/*glsl*/\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_glsl_block_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f6(int a) {
  if (4 / a == 5)
    link_error();
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%eax
cltd
idivl  -0x4(%rbp)
cmp    $0x5,%eax
jne    1134 <f6+0x24>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f6(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errnoAbort(char *);
int netReadAll(int, void *, size_t);
int netMustReadAll(int sd, void *vBuf, size_t size) {
  int ret = netReadAll(sd, vBuf, size);
  if (ret < 0)
    errnoAbort("Couldn't finish netReadAll");
  return ret;
}


x86 assembly (clang, -O0):
<netMustReadAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <netReadAll@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    115c <netMustReadAll+0x3c>
lea    0xea9(%rip),%rdi
call   1030 <errnoAbort@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netMustReadAll>:
push   %rbx
call   1040 <netReadAll@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <netMustReadAll+0x18>
lea    0xecd(%rip),%rdi
call   1030 <errnoAbort@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Couldn't finish netReadAll\00"
define i32 @netMustReadAll(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @netReadAll(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @errnoAbort(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [27 x i8] c"Couldn't finish netReadAll\00"
define i32 @netMustReadAll(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @netReadAll(i32 %0, i8* %1, i64 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @errnoAbort(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
char tolower(char);
void lcase(char *str) {
  while (*str) {
    *str = tolower(*str);
    ++str;
  }
}


x86 assembly (clang, -O0):
<lcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <lcase+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lcase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lcase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lcase+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
long __ccaprice_syscall_args_6(long A0, long A1, long A2, long A3, long A4,
                               long A5, long A6) {
  unsigned long R;
  register long R10 __asm__("r10") = A4;
  register long R08 __asm__("r8") = A5;
  register long R09 __asm__("r9") = A6;
  __asm__ __volatile__("syscall"
                       : "=a"(R)
                       : "a"(A0), "D"(A1), "S"(A2), "d"(A3), "r"(R10), "r"(R08),
                         "r"(R09)
                       : "rcx", "r11", "memory");
  return R;
}


x86 assembly (clang, -O0):
<__ccaprice_syscall_args_6>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x40(%rbp),%r10
mov    -0x48(%rbp),%r8
mov    -0x50(%rbp),%r9
syscall
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccaprice_syscall_args_6>:
mov    %r9,%r11
mov    %rdi,%rax
mov    0x8(%rsp),%r9
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%r10
mov    %r11,%r8
syscall
ret

LLVM IR (-O0):
define i64 @__ccaprice_syscall_args_6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%19 = load i64, i64* %12
store i64 %19, i64* %16
%20 = load i64, i64* %13
store i64 %20, i64* %17
%21 = load i64, i64* %14
store i64 %21, i64* %18
%22 = load i64, i64* %8
%23 = load i64, i64* %9
%24 = load i64, i64* %10
%25 = load i64, i64* %11
%26 = load i64, i64* %16
%27 = load i64, i64* %17
%28 = load i64, i64* %18
%29 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},{r8},{r9},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %22, i64 %23, i64 %24, i64 %25, i64 %26, i64 %27, i64 %28)
store i64 %29, i64* %15
%30 = load i64, i64* %15
ret i64 %30
}

LLVM IR (-O2):
define i64 @__ccaprice_syscall_args_6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},{r8},{r9},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6)
ret i64 %8
}
int lvalue_type(int t) {
  int bt, r;
  r = 0x0100;
  bt = t & 0x000f;
  if (bt == 1 || bt == 11)
    r |= 0x1000;
  else if (bt == 2)
    r |= 0x2000;
  else
    return r;
  if (t & 0x0010)
    r |= 0x4000;
  return r;
}


x86 assembly (clang, -O0):
<lvalue_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x100,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     112b <lvalue_type+0x2b>
cmpl   $0xb,-0xc(%rbp)
jne    113b <lvalue_type+0x3b>
mov    -0x10(%rbp),%eax
or     $0x1000,%eax
mov    %eax,-0x10(%rbp)
jmp    1165 <lvalue_type+0x65>
cmpl   $0x2,-0xc(%rbp)
jne    1155 <lvalue_type+0x55>
mov    -0x10(%rbp),%eax
or     $0x2000,%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <lvalue_type+0x60>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <lvalue_type+0x85>
jmp    1165 <lvalue_type+0x65>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     117f <lvalue_type+0x7f>
mov    -0x10(%rbp),%eax
or     $0x4000,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvalue_type>:
mov    %edi,%ecx
and    $0xf,%ecx
mov    $0x1100,%eax
cmp    $0x1,%ecx
je     1123 <lvalue_type+0x23>
cmp    $0xb,%ecx
je     1123 <lvalue_type+0x23>
mov    $0x100,%eax
cmp    $0x2,%ecx
jne    112d <lvalue_type+0x2d>
mov    $0x2100,%eax
and    $0x10,%edi
shl    $0xa,%edi
or     %eax,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @lvalue_type(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 256, i32* %5
%6 = load i32, i32* %3
%7 = and i32 %6, 15
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 11
br i1 %12, label %13, label %16
13: ; preds = %10, %1
%14 = load i32, i32* %5
%15 = or i32 %14, 4096
store i32 %15, i32* %5
br label %25
16: ; preds = %10
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 2
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %5
%21 = or i32 %20, 8192
store i32 %21, i32* %5
br label %24
22: ; preds = %16
%23 = load i32, i32* %5
store i32 %23, i32* %2
br label %34
24: ; preds = %19
br label %25
25: ; preds = %24, %13
%26 = load i32, i32* %3
%27 = and i32 %26, 16
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i32, i32* %5
%31 = or i32 %30, 16384
store i32 %31, i32* %5
br label %32
32: ; preds = %29, %25
%33 = load i32, i32* %5
store i32 %33, i32* %2
br label %34
34: ; preds = %32, %22
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @lvalue_type(i32 %0) {
%2 = and i32 %0, 15
switch i32 %2, label %9 [
i32 11, label %4
i32 1, label %4
i32 2, label %3
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %3
%5 = phi i32 [ 8448, %3 ], [ 4352, %1 ], [ 4352, %1 ]
%6 = shl i32 %0, 10
%7 = and i32 %6, 16384
%8 = or i32 %5, %7
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 256, %1 ]
ret i32 %10
}
/* Variables and functions */
char *is_num_pld(int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int hex, n, a, i, j, flag;
  scanf("%d", &a);
  printf("%s\n", is_num_pld(a, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x1c(%rbp),%edi
mov    $0xa,%esi
call   1030 <is_num_pld@plt>
mov    %rax,%rsi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0xa,%esi
call   1030 <is_num_pld@plt>
lea    0xeac(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i8* @is_num_pld(i32 %6, i32 10)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}
unsigned int hash_string(const char *string) {
  unsigned int hash = 0;
  const char *p;
  for (p = string; *p; p++)
    hash = ((hash << 5) + hash) ^ *p;
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <hash_string+0x4a>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <hash_string+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_string+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = mul i32 %7, 33
%9 = sext i8 %5 to i32
%10 = xor i32 %8, %9
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
int main(void) {
  int i = 21;
  return i + i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void *thread_function(void *num) {
  int i;
  time_t start, end;
  start = time(NULL);
  for (i = 0; i < 500000000; i++)
    ;
  end = time(NULL);
  fprintf(stderr, "%ld -> %ld\n", start, end);
  return NULL;
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1dcd6500,-0xc(%rbp)
jge    115f <thread_function+0x3f>
jmp    1151 <thread_function+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <thread_function+0x1f>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe7f(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_function>:
push   %rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%edi
lea    0xebf(%rip),%rsi
mov    %ebx,%edx
mov    %eax,%ecx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"%ld -> %ld\0A\00"
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = call i32 @time(i32* null)
store i32 %6, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %11, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 500000000
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %7
14: ; preds = %7
%15 = call i32 @time(i32* null)
store i32 %15, i32* %5
%16 = load i32, i32* @stderr
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"%ld -> %ld\0A\00"
define noalias i8* @thread_function(i8* nocapture readnone %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @time(i32* null)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_secure_channel_create() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_secure_channel_create>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_secure_channel_create>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_secure_channel_create() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_secure_channel_create() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}