xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char *, char *);
int alpha(char *p1, char *p2) { return (strcmp(p2, p1)); }


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

x86 assembly (clang, -O2):
<alpha>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @alpha(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
ret i32 %3
}
int ulcase(char *string) {
  int chg = 0;
  int lcase = 'a' - 'A';
  char *ch;
  ch = string;
  while (*ch != '\0') {
    if (*ch >= 'A' && *ch <= 'Z') {
      *ch += lcase;
      chg = 1;
    }
    ch++;
  }
  return (chg);
}


x86 assembly (clang, -O0):
<ulcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x20,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1174 <ulcase+0x74>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1163 <ulcase+0x63>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1163 <ulcase+0x63>
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
movl   $0x1,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111e <ulcase+0x1e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulcase>:
mov    (%rdi),%cl
test   %cl,%cl
je     1131 <ulcase+0x31>
add    $0x1,%rdi
xor    %eax,%eax
jmp    111b <ulcase+0x1b>
xchg   %ax,%ax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1130 <ulcase+0x30>
lea    -0x41(%rcx),%edx
cmp    $0x19,%dl
ja     1110 <ulcase+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdi)
mov    $0x1,%eax
jmp    1110 <ulcase+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ulcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %15, %12 ], [ %2, %1 ]
%6 = phi i8* [ %14, %12 ], [ %0, %1 ]
%7 = phi i32 [ %13, %12 ], [ 0, %1 ]
%8 = add i8 %5, -65
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = add nuw nsw i8 %5, 32
store i8 %11, i8* %6
br label %12
12: ; preds = %10, %4
%13 = phi i32 [ 1, %10 ], [ %7, %4 ]
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %12, %1
%18 = phi i32 [ 0, %1 ], [ %13, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rev_string(char *);
int main(void) {
  char s[10] = "Holberton";
  printf("%s\n", s);
  rev_string(s);
  printf("%s\n", s);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0xe(%rbp),%rdi
call   1030 <rev_string@plt>
lea    -0xe(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x6f747265626c6f48,%rax
72 74 6f
mov    %rax,0x8(%rsp)
movw   $0x6e,0x10(%rsp)
lea    0xec6(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <rev_string@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s = [10 x i8] c"Holberton\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = bitcast [10 x i8]* %2 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @rev_string(i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [10 x i8] c"Holberton\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @rev_string(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void fb_hEnd(int unused) {}


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

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

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

LLVM IR (-O2):
define void @fb_hEnd(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sockets_finalize();
int /*<<< orphan*/ sockets_initialize();
int /*<<< orphan*/ useSockets();
void test5(void) {
  sockets_initialize();
  sockets_finalize();
  useSockets();
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sockets_initialize@plt>
mov    $0x0,%al
call   1030 <sockets_finalize@plt>
mov    $0x0,%al
call   1050 <useSockets@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rax
xor    %eax,%eax
call   1040 <sockets_initialize@plt>
xor    %eax,%eax
call   1030 <sockets_finalize@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <useSockets@plt>

LLVM IR (-O0):
define void @test5() {
%1 = call i32 (...) @sockets_initialize()
%2 = call i32 (...) @sockets_finalize()
%3 = call i32 (...) @useSockets()
ret void
}

LLVM IR (-O2):
define void @test5() {
%1 = tail call i32 (...) @sockets_initialize()
%2 = tail call i32 (...) @sockets_finalize()
%3 = tail call i32 (...) @useSockets()
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int comparator(const void *txt1, const void *txt2) {
  return strcmp((char *)txt1, (char *)txt2);
}


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

x86 assembly (clang, -O2):
<comparator>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int testfunc(int a, double b) {
  printf("%d\n", a);
  printf("%f\n", b);
  return a + b;
}


x86 assembly (clang, -O0):
<testfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @testfunc(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %1)
%6 = fadd double %3, %1
%7 = fptosi double %6 to i32
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
scalar_t__ sendfile(int, int, int /*<<< orphan*/ *, unsigned int);
int svz_sendfile(int out_fd, int in_fd, off_t *offset, unsigned int count) {
  ssize_t ret;
  ret = sendfile(out_fd, in_fd, offset, count);
  return (int)ret;
}


x86 assembly (clang, -O0):
<svz_sendfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <sendfile@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svz_sendfile>:
jmp    1030 <sendfile@plt>

LLVM IR (-O0):
define i32 @svz_sendfile(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = call i64 @sendfile(i32 %10, i32 %11, i32* %12, i32 %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @svz_sendfile(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i64 @sendfile(i32 %0, i32 %1, i32* %2, i32 %3)
%6 = trunc i64 %5 to i32
ret i32 %6
}
void sethostent(int x) {}


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

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

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

LLVM IR (-O2):
define void @sethostent(i32 %0) {
ret void
}
void tpd_driver_remove(struct tpd_driver_t *t) {}


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

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

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

LLVM IR (-O2):
%struct.tpd_driver_t = type opaque
define void @tpd_driver_remove(%struct.tpd_driver_t* nocapture %0) {
ret void
}
void Profiler_UninitProfiler() {}


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

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

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

LLVM IR (-O2):
define void @Profiler_UninitProfiler() {
ret void
}
unsigned int getlong(unsigned char *p) {
  return (p[0] | p[1] << 0x08 | p[2] << 0x10 | p[3] << 0x18);
}


x86 assembly (clang, -O0):
<getlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getlong(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @getlong(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookinteger16array_(void *x, unsigned int *n) {
  lookNarray((char *)x, (*n * 16));
}


x86 assembly (clang, -O0):
<lookinteger16array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x4,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookinteger16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookinteger16array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 16
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookinteger16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __set_file_attribute(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
FILE *fopen(const char *filename, const char *mode) {
  FILE *ret;
  ret = (FILE *)malloc(sizeof(FILE));
  if (ret)
    __set_file_attribute(ret);
  return ret;
}


x86 assembly (clang, -O0):
<fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <fopen+0x32>
mov    -0x18(%rbp),%rdi
call   1040 <__set_file_attribute@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113b <fopen+0x1b>
mov    %rbx,%rdi
call   1040 <__set_file_attribute@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = call i32 @__set_file_attribute(i32* %11)
br label %13
13: ; preds = %10, %2
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
define i32* @fopen(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @__set_file_attribute(i32* %4)
br label %8
8: ; preds = %6, %2
ret i32* %4
}
int free_termios(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @free_termios() {
ret i32 0
}
void LCD_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @LCD_RestoreConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lwt_yield(int /*<<< orphan*/ *);
void __lwt_kthd_idle() {
  while (1) {
    lwt_yield((NULL));
  }
}


x86 assembly (clang, -O0):
<__lwt_kthd_idle>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <__lwt_kthd_idle+0x9>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <lwt_yield@plt>
jmp    1119 <__lwt_kthd_idle+0x9>

x86 assembly (clang, -O2):
<__lwt_kthd_idle>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <lwt_yield@plt>
jmp    1120 <__lwt_kthd_idle+0x10>

LLVM IR (-O0):
define void @__lwt_kthd_idle() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @lwt_yield(i32* null)
br label %1
}

LLVM IR (-O2):
define void @__lwt_kthd_idle() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @lwt_yield(i32* null)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ installTokensForTest();
int /*<<< orphan*/ runTokenLookupTests();
int /*<<< orphan*/ runTokenParseTests();
extern void runContractTests(void) {
  installTokensForTest();
  runTokenParseTests();
  runTokenLookupTests();
}


x86 assembly (clang, -O0):
<runContractTests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <installTokensForTest@plt>
mov    $0x0,%al
call   1030 <runTokenParseTests@plt>
mov    $0x0,%al
call   1040 <runTokenLookupTests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<runContractTests>:
push   %rax
xor    %eax,%eax
call   1050 <installTokensForTest@plt>
xor    %eax,%eax
call   1030 <runTokenParseTests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <runTokenLookupTests@plt>

LLVM IR (-O0):
define void @runContractTests() {
%1 = call i32 (...) @installTokensForTest()
%2 = call i32 (...) @runTokenParseTests()
%3 = call i32 (...) @runTokenLookupTests()
ret void
}

LLVM IR (-O2):
define void @runContractTests() {
%1 = tail call i32 (...) @installTokensForTest()
%2 = tail call i32 (...) @runTokenParseTests()
%3 = tail call i32 (...) @runTokenLookupTests()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int *);
int /*<<< orphan*/ walk(int *, int);
void test1() {
  int nums[] = {5, 6, 3, 4};
  walk(nums, 8000000);
  int dest[4];
  merge(nums, dest);
  walk(dest, 8000000);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x7a1200,%esi
call   1040 <walk@plt>
lea    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <merge@plt>
lea    -0x20(%rbp),%rdi
mov    $0x7a1200,%esi
call   1040 <walk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x7a1200,%esi
call   1040 <walk@plt>
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <merge@plt>
mov    %rbx,%rdi
mov    $0x7a1200,%esi
call   1040 <walk@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.test1.nums = [4 x i32] [i32 5, i32 6, i32 3, i32 4]
define void @test1() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%5 = call i32 @walk(i32* %4, i32 8000000)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = call i32 @merge(i32* %6, i32* %7)
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%10 = call i32 @walk(i32* %9, i32 8000000)
ret void
}

LLVM IR (-O2):
@__const.test1.nums = [4 x i32] [i32 5, i32 6, i32 3, i32 4]
define void @test1() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%5 = call i32 @walk(i32* %4, i32 8000000)
%6 = bitcast [4 x i32]* %2 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = call i32 @merge(i32* %4, i32* %7)
%9 = call i32 @walk(i32* %7, i32 8000000)
ret void
}
/* Variables and functions */
float u2f(unsigned int);
int test_float_f2i(unsigned uf) {
  float f = u2f(uf);
  int x = (int)f;
  return x;
}


x86 assembly (clang, -O0):
<test_float_f2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <u2f@plt>
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_float_f2i>:
push   %rax
call   1030 <u2f@plt>
cvttss2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_float_f2i(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call float @u2f(i32 %5)
store float %6, float* %3
%7 = load float, float* %3
%8 = fptosi float %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_float_f2i(i32 %0) {
%2 = tail call float @u2f(i32 %0)
%3 = fptosi float %2 to i32
ret i32 %3
}
/* Variables and functions */
double cos(double);
double sin(double);
double v(double x, double y, double t) { return y * cos(t) - x * sin(t); }


x86 assembly (clang, -O0):
<v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
movaps %xmm2,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @v(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = call double @cos(double %8)
%10 = load double, double* %4
%11 = load double, double* %6
%12 = call double @sin(double %11)
%13 = fmul double %10, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %7, double %9, double %14)
ret double %15
}

LLVM IR (-O2):
define double @v(double %0, double %1, double %2) {
%4 = tail call double @cos(double %2)
%5 = tail call double @sin(double %2)
%6 = fneg double %5
%7 = fmul double %6, %0
%8 = tail call double @llvm.fmuladd.f64(double %1, double %4, double %7)
ret double %8
}
/* Variables and functions */
double M_PI;
double rad(double d) { return d * M_PI / 180.0; }


x86 assembly (clang, -O0):
<rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @rad(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, ...);
void printgoto(int m, int cond) {
  if (cond > 0)
    output(" a?;");
  else if (cond == 0)
    output(" z?;");
  output(" goto L%d;", m);
}


x86 assembly (clang, -O0):
<printgoto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    113b <printgoto+0x2b>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <output@plt>
jmp    1158 <printgoto+0x48>
cmpl   $0x0,-0x8(%rbp)
jne    1153 <printgoto+0x43>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <output@plt>
jmp    1158 <printgoto+0x48>
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printgoto>:
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
jle    1127 <printgoto+0x17>
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <output@plt>
jmp    1129 <printgoto+0x19>
je     113a <printgoto+0x2a>
lea    0xeda(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <output@plt>
lea    0xec4(%rip),%rdi
jmp    111e <printgoto+0xe>

LLVM IR (-O0):
@.str = [5 x i8] c" a?;\00"
@.str.1 = [5 x i8] c" z?;\00"
@.str.2 = [11 x i8] c" goto L%d;\00"
define void @printgoto(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (i8*, ...) @output(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (i8*, ...) @output(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
br label %15
15: ; preds = %14, %7
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @output(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" a?;\00"
@.str.1 = [5 x i8] c" z?;\00"
@.str.2 = [11 x i8] c" goto L%d;\00"
define void @printgoto(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %6, label %9
6: ; preds = %4, %2
%7 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %4 ]
%8 = tail call i32 (i8*, ...) @output(i8* %7)
br label %9
9: ; preds = %6, %4
%10 = tail call i32 (i8*, ...) @output(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int GetTimeStamp();
void Wait(int n) {
  int start, end;
  start = GetTimeStamp();
  while (1) {
    end = GetTimeStamp();
    if ((end - start) > n) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<Wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <GetTimeStamp@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <GetTimeStamp@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1143 <Wait+0x33>
jmp    1148 <Wait+0x38>
jmp    1125 <Wait+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wait>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <GetTimeStamp@plt>
mov    %eax,%ebp
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <GetTimeStamp@plt>
sub    %ebp,%eax
cmp    %ebx,%eax
jle    1120 <Wait+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Wait(i32 %0) {
%2 = tail call i32 (...) @GetTimeStamp()
br label %3
3: ; preds = %3, %1
%4 = tail call i32 (...) @GetTimeStamp()
%5 = sub nsw i32 %4, %2
%6 = icmp sgt i32 %5, %0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ binderfs_test_unprivileged(struct __test_metadata *);
void wrapper_binderfs_test_unprivileged(
    struct __test_metadata *_metadata,
    struct __fixture_variant_metadata *variant) {
  binderfs_test_unprivileged(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_binderfs_test_unprivileged>:
jmp    1030 <binderfs_test_unprivileged@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_binderfs_test_unprivileged(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @binderfs_test_unprivileged(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_binderfs_test_unprivileged(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @binderfs_test_unprivileged(%struct.__test_metadata* %0)
ret void
}
int continuation_symbol() {}


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

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

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

LLVM IR (-O2):
define i32 @continuation_symbol() {
ret i32 undef
}
int cs_diag(int i, int j, double aij, void *other) { return (i != j); }


x86 assembly (clang, -O0):
<cs_diag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_diag>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @cs_diag(i32 %0, i32 %1, double %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp ne i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cs_diag(i32 %0, i32 %1, double %2, i8* nocapture readnone %3) {
%5 = icmp ne i32 %0, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int fat32_rd_n(void const *, int);
unsigned fat32_rd32(const void *p) { return fat32_rd_n(p, 4); }


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

x86 assembly (clang, -O2):
<fat32_rd32>:
mov    $0x4,%esi
jmp    1030 <fat32_rd_n@plt>

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

LLVM IR (-O2):
define i32 @fat32_rd32(i8* %0) {
%2 = tail call i32 @fat32_rd_n(i8* %0, i32 4)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int extractBit(char byte, int pos) {
  assert((pos >= 0) && (pos < 8));
  return ((byte & (1 << pos)) >> pos);
}


x86 assembly (clang, -O0):
<extractBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     113a <extractBit+0x2a>
cmpl   $0x8,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractBit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x8,%esi
setb   %dil
call   1030 <assert@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
and    %ebp,%eax
sar    %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @extractBit(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 8
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = load i32, i32* %4
%17 = shl i32 1, %16
%18 = and i32 %15, %17
%19 = load i32, i32* %4
%20 = ashr i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @extractBit(i8 signext %0, i32 %1) {
%3 = icmp ult i32 %1, 8
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = sext i8 %0 to i32
%7 = shl nuw i32 1, %1
%8 = and i32 %7, %6
%9 = ashr i32 %8, %1
ret i32 %9
}
int decrease_month(int month) {
  int iyear, imonth;
  iyear = month / 100;
  imonth = month % 100;
  imonth--;
  if (imonth == 0) {
    imonth = 12;
    iyear--;
  }
  return (iyear * 100 + imonth);
}


x86 assembly (clang, -O0):
<decrease_month>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1146 <decrease_month+0x46>
movl   $0xc,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
imul   $0x64,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrease_month>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%edx
not    %edx
xor    %esi,%esi
add    %edx,%eax
mov    $0xc,%edx
cmovne %eax,%edx
sete   %sil
sub    %esi,%ecx
imul   $0x64,%ecx,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @decrease_month(i32 %0) {
%2 = sdiv i32 %0, 100
%3 = srem i32 %0, 100
%4 = add nsw i32 %3, -1
%5 = icmp eq i32 %4, 0
%6 = sext i1 %5 to i32
%7 = add nsw i32 %2, %6
%8 = select i1 %5, i32 12, i32 %4
%9 = mul nsw i32 %7, 100
%10 = add nsw i32 %9, %8
ret i32 %10
}
/* Variables and functions */
int Mali_AnyInterruptCheck(int, int, int);
int Mali_InterruptCheck(int i_mask, int i_value) {
  if ((i_mask == i_value) && i_mask == 0xFFFFFFFF) {
    return Mali_AnyInterruptCheck(0, i_mask, i_value);
  } else {
    return Mali_AnyInterruptCheck(3, i_mask, i_value);
  }
}


x86 assembly (clang, -O0):
<Mali_InterruptCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1149 <Mali_InterruptCheck+0x39>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1149 <Mali_InterruptCheck+0x39>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <Mali_AnyInterruptCheck@plt>
mov    %eax,-0x4(%rbp)
jmp    115c <Mali_InterruptCheck+0x4c>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x3,%edi
call   1030 <Mali_AnyInterruptCheck@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_InterruptCheck>:
mov    %esi,%edx
mov    %esi,%eax
and    %edi,%eax
cmp    $0xffffffff,%eax
je     1127 <Mali_InterruptCheck+0x17>
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <Mali_AnyInterruptCheck@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
jmp    1030 <Mali_AnyInterruptCheck@plt>

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

LLVM IR (-O2):
define i32 @Mali_InterruptCheck(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Mali_AnyInterruptCheck(i32 0, i32 -1, i32 %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @Mali_AnyInterruptCheck(i32 3, i32 %0, i32 %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
char *strchr(const char *s, char c) {
  for (; *s; ++s) {
    if (*s == c)
      return (char *)s;
  }
  return (char *)0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <strchr+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    113b <strchr+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <strchr+0x59>
jmp    1140 <strchr+0x40>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <strchr+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <strchr+0x21>
mov    %rdi,%rax
nopl   0x0(%rax)
cmp    %sil,%cl
je     1123 <strchr+0x23>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %11, %9 ], [ %3, %2 ]
%7 = phi i8* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ null, %2 ], [ null, %9 ], [ %7, %5 ]
ret i8* %14
}
void foo543(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo543(i32 %0) {
ret void
}
/* Variables and functions */
#define GLUT_KEY_DOWN 131
#define GLUT_KEY_LEFT 130
#define GLUT_KEY_RIGHT 129
#define GLUT_KEY_UP 128
int /*<<< orphan*/ down();
int /*<<< orphan*/ left();
int /*<<< orphan*/ right();
int /*<<< orphan*/ up();
void special(int key, int x, int y) {
  switch (key) {
  case GLUT_KEY_UP:
    up();
    break;
  case GLUT_KEY_DOWN:
    down();
    break;
  case GLUT_KEY_LEFT:
    left();
    break;
  case GLUT_KEY_RIGHT:
    right();
    break;
  }
}


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     11a5 <special+0x65>
mov    -0x18(%rbp),%rax
lea    0xe8f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <up@plt>
jmp    11a5 <special+0x65>
mov    $0x0,%al
call   1050 <down@plt>
jmp    11a5 <special+0x65>
mov    $0x0,%al
call   1030 <left@plt>
jmp    11a5 <special+0x65>
mov    $0x0,%al
call   1040 <right@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<special>:
add    $0xffffff80,%edi
cmp    $0x3,%edi
ja     115f <special+0x1f>
lea    0xeb1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
jmp    1060 <up@plt>
ret
xor    %eax,%eax
jmp    1040 <right@plt>
xor    %eax,%eax
jmp    1030 <left@plt>
xor    %eax,%eax
jmp    1050 <down@plt>

LLVM IR (-O0):
define void @special(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %16 [
i32 128, label %8
i32 131, label %10
i32 130, label %12
i32 129, label %14
]
8: ; preds = %3
%9 = call i32 (...) @up()
br label %16
10: ; preds = %3
%11 = call i32 (...) @down()
br label %16
12: ; preds = %3
%13 = call i32 (...) @left()
br label %16
14: ; preds = %3
%15 = call i32 (...) @right()
br label %16
16: ; preds = %3, %14, %12, %10, %8
ret void
}

LLVM IR (-O2):
define void @special(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %12 [
i32 128, label %4
i32 131, label %6
i32 130, label %8
i32 129, label %10
]
4: ; preds = %3
%5 = tail call i32 (...) @up()
br label %12
6: ; preds = %3
%7 = tail call i32 (...) @down()
br label %12
8: ; preds = %3
%9 = tail call i32 (...) @left()
br label %12
10: ; preds = %3
%11 = tail call i32 (...) @right()
br label %12
12: ; preds = %3, %10, %8, %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void testDowncast(int a, unsigned char b) {
  if (a <= -10) {
    if ((unsigned char)a == b) {
      clang_analyzer_warnIfReached();
    }
    if (a == b) {
      clang_analyzer_warnIfReached();
    }
  }
}


x86 assembly (clang, -O0):
<testDowncast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
cmpl   $0xfffffff6,-0x4(%rbp)
jg     115f <testDowncast+0x4f>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
movzbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <testDowncast+0x34>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
mov    -0x4(%rbp),%eax
movzbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    115a <testDowncast+0x4a>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
jmp    115f <testDowncast+0x4f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testDowncast>:
cmp    $0xfffffff6,%edi
jg     1121 <testDowncast+0x11>
cmp    %sil,%dil
jne    1121 <testDowncast+0x11>
xor    %eax,%eax
jmp    1030 <clang_analyzer_warnIfReached@plt>
ret

LLVM IR (-O0):
define void @testDowncast(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, -10
br i1 %6, label %7, label %24
7: ; preds = %2
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %10, %12
br i1 %13, label %14, label %16
14: ; preds = %7
%15 = call i32 (...) @clang_analyzer_warnIfReached()
br label %16
16: ; preds = %14, %7
%17 = load i32, i32* %3
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = icmp eq i32 %17, %19
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 (...) @clang_analyzer_warnIfReached()
br label %23
23: ; preds = %21, %16
br label %24
24: ; preds = %23, %2
ret void
}

LLVM IR (-O2):
define void @testDowncast(i32 %0, i8 zeroext %1) {
%3 = icmp slt i32 %0, -9
%4 = trunc i32 %0 to i8
%5 = icmp eq i8 %4, %1
%6 = and i1 %3, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @clang_analyzer_warnIfReached()
br label %9
9: ; preds = %7, %2
ret void
}
unsigned getval_280() { return 3281016873U; }


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

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

LLVM IR (-O0):
define i32 @getval_280() {
ret i32 -1013950423
}

LLVM IR (-O2):
define i32 @getval_280() {
ret i32 -1013950423
}