xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int print1argv(char **argv, void *useless) {
  int argc = 0;
  for (; *argv != 0; argv++, argc++)
    printf("argv[%d]=\"%s\"\n", argc, *argv);
  return 0;
}


x86 assembly (clang, -O0):
<print1argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1165 <print1argv+0x55>
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <print1argv+0x17>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print1argv>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%rdx
test   %rdx,%rdx
je     1148 <print1argv+0x38>
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed7(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x8(%r14,%rbx,8),%rdx
add    $0x1,%rbx
test   %rdx,%rdx
jne    1130 <print1argv+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"argv[%d]=\22%s\22\0A\00"
define i32 @print1argv(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i32
store i8** %0, i8*** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %13)
br label %15
15: ; preds = %10
%16 = load i8**, i8*** %3
%17 = getelementptr inbounds i8*, i8** %16, i32 1
store i8** %17, i8*** %3
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"argv[%d]=\22%s\22\0A\00"
define i32 @print1argv(i8** nocapture %0, i8* nocapture readnone %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %12, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8** [ %10, %5 ], [ %0, %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %6)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = add nuw nsw i32 %7, 1
%12 = load i8*, i8** %10
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int func();
int main(int argc, char **argv) { return func() != 42; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <func@plt>
cmp    $0x2a,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func@plt>
xor    %ecx,%ecx
cmp    $0x2a,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @func()
%7 = icmp ne i32 %6, 42
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
%4 = icmp ne i32 %3, 42
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x66() {
  Assert_real((ispunct(102) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              515, ("ispunct should be 0 for f"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x66>:
push   %rax
mov    $0x66,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x203,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for f\00"
define void @t_ispunct_0x66() {
%1 = call i64 @ispunct(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for f\00"
define void @t_ispunct_0x66() {
%1 = tail call i64 @ispunct(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int i, total;
  total = 0;
  for (i = 0; i < 10; i++)
    total += i;
  if (total != 45)
    printf("Failure\n");
  else
    printf("Success\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x2d,-0xc(%rbp)
je     1169 <main+0x59>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1175 <main+0x65>
lea    0xe99(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Failure\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 45
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %21
19: ; preds = %14
%20 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ irc_privmsg(char *, char *);
char *strtok(char *, char *);
void child_msg(char *p) {
  char *target, *msg;
  target = strtok(p, " ");
  msg = strtok(NULL, "");
  irc_privmsg(target, msg);
}


x86 assembly (clang, -O0):
<child_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb6(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <irc_privmsg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_msg>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <irc_privmsg@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_msg(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @irc_privmsg(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_msg(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @irc_privmsg(i8* %2, i8* %3)
ret void
}
void test2_multi_ok(int x) {
  int buf[100][100];
  buf[0][0] = 1;
}


x86 assembly (clang, -O0):
<test2_multi_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9bd0,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x9c50(%rbp)
add    $0x9bd0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test2_multi_ok(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x [100 x i32]]
store i32 %0, i32* %2
%4 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %3, i64 0, i64 0
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
store i32 1, i32* %5
ret void
}

LLVM IR (-O2):
define void @test2_multi_ok(i32 %0) {
ret void
}
/* Variables and functions */
int snprintf(char *, size_t, char *, long);
bool stringify_port(long int port, char *buffer, size_t buffer_length) {
  int size = snprintf(buffer, buffer_length, "%li", port);
  if (size < 0 || (size_t)size > buffer_length) {
    return false;
  } else {
    return true;
  }
}


x86 assembly (clang, -O0):
<stringify_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rcx
lea    0xec9(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1157 <stringify_port+0x47>
movslq -0x24(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1163 <stringify_port+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116a <stringify_port+0x5a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringify_port>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
lea    0xee2(%rip),%rdx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <snprintf@plt>
test   %eax,%eax
setns  %cl
cltq
cmp    %rbx,%rax
setbe  %al
and    %cl,%al
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%li\00"
define i32 @stringify_port(i64 %0, i8* %1, i64 %2) {
%4 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = icmp sgt i32 %4, -1
%6 = sext i32 %4 to i64
%7 = icmp ule i64 %6, %2
%8 = and i1 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
int g(const int *x) { return *x; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void _makeind_isfname(isfname) char *isfname;
{ (void)strcat(isfname, ".ind"); }


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

x86 assembly (clang, -O2):
<_makeind_isfname>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movl   $0x646e692e,(%rbx,%rax,1)
movb   $0x0,0x4(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c".ind\00"
define void @_makeind_isfname(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr i8, i8* %0, i64 %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %3, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ discardheaders(int);
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void unimplemented(int client) {
  char *respone = "HTTP/1.0 501 Method Not Implemented\r\n"
                  "Server: emhttpd 0.1.0\r\n"
                  "Content-Type: text/html\r\n"
                  "\r\n"
                  "<HTML><HEAD><TITLE>Method Not Implemented\r\n "
                  "</TITLE></HEAD>\r\n"
                  "<BODY><P>HTTP request method not supported.\r\n"
                  "</BODY></HTML>\r\n";
  discardheaders(client);
  send(client, respone, strlen(respone), 0);
}


x86 assembly (clang, -O0):
<unimplemented>:
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):
<unimplemented>:
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 = [210 x i8] c"HTTP/1.0 501 Method Not Implemented\0D\0AServer: emhttpd 0.1.0\0D\0AContent-Type: text/html\0D\0A\0D\0A<HTML><HEAD><TITLE>Method Not Implemented\0D\0A </TITLE></HEAD>\0D\0A<BODY><P>HTTP request method not supported.\0D\0A</BODY></HTML>\0D\0A\00"
define void @unimplemented(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([210 x i8], [210 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 = [210 x i8] c"HTTP/1.0 501 Method Not Implemented\0D\0AServer: emhttpd 0.1.0\0D\0AContent-Type: text/html\0D\0A\0D\0A<HTML><HEAD><TITLE>Method Not Implemented\0D\0A </TITLE></HEAD>\0D\0A<BODY><P>HTTP request method not supported.\0D\0A</BODY></HTML>\0D\0A\00"
define void @unimplemented(i32 %0) {
%2 = tail call i32 @discardheaders(i32 %0)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @send(i32 %0, i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0)
ret void
}
int isalnum(int ch) {
  return (unsigned int)((ch | 0x20) - 'a') < 26u ||
         (unsigned int)(ch - '0') < 10u;
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
or     $0x20,%ecx
sub    $0x61,%ecx
mov    $0x1,%al
cmp    $0x1a,%ecx
mov    %al,-0x5(%rbp)
jb     112d <isalnum+0x2d>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
mov    %edi,%eax
or     $0x20,%eax
add    $0xffffff9f,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 32
%5 = sub nsw i32 %4, 97
%6 = icmp ult i32 %5, 26
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 48
%10 = icmp ult i32 %9, 10
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = or i32 %0, 32
%3 = add nsw i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = add nsw i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = select i1 %4, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void nmstermio_refresh(void) { fflush(stdout); }


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

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

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

LLVM IR (-O2):
@stdout = global i32 0
define void @nmstermio_refresh() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UnitTest_report();
int /*<<< orphan*/ testLength();
int /*<<< orphan*/ testNew();
int /*<<< orphan*/ testStr();
int main(int argc, char **argv) {
  testLength();
  testNew();
  testStr();
  UnitTest_report();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <testLength@plt>
mov    $0x0,%al
call   1040 <testNew@plt>
mov    $0x0,%al
call   1030 <testStr@plt>
mov    $0x0,%al
call   1050 <UnitTest_report@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <testLength@plt>
xor    %eax,%eax
call   1040 <testNew@plt>
xor    %eax,%eax
call   1030 <testStr@plt>
xor    %eax,%eax
call   1050 <UnitTest_report@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @testLength()
%6 = call i32 (...) @testNew()
%7 = call i32 (...) @testStr()
%8 = call i32 (...) @UnitTest_report()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testLength()
%4 = tail call i32 (...) @testNew()
%5 = tail call i32 (...) @testStr()
%6 = tail call i32 (...) @UnitTest_report()
ret i32 0
}
INSTRUCTION(l_cust1) {}


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

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

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

LLVM IR (-O2):
define i32 @INSTRUCTION(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void vect_dtor_string(char **key, void *data) { free(*key); }


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

x86 assembly (clang, -O2):
<vect_dtor_string>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @vect_dtor_string(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** %5
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @vect_dtor_string(i8** nocapture %0, i8* nocapture readnone %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unsigned Test2(void) {
  printf("Test 2\n");
  return 2;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Test 2\0A\00"
define i32 @Test2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@str = [7 x i8] c"Test 2\00"
define i32 @Test2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex8(unsigned char);
void print_debug_hex8(unsigned char value) { __console_tx_hex8(value); }


x86 assembly (clang, -O0):
<print_debug_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__console_tx_hex8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_hex8>:
jmp    1030 <__console_tx_hex8@plt>

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

LLVM IR (-O2):
define void @print_debug_hex8(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_hex8(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "Usage: %s {file(s) ...}\n", argv0);
  fprintf(stderr, "If no fileames are given, standard input is read.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s {file(s) ...}\0A\00"
@.str.1 = [51 x i8] c"If no fileames are given, standard input is read.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s {file(s) ...}\0A\00"
@.str.1 = [51 x i8] c"If no fileames are given, standard input is read.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int SIZE_MAX;
int validate_fit(size_t chunk_area, uint32_t m_cost) {
  if (SIZE_MAX >> (m_cost + 4) >= chunk_area - 1)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<validate_fit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
add    $0x4,%rcx
sar    %cl,%eax
cltq
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jb     113e <validate_fit+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <validate_fit+0x45>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_fit>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
lea    0x4(%rsi),%ecx
sar    %cl,%eax
cltq
add    $0xffffffffffffffff,%rdi
cmp    %rdi,%rax
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
@SIZE_MAX = global i32 0
define i32 @validate_fit(i64 %0, i64 %1) {
%3 = load i32, i32* @SIZE_MAX
%4 = trunc i64 %1 to i32
%5 = add i32 %4, 4
%6 = ashr i32 %3, %5
%7 = sext i32 %6 to i64
%8 = add i64 %0, -1
%9 = icmp ugt i64 %8, %7
%10 = sext i1 %9 to i32
ret i32 %10
}
unsigned int sdbm_hash(const char *key) {
  unsigned int h = 0;
  while (*key) {
    h = (unsigned char)*key + (h << 6) + (h << 16) - h;
    ++key;
  }
  return h;
}


x86 assembly (clang, -O0):
<sdbm_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <sdbm_hash+0x4a>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <sdbm_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbm_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <sdbm_hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sdbm_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sdbm_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = zext i8 %5 to i32
%9 = mul i32 %6, 65599
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
void av_sha512_final() {}


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

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

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

LLVM IR (-O2):
define void @av_sha512_final() {
ret void
}
int colon(char *stream, int offset) { return stream[offset] == ':'; }


x86 assembly (clang, -O0):
<colon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colon>:
movslq %esi,%rcx
xor    %eax,%eax
cmpb   $0x3a,(%rdi,%rcx,1)
sete   %al
ret

LLVM IR (-O0):
define i32 @colon(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 58
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @colon(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 58
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, const char *argv[]) {
  int fahr;
  int celsius;
  fahr = 0;
  while (fahr <= 300) {
    celsius = 5 * (fahr - 32) / 9;
    printf("%d\t%d\n", fahr, celsius);
    fahr += 20;
  }
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x12c,-0x14(%rbp)
jg     116e <main+0x5e>
mov    -0x14(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0xffffffec,%ebx
mov    $0xff60,%r15w
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
add    $0x14,%ebx
movswl %r15w,%eax
imul   $0x1c72,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x10,%eax
add    %ecx,%eax
movswl %ax,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x64,%r15d
cmp    $0x119,%ebx
jb     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d\09%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %6
%10 = icmp sle i32 %9, 300
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 32
%14 = mul nsw i32 5, %13
%15 = sdiv i32 %14, 9
store i32 %15, i32* %7
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 20
store i32 %20, i32* %6
br label %8
21: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %11, %3 ]
%5 = trunc i32 %4 to i16
%6 = mul nuw nsw i16 %5, 5
%7 = add nsw i16 %6, -160
%8 = sdiv i16 %7, 9
%9 = sext i16 %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %9)
%11 = add nuw nsw i32 %4, 20
%12 = icmp ult i32 %4, 281
br i1 %12, label %3, label %13
13: ; preds = %3
ret i32 0
}
int getbitfield(unsigned char *pageaddr, int mask, int shift) {
  return ((*pageaddr >> shift) & mask);
}


x86 assembly (clang, -O0):
<getbitfield>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbitfield>:
mov    %edx,%ecx
movzbl (%rdi),%eax
shr    %cl,%eax
and    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @getbitfield(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = zext i8 %4 to i32
%6 = lshr i32 %5, %2
%7 = and i32 %6, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ some_funtion();
void main() {
  char *video_memory = (char *)0xb8000;
  *video_memory = 'X';
  some_funtion();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x58,(%rax)
mov    $0x0,%al
call   1030 <some_funtion@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movb   $0x58,0xb8000
58
xor    %eax,%eax
jmp    1030 <some_funtion@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8*
store i8* inttoptr (i64 753664 to i8*), i8** %1
%2 = load i8*, i8** %1
store i8 88, i8* %2
%3 = call i32 (...) @some_funtion()
ret void
}

LLVM IR (-O2):
define void @main() {
store i8 88, i8* inttoptr (i64 753664 to i8*)
%1 = tail call i32 (...) @some_funtion()
ret void
}
double prior_upper_delta(const void *data) { return *(double *)data; }


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

x86 assembly (clang, -O2):
<prior_upper_delta>:
movsd  (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @prior_upper_delta(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
/* Variables and functions */
float asinf(float);
float acosf(float x) {
  float pi;
  pi = 3.14159265358979;
  return (pi / 2) - asinf(x);
}


x86 assembly (clang, -O0):
<acosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xec9(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asinf@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosf>:
push   %rax
call   1030 <asinf@plt>
movss  0xee2(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @acosf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0x400921FB60000000, float* %3
%4 = load float, float* %3
%5 = fdiv float %4, 2.000000e+00
%6 = load float, float* %2
%7 = call float @asinf(float %6)
%8 = fsub float %5, %7
ret float %8
}

LLVM IR (-O2):
define float @acosf(float %0) {
%2 = tail call float @asinf(float %0)
%3 = fsub float 0x3FF921FB60000000, %2
ret float %3
}
int is_a_tty(n)
int n;
{ return (isatty(n)); }


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

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

LLVM IR (-O0):
define i32 @is_a_tty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @isatty to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_a_tty(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @isatty to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
void ROM_SysTickPeriodSet(unsigned long i) {}


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

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

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

LLVM IR (-O2):
define void @ROM_SysTickPeriodSet(i64 %0) {
ret void
}
int arch_rand_long(unsigned long *val) {
  int ok;
  asm volatile("1: "
               ".byte 0x48,0x0f,0xc7,0xf0"
               "\n\t"
               "jc 2f\n\t"
               "decl %0\n\t"
               "jnz 1b\n\t"
               "2:"
               : "=r"(ok), "=a"(*val)
               : "0"(100));
  return ok;
}


x86 assembly (clang, -O0):
<arch_rand_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x64,%edx
rdrand %rax
jb     1127 <arch_rand_long+0x27>
dec    %edx
jne    1115 <arch_rand_long+0x15>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %edx,-0xc(%rbp)
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_rand_long>:
mov    $0x64,%ecx
rdrand %rax
jb     110f <arch_rand_long+0xf>
dec    %ecx
jne    1105 <arch_rand_long+0x5>
mov    %rax,(%rdi)
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @arch_rand_long(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = call { i32, i64 } asm sideeffect "1: .byte 0x48,0x0f,0xc7,0xf0\0A\09jc 2f\0A\09decl $0\0A\09jnz 1b\0A\092:", "=r,={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 100)
%6 = extractvalue { i32, i64 } %5, 0
%7 = extractvalue { i32, i64 } %5, 1
store i32 %6, i32* %3
store i64 %7, i64* %4
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @arch_rand_long(i64* nocapture writeonly %0) {
%2 = tail call { i32, i64 } asm sideeffect "1: .byte 0x48,0x0f,0xc7,0xf0\0A\09jc 2f\0A\09decl $0\0A\09jnz 1b\0A\092:", "=r,={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 100)
%3 = extractvalue { i32, i64 } %2, 0
%4 = extractvalue { i32, i64 } %2, 1
store i64 %4, i64* %0
ret i32 %3
}
void RTLogCreateForR0(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogCreateForR0() {
ret void
}
/* Variables and functions */
void foo(char *p) {
  int *crash = NULL;
  *crash = 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
store i32* null, i32** %3
%4 = load i32*, i32** %3
store i32 1, i32* %4
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ gmx_dyndom(int, char **);
int main(int argc, char *argv[]) {
  gmx_dyndom(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_dyndom(i32 %0, i8** %1)
ret i32 0
}
unsigned int pixman_bits_per_pixel(unsigned int depth) {
  if (depth > 8)
    if (depth > 16)
      return 32;
    else
      return 16;
  else if (depth > 4)
    return 8;
  else if (depth > 1)
    return 4;
  else
    return 1;
}


x86 assembly (clang, -O0):
<pixman_bits_per_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jbe    1133 <pixman_bits_per_pixel+0x33>
cmpl   $0x10,-0x8(%rbp)
jbe    1127 <pixman_bits_per_pixel+0x27>
movl   $0x20,-0x4(%rbp)
jmp    1166 <pixman_bits_per_pixel+0x66>
movl   $0x10,-0x4(%rbp)
jmp    1166 <pixman_bits_per_pixel+0x66>
cmpl   $0x4,-0x8(%rbp)
jbe    1149 <pixman_bits_per_pixel+0x49>
movl   $0x8,-0x4(%rbp)
jmp    1166 <pixman_bits_per_pixel+0x66>
cmpl   $0x1,-0x8(%rbp)
jbe    115f <pixman_bits_per_pixel+0x5f>
movl   $0x4,-0x4(%rbp)
jmp    1166 <pixman_bits_per_pixel+0x66>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixman_bits_per_pixel>:
cmp    $0x9,%edi
jb     1114 <pixman_bits_per_pixel+0x14>
xor    %eax,%eax
cmp    $0x11,%edi
setae  %al
shl    $0x4,%eax
add    $0x10,%eax
ret
mov    $0x8,%eax
cmp    $0x4,%edi
ja     112c <pixman_bits_per_pixel+0x2c>
xor    %eax,%eax
cmp    $0x2,%edi
setae  %al
lea    (%rax,%rax,2),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @pixman_bits_per_pixel(i32 %0) {
%2 = icmp ugt i32 %0, 8
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = icmp ugt i32 %0, 16
%5 = select i1 %4, i32 32, i32 16
br label %11
6: ; preds = %1
%7 = icmp ugt i32 %0, 4
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = icmp ugt i32 %0, 1
%10 = select i1 %9, i32 4, i32 1
br label %11
11: ; preds = %8, %6, %3
%12 = phi i32 [ %5, %3 ], [ 8, %6 ], [ %10, %8 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ AND_();
int /*<<< orphan*/ c64_memAbsoluteAddr();
void AND_abs(void) {
  c64_memAbsoluteAddr();
  AND_();
}


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

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

LLVM IR (-O0):
define void @AND_abs() {
%1 = call i32 (...) @c64_memAbsoluteAddr()
%2 = call i32 (...) @AND_()
ret void
}

LLVM IR (-O2):
define void @AND_abs() {
%1 = tail call i32 (...) @c64_memAbsoluteAddr()
%2 = tail call i32 (...) @AND_()
ret void
}
/* Variables and functions */
char _dos_stat_console();
int _dos_get_console(void) {
  char c;
  while ((c = _dos_stat_console()) == '\0')
    ;
  return c;
}


x86 assembly (clang, -O0):
<_dos_get_console>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_dos_stat_console@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jne    1133 <_dos_get_console+0x23>
jmp    1118 <_dos_get_console+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dos_get_console>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <_dos_stat_console@plt>
test   %al,%al
je     1120 <_dos_get_console+0x10>
movsbl %al,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_dos_get_console() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @_dos_stat_console()
%3 = icmp eq i8 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = sext i8 %2 to i32
ret i32 %5
}
int main() {
  int a, b, c, d, e;
  a = b++ + 3;
  a = b;
  a = b;
  a = b++;
  a = c++;
  a = b;
  a = d++;
  a = b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}