xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t, size_t);
int /*<<< orphan*/ stderr;
size_t write(int, unsigned char *, size_t);
int raw_socket_send(int fd, unsigned char *data, size_t data_size) {
  size_t nbyte = 0;
  if ((nbyte = write(fd, data, data_size)) != data_size)
    fprintf(stderr,
            "write() failure: sent %d bytes but the"
            "length should be %d\n",
            nbyte, data_size);
  return nbyte;
}


x86 assembly (clang, -O0):
<raw_socket_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x20(%rbp)
cmp    -0x18(%rbp),%rax
je     1176 <raw_socket_send+0x56>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_socket_send>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1030 <write@plt>
mov    %rax,%rbx
cmp    %r14,%rax
je     114f <raw_socket_send+0x2f>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"write() failure: sent %d bytes but thelength should be %d\0A\00"
define i32 @raw_socket_send(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @write(i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = icmp ne i64 %11, %12
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = load i64, i64* %7
%17 = load i64, i64* %6
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i64 %16, i64 %17)
br label %19
19: ; preds = %14, %3
%20 = load i64, i64* %7
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"write() failure: sent %d bytes but thelength should be %d\0A\00"
define i32 @raw_socket_send(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %2)
br label %9
9: ; preds = %6, %3
%10 = trunc i64 %4 to i32
ret i32 %10
}
int gfx_set_tv_cc_enable(int enable) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @gfx_set_tv_cc_enable(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void gen_size(FILE *outfile, int num) { fprintf(outfile, "_size[%d]", num); }


x86 assembly (clang, -O0):
<gen_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_size>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"_size[%d]\00"
define void @gen_size(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"_size[%d]\00"
define void @gen_size(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *my_strdup(const char *p) {
  char *ret = malloc(strlen(p) + 1);
  strcpy(ret, p);
  return ret;
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(1, 2))) __attribute__((always_)) void hp2(void) {
  printf("hello, world!\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define void @hp2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void fatal(char message[], int error_code) {
  perror(message);
  exit(error_code);
}


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

x86 assembly (clang, -O2):
<fatal>:
push   %rbx
mov    %esi,%ebx
call   1030 <perror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fatal(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 = call i32 @perror(i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *appli) {
  printf("%s have to be started with the port number to listen too\n", appli);
  printf("example: %s 1    will start a RTSP server with a camera handled\n",
         appli);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"%s have to be started with the port number to listen too\0A\00"
@.str.1 = [65 x i8] c"example: %s 1 will start a RTSP server with a camera handled\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [58 x i8] c"%s have to be started with the port number to listen too\0A\00"
@.str.1 = [65 x i8] c"example: %s 1 will start a RTSP server with a camera handled\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
bool isEqual(const char *str1, const char *str2) {
  if ((str1 == NULL && str2 != NULL) || (str1 != NULL && str2 == NULL)) {
    return false;
  }
  return strcmp(str1, str2) == 0;
}


x86 assembly (clang, -O0):
<isEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <isEqual+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    114c <isEqual+0x3c>
cmpq   $0x0,-0x10(%rbp)
je     1158 <isEqual+0x48>
cmpq   $0x0,-0x18(%rbp)
jne    1158 <isEqual+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1174 <isEqual+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEqual>:
xor    %eax,%eax
test   %rdi,%rdi
jne    111d <isEqual+0xd>
test   %rsi,%rsi
je     111d <isEqual+0xd>
ret
test   %rdi,%rdi
je     1127 <isEqual+0x17>
test   %rsi,%rsi
je     111c <isEqual+0xc>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @isEqual(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = icmp ne i8* %0, null
%8 = icmp eq i8* %1, null
%9 = and i1 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = tail call i64 @strcmp(i8* %0, i8* %1)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %2, %6, %10
%15 = phi i32 [ %13, %10 ], [ 0, %6 ], [ 0, %2 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
int main() {
  char *happy[2];
  happy[0] = "/bin/sh";
  happy[1] = NULL;
  execve(happy[0], happy, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%7 = call i32 @execve(i8* %5, i8** %6, i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3, i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int s_mp_outlen(int, int);
int mp_value_radix_size(int num, int qty, int radix) {
  assert(num >= 0 && qty > 0 && radix >= 2 && radix <= 64);
  return s_mp_outlen(num * qty, radix);
}


x86 assembly (clang, -O0):
<mp_value_radix_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jl     1168 <mp_value_radix_size+0x48>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    1168 <mp_value_radix_size+0x48>
xor    %eax,%eax
cmpl   $0x2,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1168 <mp_value_radix_size+0x48>
cmpl   $0x40,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <s_mp_outlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_value_radix_size>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
test   %edi,%edi
setns  %al
test   %esi,%esi
setg   %cl
and    %al,%cl
lea    -0x2(%r14),%eax
cmp    $0x3f,%eax
setb   %al
and    %cl,%al
movzbl %al,%edi
call   1030 <assert@plt>
imul   %ebx,%ebp
mov    %ebp,%edi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <s_mp_outlen@plt>

LLVM IR (-O0):
define i32 @mp_value_radix_size(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %6
%14 = icmp sge i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %6
%17 = icmp sle i32 %16, 64
br label %18
18: ; preds = %15, %12, %9, %3
%19 = phi i1 [ false, %12 ], [ false, %9 ], [ false, %3 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %6
%26 = call i32 @s_mp_outlen(i32 %24, i32 %25)
ret i32 %26
}

LLVM IR (-O2):
define i32 @mp_value_radix_size(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, -1
%5 = icmp sgt i32 %1, 0
%6 = and i1 %4, %5
%7 = add i32 %2, -2
%8 = icmp ult i32 %7, 63
%9 = and i1 %6, %8
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = mul nsw i32 %1, %0
%13 = tail call i32 @s_mp_outlen(i32 %12, i32 %2)
ret i32 %13
}
/* Type definitions */
struct timeval {
  float tv_sec;
  float tv_usec;
};

/* Variables and functions */
float time_diff(struct timeval t0, struct timeval t1) {
  return (t1.tv_sec - t0.tv_sec) + (t1.tv_usec - t0.tv_usec) / 1000000.0f;
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movlpd %xmm1,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
movss  0xed6(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
subps  %xmm0,%xmm1
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
divss  0xeee(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { float, float }
define float @time_diff(<2 x float> %0, <2 x float> %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %5
%6 = bitcast %struct.timeval* %4 to <2 x float>*
store <2 x float> %1, <2 x float>* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%13 = load float, float* %12
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%15 = load float, float* %14
%16 = fsub float %13, %15
%17 = fdiv float %16, 1.000000e+06
%18 = fadd float %11, %17
ret float %18
}

LLVM IR (-O2):
define float @time_diff(<2 x float> %0, <2 x float> %1) {
%3 = fsub <2 x float> %1, %0
%4 = extractelement <2 x float> %3, i64 1
%5 = fdiv float %4, 1.000000e+06
%6 = extractelement <2 x float> %3, i64 0
%7 = fadd float %6, %5
ret float %7
}
unsigned long long h(unsigned long long a) { return a | 0xfffffffffffff000ull; }


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

x86 assembly (clang, -O2):
<h>:
mov    %rdi,%rax
or     $0xfffffffffffff000,%rax
ret

LLVM IR (-O0):
define i64 @h(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, -4096
ret i64 %4
}

LLVM IR (-O2):
define i64 @h(i64 %0) {
%2 = or i64 %0, -4096
ret i64 %2
}
char *chatdat_get_token(const char *line) {
  int chari = 0;
  while (line[chari] == ' ')
    chari++;
  return (char *)(line + chari);
}


x86 assembly (clang, -O0):
<chatdat_get_token>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1132 <chatdat_get_token+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <chatdat_get_token+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chatdat_get_token>:
mov    %rdi,%rax
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax,%rcx,1)
lea    0x1(%rcx),%rcx
je     1110 <chatdat_get_token+0x10>
mov    %ecx,%ecx
add    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @chatdat_get_token(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%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, 32
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
ret i8* %19
}

LLVM IR (-O2):
define i8* @chatdat_get_token(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
ret i8* %10
}
void inttobig(int n, int *d) {
  int i = 0;
  for (; !i || n; d[++i] = n % 10, n /= 10)
    ;
  d[0] = i;
}


x86 assembly (clang, -O0):
<inttobig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     112b <inttobig+0x2b>
cmpl   $0x0,-0x4(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    113b <inttobig+0x3b>
jmp    1171 <inttobig+0x71>
jmp    1140 <inttobig+0x40>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1112 <inttobig+0x12>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inttobig>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%r8d
mov    %ecx,%edx
sub    %r8d,%edx
mov    %edx,0x4(%rsi,%rax,4)
add    $0x1,%rax
add    $0xfffffff6,%ecx
cmp    $0xffffffed,%ecx
jb     1110 <inttobig+0x10>
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @inttobig(i32 %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %7, %3 ]
%5 = phi i32 [ %0, %2 ], [ %9, %3 ]
%6 = srem i32 %5, 10
%7 = add nuw nsw i64 %4, 1
%8 = getelementptr inbounds i32, i32* %1, i64 %7
store i32 %6, i32* %8
%9 = sdiv i32 %5, 10
%10 = add i32 %5, -10
%11 = icmp ult i32 %10, -19
br i1 %11, label %3, label %12
12: ; preds = %3
%13 = trunc i64 %7 to i32
store i32 %13, i32* %1
ret void
}
/* Variables and functions */
double ceil(double);
double floor(double);
double round(double num) {
  return (num > 0.0) ? floor(num + 0.5) : ceil(num - 0.5);
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115b <round+0x3b>
movsd  0xeb9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1176 <round+0x56>
movsd  -0x8(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1137 <round+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1040 <floor@plt>
addsd  0xec1(%rip),%xmm0
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = call double @llvm.floor.f64(double %7)
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e-01
%12 = call double @llvm.ceil.f64(double %11)
br label %13
13: ; preds = %9, %5
%14 = phi double [ %8, %5 ], [ %12, %9 ]
ret double %14
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = tail call double @llvm.floor.f64(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, -5.000000e-01
%8 = tail call double @llvm.ceil.f64(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi double [ %5, %3 ], [ %8, %6 ]
ret double %10
}
int wps_validate_m1(const struct wpabuf *tlvs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_m1(%struct.wpabuf* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int munmap(void *, unsigned int);
int /*<<< orphan*/ printf(char *, int);
void *unmapmem(void *addr, unsigned size) {
  unsigned offset = (unsigned)addr % (4 * 1024);
  addr = addr - offset;
  int s = munmap(addr, size);
  if (s != 0) {
    printf("munmap error %d\n", s);
    exit(-1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<unmapmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <munmap@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1192 <unmapmem+0x62>
mov    -0x14(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmapmem>:
push   %rax
and    $0xfffffffffffff000,%rdi
call   1040 <munmap@plt>
test   %eax,%eax
jne    1145 <unmapmem+0x15>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"munmap error %d\0A\00"
define i8* @unmapmem(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i32
%9 = urem i32 %8, 4096
store i32 %9, i32* %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %5
%12 = zext i32 %11 to i64
%13 = sub i64 0, %12
%14 = getelementptr i8, i8* %10, i64 %13
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = call i32 @munmap(i8* %15, i32 %16)
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %2
%21 = load i32, i32* %6
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = call i32 @exit(i32 -1)
unreachable
24: ; preds = %2
ret i8* null
}

LLVM IR (-O2):
@.str = [17 x i8] c"munmap error %d\0A\00"
define noalias i8* @unmapmem(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = and i64 %3, 4095
%5 = sub nsw i64 0, %4
%6 = getelementptr i8, i8* %0, i64 %5
%7 = tail call i32 @munmap(i8* %6, i32 %1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
ret i8* null
}
void bno_hal_init() {}


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

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

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

LLVM IR (-O2):
define void @bno_hal_init() {
ret void
}
int noMain(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @noMain() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *const);
int /*<<< orphan*/ stderr;
void Usage(char *const *argv) {
  fprintf(stderr,
          "Usage: %s <timeout-secs> <kill-delay-secs> <stdout-redirect> "
          "<stderr-redirect> <command> [args] ...\n",
          argv[0]);
  exit(EXIT_FAILURE);
}


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),%rax
mov    (%rax),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xecc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [101 x i8] c"Usage: %s <timeout-secs> <kill-delay-secs> <stdout-redirect> <stderr-redirect> <command> [args] ...\0A\00"
@EXIT_FAILURE = global i32 0
define void @Usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [101 x i8] c"Usage: %s <timeout-secs> <kill-delay-secs> <stdout-redirect> <stderr-redirect> <command> [args] ...\0A\00"
@EXIT_FAILURE = global i32 0
define void @Usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FixXY(int, int /*<<< orphan*/);
void HTx(void) { FixXY(8, 0); }


x86 assembly (clang, -O0):
<HTx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
xor    %esi,%esi
call   1030 <FixXY@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTx>:
mov    $0x8,%edi
xor    %esi,%esi
jmp    1030 <FixXY@plt>

LLVM IR (-O0):
define void @HTx() {
%1 = call i32 @FixXY(i32 8, i32 0)
ret void
}

LLVM IR (-O2):
define void @HTx() {
%1 = tail call i32 @FixXY(i32 8, i32 0)
ret void
}
float quantize(double v) {
  const float anti_denormal = 1.0e-30f;
  float x = v;
  x += anti_denormal;
  x -= anti_denormal;
  return x;
}


x86 assembly (clang, -O0):
<quantize>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xed4(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xebd(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantize>:
cvtsd2ss %xmm0,%xmm0
addss  0xef4(%rip),%xmm0
addss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @quantize(double %0) {
%2 = alloca double
%3 = alloca float
%4 = alloca float
store double %0, double* %2
store float 0x39B4484C00000000, float* %3
%5 = load double, double* %2
%6 = fptrunc double %5 to float
store float %6, float* %4
%7 = load float, float* %4
%8 = fadd float %7, 0x39B4484C00000000
store float %8, float* %4
%9 = load float, float* %4
%10 = fsub float %9, 0x39B4484C00000000
store float %10, float* %4
%11 = load float, float* %4
ret float %11
}

LLVM IR (-O2):
define float @quantize(double %0) {
%2 = fptrunc double %0 to float
%3 = fadd float %2, 0x39B4484C00000000
%4 = fadd float %3, 0xB9B4484C00000000
ret float %4
}
int main(int argc, const char *argv[]) {
  int buffer[10];
  int i = 0;
  while (i <= 10) {
    buffer[i] = 9999;
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jg     113d <main+0x3d>
movslq -0x44(%rbp),%rax
movl   $0x270f,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %7
%10 = icmp sle i32 %9, 10
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %13
store i32 9999, i32* %14
%15 = load i32, i32* %7
%16 = add nsw i32 %15, 1
store i32 %16, i32* %7
br label %8
17: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void LCDRasterSubPanelEnable(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x44050000);
  (*((volatile uint32_t *)(ui32Base + 0x00000038))) |= 0x80000000;
}


x86 assembly (clang, -O0):
<LCDRasterSubPanelEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x44050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%ecx
or     $0x80000000,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterSubPanelEnable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x44050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
orl    $0x80000000,0x38(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @LCDRasterSubPanelEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1141178368
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 56
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, -2147483648
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @LCDRasterSubPanelEnable(i32 %0) {
%2 = icmp eq i32 %0, 1141178368
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 56
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, -2147483648
store volatile i32 %9, i32* %7
ret void
}
int S_Base_GetVoiceAmplitude(int entnum) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @S_Base_GetVoiceAmplitude(i32 %0) {
ret i32 0
}
void foo(int i) {}


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
int fun1335() { return 1335; }


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

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

LLVM IR (-O0):
define i32 @fun1335() {
ret i32 1335
}

LLVM IR (-O2):
define i32 @fun1335() {
ret i32 1335
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void bsymb(char *s, int und) {
  printf("\t.section .bsymb; .long %s%s; .data\n", und ? "_" : "", s);
}


x86 assembly (clang, -O0):
<bsymb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xefb(%rip),%rsi
lea    0xef5(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
mov    -0x8(%rbp),%rdx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsymb>:
mov    %rdi,%rdx
test   %esi,%esi
lea    0xf08(%rip),%rax
lea    0xf02(%rip),%rsi
cmove  %rax,%rsi
lea    0xed2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\09.section .bsymb; .long %s%s; .data\0A\00"
@.str.1 = [2 x i8] c"_\00"
@.str.2 = [1 x i8] zeroinitializer
define void @bsymb(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"\09.section .bsymb; .long %s%s; .data\0A\00"
@.str.1 = [2 x i8] c"_\00"
@.str.2 = [1 x i8] zeroinitializer
define void @bsymb(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
ret void
}
/* Variables and functions */
int fio_lo_put_bytes(char const *, void *, int, char *);
int fio_put_bytes(const char *filename, void *data, int length) {
  return fio_lo_put_bytes(filename, data, length, "w");
}


x86 assembly (clang, -O0):
<fio_put_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xecb(%rip),%rcx
call   1030 <fio_lo_put_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fio_put_bytes>:
lea    0xee9(%rip),%rcx
jmp    1030 <fio_lo_put_bytes@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @fio_put_bytes(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @fio_lo_put_bytes(i8* %0, i8* %1, i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
const char *v8_nsf_to_str(int nsf) {
  switch (nsf) {
  case 0:
    return "???";
  }
  return "???";
}


x86 assembly (clang, -O0):
<v8_nsf_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <v8_nsf_to_str+0x27>
jmp    1117 <v8_nsf_to_str+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <v8_nsf_to_str+0x32>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<v8_nsf_to_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"???\00"
define i8* @v8_nsf_to_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"???\00"
define i8* @v8_nsf_to_str(i32 %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned int sys_call(int, unsigned int, unsigned int, unsigned int,
                      int /*<<< orphan*/);
unsigned int fb_write(unsigned int offset, void *buffer, unsigned int length) {
  return sys_call(0x12, offset, (unsigned int)buffer, length, 0);
}


x86 assembly (clang, -O0):
<fb_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x14(%rbp),%ecx
mov    $0x12,%edi
xor    %r8d,%r8d
call   1030 <sys_call@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_write>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x12,%edi
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @fb_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i32
%10 = load i32, i32* %6
%11 = call i32 @sys_call(i32 18, i32 %7, i32 %9, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
define i32 @fb_write(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @sys_call(i32 18, i32 %0, i32 %5, i32 %2, i32 0)
ret i32 %6
}
/* Variables and functions */
float asinhf(float);
void sAsinh_process(float bIn, float *bOut) { *bOut = asinhf(bIn); }


x86 assembly (clang, -O0):
<sAsinh_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asinhf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sAsinh_process>:
push   %rbx
mov    %rdi,%rbx
call   1030 <asinhf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sAsinh_process(float %0, float* nocapture writeonly %1) {
%3 = tail call float @asinhf(float %0)
store float %3, float* %1
ret void
}
void *mymalloc(x)
long x;
{
  void *mem;
  mem = (void *)calloc(1, x);
  if (!mem) {
    memerror();
    return (void *)mem;
  } else
    return (void *)mem;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115d <mymalloc+0x3d>
mov    $0x0,%al
call   1040 <memerror@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <mymalloc+0x45>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113d <mymalloc+0x1d>
xor    %eax,%eax
call   1040 <memerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @mymalloc(i64 %0) {
%2 = tail call i8* @calloc(i64 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @memerror()
br label %6
6: ; preds = %1, %4
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ col_on_comm(int *, int *, void *, int *, void *, int *, int);
void collect_on_comm_(int *comm, int *typesize, void *inbuf, int *ninbuf,
                      void *outbuf, int *noutbuf) {
  col_on_comm(comm, typesize, inbuf, ninbuf, outbuf, noutbuf, 1);
}


x86 assembly (clang, -O0):
<collect_on_comm_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
movl   $0x1,(%rsp)
call   1030 <col_on_comm@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collect_on_comm_>:
push   %rax
movl   $0x1,(%rsp)
call   1030 <col_on_comm@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @collect_on_comm_(i32* %0, i32* %1, i8* %2, i32* %3, i8* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i8* %2, i8** %9
store i32* %3, i32** %10
store i8* %4, i8** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = load i8*, i8** %9
%16 = load i32*, i32** %10
%17 = load i8*, i8** %11
%18 = load i32*, i32** %12
%19 = call i32 @col_on_comm(i32* %13, i32* %14, i8* %15, i32* %16, i8* %17, i32* %18, i32 1)
ret void
}

LLVM IR (-O2):
define void @collect_on_comm_(i32* %0, i32* %1, i8* %2, i32* %3, i8* %4, i32* %5) {
%7 = tail call i32 @col_on_comm(i32* %0, i32* %1, i8* %2, i32* %3, i8* %4, i32* %5, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ tfprintf(int /*<<< orphan*/, char *);
void usage() {
  tfprintf(stderr, "Usage: vegas_udp [options] sender_hostname\n"
                   "Options:\n"
                   "  -p n, --port=n    Port number\n"
                   "  -h, --help        This message\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <tfprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <tfprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [118 x i8] c"Usage: vegas_udp [options] sender_hostname\0AOptions:\0A -p n, --port=n Port number\0A -h, --help This message\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @tfprintf(i32 %1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [118 x i8] c"Usage: vegas_udp [options] sender_hostname\0AOptions:\0A -p n, --port=n Port number\0A -h, --help This message\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @tfprintf(i32 %1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
ret void
}