xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ discardheaders(int);
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void bad_request(int client) {
  char *txt = "HTTP/1.0 400 BAD REQUEST\r\n"
              "Content-type: text/html\r\n"
              "\r\n"
              "<P>Your browser sent a bad request, "
              "such as a POST without a Content-Length.\r\n";
  discardheaders(client);
  send(client, txt, strlen(txt), 0);
}


x86 assembly (clang, -O0):
<bad_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <discardheaders@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_request>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1050 <discardheaders@plt>
lea    0xebe(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <send@plt>

LLVM IR (-O0):
@.str = [132 x i8] c"HTTP/1.0 400 BAD REQUEST\0D\0AContent-type: text/html\0D\0A\0D\0A<P>Your browser sent a bad request, such as a POST without a Content-Length.\0D\0A\00"
define void @bad_request(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = call i32 @discardheaders(i32 %4)
%6 = load i32, i32* %2
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @send(i32 %6, i8* %7, i32 %9, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [132 x i8] c"HTTP/1.0 400 BAD REQUEST\0D\0AContent-type: text/html\0D\0A\0D\0A<P>Your browser sent a bad request, such as a POST without a Content-Length.\0D\0A\00"
define void @bad_request(i32 %0) {
%2 = tail call i32 @discardheaders(i32 %0)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @send(i32 %0, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_input(char *input) { printf("%s", input); }


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

x86 assembly (clang, -O2):
<print_input>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_input(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned int charlen(char *);
int /*<<< orphan*/ putchar(char);
void print_cint(char *s) {
  unsigned int len = charlen(s);
  while (len > 0) {
    putchar(*(s + len - 1));
    len--;
  }
}


x86 assembly (clang, -O0):
<print_cint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <charlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1161 <print_cint+0x41>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl -0x1(%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <print_cint+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cint>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <charlen@plt>
test   %eax,%eax
je     1153 <print_cint+0x33>
mov    %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl -0x1(%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
test   %ebx,%ebx
jne    1140 <print_cint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @print_cint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @charlen(i8* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %3
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = getelementptr inbounds i8, i8* %13, i64 -1
%15 = load i8, i8* %14
%16 = call i32 @putchar(i8 signext %15)
%17 = load i32, i32* %3
%18 = add i32 %17, -1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @print_cint(i8* %0) {
%2 = tail call i32 @charlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 -1
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ %5, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @putchar(i8 signext %10)
%12 = add nsw i64 %8, -1
%13 = trunc i64 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ led_init();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ serial_init(int);
int /*<<< orphan*/ test_one(int);
void test_core(void) {
  int reg;
  led_init();
  serial_init(115200);
  test_one(1);
  test_one(2);
  test_one(3);
  puts("Done\n");
}


x86 assembly (clang, -O0):
<test_core>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <led_init@plt>
mov    $0x1c200,%edi
call   1060 <serial_init@plt>
mov    $0x1,%edi
call   1050 <test_one@plt>
mov    $0x2,%edi
call   1050 <test_one@plt>
mov    $0x3,%edi
call   1050 <test_one@plt>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_core>:
push   %rax
xor    %eax,%eax
call   1040 <led_init@plt>
mov    $0x1c200,%edi
call   1060 <serial_init@plt>
mov    $0x1,%edi
call   1050 <test_one@plt>
mov    $0x2,%edi
call   1050 <test_one@plt>
mov    $0x3,%edi
call   1050 <test_one@plt>
lea    0xe89(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Done\0A\00"
define void @test_core() {
%1 = alloca i32
%2 = call i32 (...) @led_init()
%3 = call i32 @serial_init(i32 115200)
%4 = call i32 @test_one(i32 1)
%5 = call i32 @test_one(i32 2)
%6 = call i32 @test_one(i32 3)
%7 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Done\0A\00"
define void @test_core() {
%1 = tail call i32 (...) @led_init()
%2 = tail call i32 @serial_init(i32 115200)
%3 = tail call i32 @test_one(i32 1)
%4 = tail call i32 @test_one(i32 2)
%5 = tail call i32 @test_one(i32 3)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
adrx0adrreg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((((short *)10000000)[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movswl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movswl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     114b <adrx0adrreg1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <adrx0adrreg1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrreg1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    0x87a22(%r9),%cx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @adrx0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = getelementptr inbounds i16, i16* %5, i64 277777
%11 = load i16, i16* %10
%12 = icmp sle i16 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void flush_stdout(void) { fflush(stdout); }


x86 assembly (clang, -O0):
<flush_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_stdout>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @flush_stdout() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @flush_stdout() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
int getdisk() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getdisk() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
f(long long i) {
  if (i & 0x80)
    foo();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x80,%rax
cmp    $0x0,%rax
je     1137 <f+0x27>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   $0x80,%dil
je     1122 <f+0x12>
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @f(i64 %0) {
%2 = and i64 %0, 128
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @foo()
br label %6
6: ; preds = %4, %1
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ w;
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(scalar_t__ *, int *, int);
void store64(uint8_t *dst, uint64_t w) {
  const union {
    long one;
    char little;
  } is_endian = {1};
  if (is_endian.little) {
    memcpy(dst, &w, sizeof(w));
  } else {
    uint8_t *p = (uint8_t *)dst;
    int i;
    for (i = 0; i < 8; i++)
      p[i] = (uint8_t)(w >> (8 * i));
  }
}


x86 assembly (clang, -O0):
<store64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpb   $0x0,-0x18(%rbp)
je     114b <store64+0x3b>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
jmp    1191 <store64+0x81>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x8,-0x24(%rbp)
jge    118c <store64+0x7c>
mov    -0xc(%rbp),%eax
mov    -0x24(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
movslq %eax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115a <store64+0x4a>
jmp    1191 <store64+0x81>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store64>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
@__const.store64.is_endian = %union.anon { i64 1 }
define void @store64(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca %union.anon
%6 = alloca i64*
%7 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%8 = bitcast %union.anon* %5 to i8*
%9 = bitcast %union.anon* %5 to i8*
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i64*, i64** %3
%14 = call i32 @memcpy(i64* %13, i32* %4, i32 4)
br label %34
15: ; preds = %2
%16 = load i64*, i64** %3
store i64* %16, i64** %6
store i32 0, i32* %7
br label %17
17: ; preds = %30, %15
%18 = load i32, i32* %7
%19 = icmp slt i32 %18, 8
br i1 %19, label %20, label %33
20: ; preds = %17
%21 = load i32, i32* %4
%22 = load i32, i32* %7
%23 = mul nsw i32 8, %22
%24 = ashr i32 %21, %23
%25 = sext i32 %24 to i64
%26 = load i64*, i64** %6
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i64, i64* %26, i64 %28
store i64 %25, i64* %29
br label %30
30: ; preds = %20
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %17
33: ; preds = %17
br label %34
34: ; preds = %33, %12
ret void
}

LLVM IR (-O2):
define void @store64(i64* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i64* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int file_wd_perm(char const *);
int file_wd_islink(const char *zFilename) {
  return file_wd_perm(zFilename) == 2;
}


x86 assembly (clang, -O0):
<file_wd_islink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <file_wd_perm@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_wd_islink>:
push   %rax
call   1030 <file_wd_perm@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @file_wd_islink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @file_wd_perm(i8* %3)
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @file_wd_islink(i8* %0) {
%2 = tail call i32 @file_wd_perm(i8* %0)
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 7;
  printf("Number %d squared is %d\n", x, x * x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7,%esi
mov    $0x31,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Number %d squared is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Number %d squared is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 7, i32 49)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(int, int, int, int);
int /*<<< orphan*/ glFlush();
void Desenha(void) {
  glClearColor(1, 1, 1, 1);
  glClear(GL_COLOR_BUFFER_BIT);
  glFlush();
}


x86 assembly (clang, -O0):
<Desenha>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <glClearColor@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Desenha>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1040 <glClearColor@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @Desenha() {
%1 = call i32 @glClearColor(i32 1, i32 1, i32 1, i32 1)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = call i32 @glClear(i32 %2)
%4 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @Desenha() {
%1 = tail call i32 @glClearColor(i32 1, i32 1, i32 1, i32 1)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = tail call i32 @glClear(i32 %2)
%4 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
int randint(int max) { return (int)rand() / (RAND_MAX * 1.0) * max; }


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
movsd  0xed2(%rip),%xmm1
mov    0x2eb3(%rip),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
mov    0x2ec3(%rip),%rax
divsd  (%rax),%xmm0
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i32
%5 = sitofp i32 %4 to double
%6 = load double, double* @RAND_MAX
%7 = fmul double %6, 1.000000e+00
%8 = fdiv double %5, %7
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
%11 = fmul double %8, %10
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(i32 %0) {
%2 = tail call i64 (...) @rand()
%3 = trunc i64 %2 to i32
%4 = sitofp i32 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = sitofp i32 %0 to double
%8 = fmul double %6, %7
%9 = fptosi double %8 to i32
ret i32 %9
}
void yy_2_LinkOptionNameValue(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_2_LinkOptionNameValue(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void UI_NetworkOptionsMenu_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/art/frame2_l");
  trap_R_RegisterShaderNoMip("menu/art/frame1_r");
  trap_R_RegisterShaderNoMip("menu/art/back_0");
  trap_R_RegisterShaderNoMip("menu/art/back_1");
}


x86 assembly (clang, -O0):
<UI_NetworkOptionsMenu_Cache>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xeeb(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef1(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef5(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_NetworkOptionsMenu_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xeee(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef4(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef8(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"menu/art/frame2_l\00"
@.str.1 = [18 x i8] c"menu/art/frame1_r\00"
@.str.2 = [16 x i8] c"menu/art/back_0\00"
@.str.3 = [16 x i8] c"menu/art/back_1\00"
define void @UI_NetworkOptionsMenu_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"menu/art/frame2_l\00"
@.str.1 = [18 x i8] c"menu/art/frame1_r\00"
@.str.2 = [16 x i8] c"menu/art/back_0\00"
@.str.3 = [16 x i8] c"menu/art/back_1\00"
define void @UI_NetworkOptionsMenu_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int fun1096() { return 1096; }


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

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

LLVM IR (-O0):
define i32 @fun1096() {
ret i32 1096
}

LLVM IR (-O2):
define i32 @fun1096() {
ret i32 1096
}
void vecScalarMultiply(double *dest, double s) {
  dest[0] *= s;
  dest[1] *= s;
  dest[2] *= s;
}


x86 assembly (clang, -O0):
<vecScalarMultiply>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecScalarMultiply>:
movupd (%rdi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,(%rdi)
mulsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @vecScalarMultiply(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fmul <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fmul double %10, %1
store double %11, double* %9
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

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


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

x86 assembly (clang, -O2):
<wrapper_epoll56>:
jmp    1030 <epoll56@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll56(%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 @epoll56(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll56(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll56(%struct.__test_metadata* %0)
ret void
}
void write_byte(unsigned char data, unsigned long addr) {
  *(volatile unsigned char *)addr = data;
}


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_byte>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @write_byte(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = load i64, i64* %4
%7 = inttoptr i64 %6 to i8*
store volatile i8 %5, i8* %7
ret void
}

LLVM IR (-O2):
define void @write_byte(i8 zeroext %0, i64 %1) {
%3 = inttoptr i64 %1 to i8*
store volatile i8 %0, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned char *);
int main(void) {
  unsigned char c = 0;
  foo(&c);
  c = c >> 1 | c << 7;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <foo@plt>
movzbl -0x5(%rbp),%eax
sar    $0x1,%eax
movzbl -0x5(%rbp),%ecx
shl    $0x7,%ecx
or     %ecx,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <foo@plt>
mov    0x7(%rsp),%al
ror    %al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
%3 = call i32 @foo(i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = ashr i32 %5, 1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 7
%10 = or i32 %6, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @foo(i8* %1)
%3 = load i8, i8* %1
%4 = call i8 @llvm.fshl.i8(i8 %3, i8 %3, i8 7)
%5 = zext i8 %4 to i32
ret i32 %5
}
void capturingNameAdd2ASCII(char c) {}


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

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

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

LLVM IR (-O2):
define void @capturingNameAdd2ASCII(i8 signext %0) {
ret void
}
/* Variables and functions */
double tanhf(double);
double tanh(double arg) { return tanhf(arg); }


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

x86 assembly (clang, -O2):
<tanh>:
jmp    1030 <tanhf@plt>

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

LLVM IR (-O2):
define double @tanh(double %0) {
%2 = tail call double @tanhf(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ glDepthRange(double, double);
void DepthRange(double n, double f) { glDepthRange(n, f); }


x86 assembly (clang, -O0):
<DepthRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <glDepthRange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DepthRange>:
jmp    1030 <glDepthRange@plt>

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

LLVM IR (-O2):
define void @DepthRange(double %0, double %1) {
%3 = tail call i32 @glDepthRange(double %0, double %1)
ret void
}
void input_init(void) {}


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

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

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

LLVM IR (-O2):
define void @input_init() {
ret void
}
/* Type definitions */
struct ring {
  int dummy;
};

/* Variables and functions */
unsigned int ring_avail(struct ring *);
unsigned int ring_readreverse(struct ring *, void *, unsigned int);
unsigned int ring_readallreverse(struct ring *ring, void *buffer,
                                 unsigned int count) {
  if (count > ring_avail(ring))
    return 0;
  return ring_readreverse(ring, buffer, count);
}


x86 assembly (clang, -O0):
<ring_readallreverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ring_avail@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jbe    115b <ring_readallreverse+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    116e <ring_readallreverse+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <ring_readreverse@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring_readallreverse>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <ring_avail@plt>
cmp    %ebp,%eax
jae    113c <ring_readallreverse+0x1c>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ring_readreverse@plt>

LLVM IR (-O0):
%struct.ring = type { i32 }
define i32 @ring_readallreverse(%struct.ring* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.ring*
%6 = alloca i8*
%7 = alloca i32
store %struct.ring* %0, %struct.ring** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = load %struct.ring*, %struct.ring** %5
%10 = call i32 @ring_avail(%struct.ring* %9)
%11 = icmp ugt i32 %8, %10
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 0, i32* %4
br label %18
13: ; preds = %3
%14 = load %struct.ring*, %struct.ring** %5
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = call i32 @ring_readreverse(%struct.ring* %14, i8* %15, i32 %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.ring = type { i32 }
define i32 @ring_readallreverse(%struct.ring* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ring_avail(%struct.ring* %0)
%5 = icmp ult i32 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @ring_readreverse(%struct.ring* %0, i8* %1, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
int comp(const float *a, const float *b) {
  if (*a == *b)
    return 0;
  else if (*a < *b)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jne    1133 <comp+0x33>
jp     1133 <comp+0x33>
movl   $0x0,-0x4(%rbp)
jmp    115f <comp+0x5f>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1158 <comp+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <comp+0x5f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomiss %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp oeq float %3, %4
%6 = fcmp olt float %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
scalar_t__ strtol(char const *, char **, int);
int atoi(const char *str) {
  _DIAGASSERT(str != NULL);
  return ((int)strtol(str, (char **)NULL, 10));
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <_DIAGASSERT@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @_DIAGASSERT(i32 %5)
%7 = load i8*, i8** %2
%8 = call i64 @strtol(i8* %7, i8** null, i32 10)
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @atoi(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @_DIAGASSERT(i32 %3)
%5 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
%6 = trunc i64 %5 to i32
ret i32 %6
}
void IN_CenterView(void) {}


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

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

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

LLVM IR (-O2):
define void @IN_CenterView() {
ret void
}
void do_intn() { __asm volatile("int $0xcd"); }


x86 assembly (clang, -O0):
<do_intn>:
push   %rbp
mov    %rsp,%rbp
int    $0xcd
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_intn>:
int    $0xcd
ret

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

LLVM IR (-O2):
define void @do_intn() {
tail call void asm sideeffect "int $$0xcd", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int SIGQUIT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signal_handler(int signo) {
  if (SIGQUIT == signo) {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jne    1134 <signal_handler+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    0x2ed0(%rip),%rax
cmp    %edi,(%rax)
je     111e <signal_handler+0xe>
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
@SIGQUIT = global i32 0
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @SIGQUIT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t pgm_read_word(const void *x) { return *((uint16_t *)x); }


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

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

LLVM IR (-O0):
define i32 @pgm_read_word(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

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


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

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

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

LLVM IR (-O2):
define void @INT_Excep_S12AD_S12ADI0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ changeToX(char *);
int /*<<< orphan*/ changeToX2(char *);
int /*<<< orphan*/ changeToX3(char *);
int /*<<< orphan*/ free(char *);
char *strdup(char *);
int main(void) {
  char *str = strdup("Hello world");
  changeToX(str);
  changeToX2(str);
  changeToX3(str);
  free(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <changeToX@plt>
mov    -0x10(%rbp),%rdi
call   1060 <changeToX2@plt>
mov    -0x10(%rbp),%rdi
call   1040 <changeToX3@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xea8(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <changeToX@plt>
mov    %rbx,%rdi
call   1060 <changeToX2@plt>
mov    %rbx,%rdi
call   1040 <changeToX3@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @strdup(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @changeToX(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @changeToX2(i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @changeToX3(i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(12) i8* @strdup(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @changeToX(i8* %1)
%3 = tail call i32 @changeToX2(i8* %1)
%4 = tail call i32 @changeToX3(i8* %1)
%5 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ k();
int main() {
  k();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @k()
ret i32 0
}
int main(int argc, char *argv[]) {
  char b[10];
  int len = atoi(argv[1]);
  (void)strncpy(b, "1020202020202", len);
  (void)printf("%*.*s\n", len, len, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1050 <atoi@plt>
mov    %eax,-0x20(%rbp)
lea    -0x1a(%rbp),%rdi
movslq -0x20(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    -0x1a(%rbp),%rcx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x8(%rsi),%rdi
xor    %eax,%eax
call   1050 <atoi@plt>
movslq %eax,%rbx
lea    0xeb4(%rip),%rsi
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"1020202020202\00"
@.str.1 = [7 x i8] c"%*.*s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %6)
%8 = sext i32 %7 to i64
%9 = call i8* @strncpy(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %7, i8* %4)
ret i32 0
}
/* Variables and functions */
double atof(char *);
int ncmp(char *a, char *b) {
  double v1, v2;
  v1 = atof(a);
  v2 = atof(b);
  if (v1 < v2) {
    return -1;
  } else if (v1 > v2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<ncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <ncmp+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <ncmp+0x6f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1178 <ncmp+0x68>
movl   $0x1,-0x4(%rbp)
jmp    117f <ncmp+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncmp>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
xor    %ecx,%ecx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ncmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call double @atof(i8* %8)
store double %9, double* %6
%10 = load i8*, i8** %5
%11 = call double @atof(i8* %10)
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %22
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp ogt double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %3
br label %22
21: ; preds = %16
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @ncmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
int musbgm_stop(int no, int time) {
  printf("%s not implemented\n", __func__);
  return (-1);
}


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

x86 assembly (clang, -O2):
<musbgm_stop>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef5(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.musbgm_stop = [12 x i8] c"musbgm_stop\00"
define i32 @musbgm_stop(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.musbgm_stop, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.musbgm_stop = [12 x i8] c"musbgm_stop\00"
define i32 @musbgm_stop(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.musbgm_stop, i64 0, i64 0))
ret i32 -1
}