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

/* Variables and functions */
int /*<<< orphan*/ *FindFptr(void *, char const *);
int /*<<< orphan*/ genprintfile(void *, int /*<<< orphan*/ *, char const *);
int PrintFile(void *theEnv, const char *logicalName, const char *str) {
  FILE *fptr;
  fptr = FindFptr(theEnv, logicalName);
  genprintfile(theEnv, fptr, str);
  return (1);
}


x86 assembly (clang, -O0):
<PrintFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <FindFptr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <genprintfile@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintFile>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <FindFptr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <genprintfile@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @PrintFile(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32* @FindFptr(i8* %8, i8* %9)
store i32* %10, i32** %7
%11 = load i8*, i8** %4
%12 = load i32*, i32** %7
%13 = load i8*, i8** %6
%14 = call i32 @genprintfile(i8* %11, i32* %12, i8* %13)
ret i32 1
}

LLVM IR (-O2):
define i32 @PrintFile(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32* @FindFptr(i8* %0, i8* %1)
%5 = tail call i32 @genprintfile(i8* %0, i32* %4, i8* %2)
ret i32 1
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ls_sockaddr_get_length(struct sockaddr const *);
int /*<<< orphan*/ memcpy(struct sockaddr *, struct sockaddr const *,
                          int /*<<< orphan*/);
void ls_sockaddr_copy(const struct sockaddr *src, struct sockaddr *dest) {
  memcpy(dest, src, ls_sockaddr_get_length(src));
}


x86 assembly (clang, -O0):
<ls_sockaddr_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ls_sockaddr_get_length@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_sockaddr_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <ls_sockaddr_get_length@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define void @ls_sockaddr_copy(%struct.sockaddr* %0, %struct.sockaddr* %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
store %struct.sockaddr* %1, %struct.sockaddr** %4
%5 = load %struct.sockaddr*, %struct.sockaddr** %4
%6 = load %struct.sockaddr*, %struct.sockaddr** %3
%7 = load %struct.sockaddr*, %struct.sockaddr** %3
%8 = call i32 @ls_sockaddr_get_length(%struct.sockaddr* %7)
%9 = call i32 @memcpy(%struct.sockaddr* %5, %struct.sockaddr* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define void @ls_sockaddr_copy(%struct.sockaddr* %0, %struct.sockaddr* %1) {
%3 = tail call i32 @ls_sockaddr_get_length(%struct.sockaddr* %0)
%4 = tail call i32 @memcpy(%struct.sockaddr* %1, %struct.sockaddr* %0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ l;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy_s(char *, int, char *);
char *strstrip(char *s) {
  static char l[(1024) + 1];
  if (s == NULL)
    return NULL;
  memset(l, 0, (1024) + 1);
  strcpy_s((l), (sizeof(l) / sizeof(l[0])), (s));
  return (char *)l;
}


x86 assembly (clang, -O0):
<strstrip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <strstrip+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1177 <strstrip+0x57>
lea    0x2ef5(%rip),%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdx
lea    0x2ede(%rip),%rdi
mov    $0x401,%esi
call   1040 <strcpy_s@plt>
lea    0x2ecd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstrip>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1154 <strstrip+0x34>
mov    %rdi,%r14
lea    0x2f0d(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0x401,%esi
mov    %r14,%rdx
call   1040 <strcpy_s@plt>
jmp    1156 <strstrip+0x36>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@strstrip.l = internal global [1025 x i8] zeroinitializer
define i8* @strstrip(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %11
7: ; preds = %1
%8 = call i32 @memset(i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @strstrip.l, i64 0, i64 0), i32 0, i32 1025)
%9 = load i8*, i8** %3
%10 = call i32 @strcpy_s(i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @strstrip.l, i64 0, i64 0), i32 1025, i8* %9)
store i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @strstrip.l, i64 0, i64 0), i8** %2
br label %11
11: ; preds = %7, %6
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@strstrip.l = internal global [1025 x i8] zeroinitializer
define i8* @strstrip(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @memset(i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @strstrip.l, i64 0, i64 0), i32 0, i32 1025)
%5 = tail call i32 @strcpy_s(i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @strstrip.l, i64 0, i64 0), i32 1025, i8* %0)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ getelementptr inbounds ([1025 x i8], [1025 x i8]* @strstrip.l, i64 0, i64 0), %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
void mic_push_alloc(double *data, size_t nelem, int device, int offload) {
#pragma offload_transfer target(mic                                            \
                                : device)                                      \
    in(data                                                                    \
       : length(nelem) alloc_if(1) free_if(0)) if (offload)
}


x86 assembly (clang, -O0):
<mic_push_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mic_push_alloc(double* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @mic_push_alloc(double* nocapture %0, i64 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int nrf_read_register(int, char *, char *);
int nrf_get_lost_packets_count(int *count, char *retstatus) {
  int ret;
  char obstxreg;
  ret = nrf_read_register(0x08, &obstxreg, retstatus);
  *count = (int)((obstxreg & 0xF0) >> 4);
  return ret;
}


x86 assembly (clang, -O0):
<nrf_get_lost_packets_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x8,%edi
lea    -0x15(%rbp),%rsi
call   1030 <nrf_read_register@plt>
mov    %eax,-0x14(%rbp)
movsbl -0x15(%rbp),%ecx
and    $0xf0,%ecx
sar    $0x4,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_get_lost_packets_count>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xf(%rsp),%rsi
mov    $0x8,%edi
call   1030 <nrf_read_register@plt>
movzbl 0xf(%rsp),%ecx
shr    $0x4,%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrf_get_lost_packets_count(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i32* %0, i32** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @nrf_read_register(i32 8, i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = and i32 %10, 240
%12 = ashr i32 %11, 4
%13 = load i32*, i32** %3
store i32 %12, i32* %13
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @nrf_get_lost_packets_count(i32* nocapture writeonly %0, i8* %1) {
%3 = alloca i8
%4 = call i32 @nrf_read_register(i32 8, i8* %3, i8* %1)
%5 = load i8, i8* %3
%6 = lshr i8 %5, 4
%7 = zext i8 %6 to i32
store i32 %7, i32* %0
ret i32 %4
}
int foo(i)
int i;
{ return bar(i); }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @bar to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *my_itoa(int n, char *buf) {
  snprintf(buf, (8192), "%d", n);
  return buf;
}


x86 assembly (clang, -O0):
<my_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x2000,%esi
lea    0xece(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_itoa>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ecx
lea    0xee3(%rip),%rdx
mov    %rsi,%rdi
mov    $0x2000,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @my_itoa(i32 %0, i8* returned %1) {
%3 = tail call i32 @snprintf(i8* %1, i32 8192, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %1
}
yyErr(n, l) { yyAbort(n, "lexinfo", l); }


x86 assembly (clang, -O0):
<yyErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <yyAbort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"lexinfo\00"
define i32 @yyErr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"lexinfo\00"
define i32 @yyErr(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_socket_settos_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_socket@%p::settos (rtpp_socket_settos) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_socket_settos_fin>:
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
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_socket_settos_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [81 x i8] c"Method rtpp_socket@%p::settos (rtpp_socket_settos) is invoked after destruction\0A\00"
define void @rtpp_socket_settos_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [81 x i8] c"Method rtpp_socket@%p::settos (rtpp_socket_settos) is invoked after destruction\0A\00"
define void @rtpp_socket_settos_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int mod4_calc(int a, int b) { return (unsigned int)(a + b) % 4; }


x86 assembly (clang, -O0):
<mod4_calc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod4_calc>:
lea    (%rdi,%rsi,1),%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mod4_calc(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 = add nsw i32 %5, %6
%8 = urem i32 %7, 4
ret i32 %8
}

LLVM IR (-O2):
define i32 @mod4_calc(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = and i32 %3, 3
ret i32 %4
}
void genmul_d() {}


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

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

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

LLVM IR (-O2):
define void @genmul_d() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void print_bar(int n) {
  printf("+");
  for (int i = 0; i < n; i++)
    putchar('-');
  printf("+\n");
}


x86 assembly (clang, -O0):
<print_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1162 <print_bar+0x42>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <print_bar+0x1e>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bar>:
push   %rbx
mov    %edi,%ebx
mov    $0x2b,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    114f <print_bar+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1140 <print_bar+0x20>
lea    0xeaa(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"+\00"
define void @print_bar(i32 %0) {
%2 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 43)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @putchar(i8 signext 45)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %4, label %6
}
/* Variables and functions */
char *stpncpy(char *restrict dest, const char *restrict src, size_t n) {
  return dest + n;
}


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

x86 assembly (clang, -O2):
<stpncpy>:
lea    (%rdi,%rdx,1),%rax
ret

LLVM IR (-O0):
define i8* @stpncpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = getelementptr inbounds i8, i8* %7, i64 %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @stpncpy(i8* noalias readnone %0, i8* noalias nocapture readnone %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %2
ret i8* %4
}
int clampMinMax(int val, int min, int max) {
  if (val < min)
    return min;
  if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<clampMinMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <clampMinMax+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clampMinMax+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <clampMinMax+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clampMinMax+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampMinMax>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clampMinMax(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Invoke with NUM_PROCS NUM_REPS\n");
  exit(-1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Invoke with NUM_PROCS NUM_REPS\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Invoke with NUM_PROCS NUM_REPS\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int ft_intlen(int n) {
  int i;
  i = 0;
  if (n == 0)
    return (1);
  while (n != 0) {
    n /= 10;
    ++i;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_intlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <ft_intlen+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1155 <ft_intlen+0x55>
jmp    1129 <ft_intlen+0x29>
cmpl   $0x0,-0x8(%rbp)
je     114f <ft_intlen+0x4f>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <ft_intlen+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_intlen>:
test   %edi,%edi
je     1133 <ft_intlen+0x33>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <ft_intlen+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_intlen(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _start_statsd_connection(uint32_t ip, uint16_t port) {
  printf("initializing statsd connection...\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"initializing statsd connection...\0A\00"
define void @_start_statsd_connection(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"initializing statsd connection...\00"
define void @_start_statsd_connection(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}
int compare_int(const void *a, const void *b) {
  return (*((int *)a)) - (*((int *)b));
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compare_int(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void atomic_scrub(void *addr, int size) { return; }


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

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

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

LLVM IR (-O2):
define void @atomic_scrub(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ accpetClient(int);
int /*<<< orphan*/ closeHttpd(int);
int startup(int);
int main(void) {
  int httpd = startup(9999);
  while (true) {
    accpetClient(httpd);
  }
  closeHttpd(httpd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x270f,%edi
call   1040 <startup@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <accpetClient@plt>
jmp    113c <main+0x1c>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x270f,%edi
call   1040 <startup@plt>
mov    %eax,%ebx
nopl   (%rax)
mov    %ebx,%edi
call   1030 <accpetClient@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @startup(i32 9999)
store i32 %3, i32* %2
br label %4
4: ; preds = %0, %4
%5 = load i32, i32* %2
%6 = call i32 @accpetClient(i32 %5)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @startup(i32 9999)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @accpetClient(i32 %1)
br label %2
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float randf(void) { return (float)rand() / RAND_MAX; }


x86 assembly (clang, -O0):
<randf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec1(%rip),%rax
divss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randf>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @randf() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
ret float %4
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @randf() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ txt_write_to_screens(char const *, int, int /*<<< orphan*/,
                                        int);
void warnk(const char *what) { txt_write_to_screens(what, 23, 0, 0x0E); }


x86 assembly (clang, -O0):
<warnk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x17,%esi
xor    %edx,%edx
mov    $0xe,%ecx
call   1030 <txt_write_to_screens@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warnk>:
mov    $0x17,%esi
xor    %edx,%edx
mov    $0xe,%ecx
jmp    1030 <txt_write_to_screens@plt>

LLVM IR (-O0):
define void @warnk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @txt_write_to_screens(i8* %3, i32 23, i32 0, i32 14)
ret void
}

LLVM IR (-O2):
define void @warnk(i8* %0) {
%2 = tail call i32 @txt_write_to_screens(i8* %0, i32 23, i32 0, i32 14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mmu_invalidate_dcache_line(void *);
int /*<<< orphan*/ mmu_invalidate_icache_line(void *);
void mmu_invalidate_cache_line(void *addr) {
  mmu_invalidate_icache_line(addr);
  mmu_invalidate_dcache_line(addr);
}


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

x86 assembly (clang, -O2):
<mmu_invalidate_cache_line>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mmu_invalidate_icache_line@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mmu_invalidate_dcache_line@plt>

LLVM IR (-O0):
define void @mmu_invalidate_cache_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mmu_invalidate_icache_line(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @mmu_invalidate_dcache_line(i8* %5)
ret void
}

LLVM IR (-O2):
define void @mmu_invalidate_cache_line(i8* %0) {
%2 = tail call i32 @mmu_invalidate_icache_line(i8* %0)
%3 = tail call i32 @mmu_invalidate_dcache_line(i8* %0)
ret void
}
int test_imm_A7uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xA7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A7uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xa7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A7uint64_midword_reg>:
test   $0xa70000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A7uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 167
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_A7uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10944512
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void send_msg1(void) {
  static char msg[] = "Hello World\r\n";
  write(1, msg, strlen(msg));
}


x86 assembly (clang, -O0):
<send_msg1>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f05(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0x2ef2(%rip),%rsi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_msg1>:
push   %rbx
lea    0x2f08(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@send_msg1.msg = internal global [14 x i8] c"Hello World\0D\0A\00"
define void @send_msg1() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @send_msg1.msg, i64 0, i64 0))
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @send_msg1.msg, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@send_msg1.msg = internal global [14 x i8] c"Hello World\0D\0A\00"
define void @send_msg1() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @send_msg1.msg, i64 0, i64 0))
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @send_msg1.msg, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
double ceil(double const);
double const floor(double const);
char f_round(double *a, const double *b) {
  if (*b - floor(*b) >= 0.5) {
    *a = ceil(*b);
  } else {
    *a = floor(*b);
  }
  return (0);
}


x86 assembly (clang, -O0):
<f_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xea2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1182 <f_round+0x62>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <ceil@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1197 <f_round+0x77>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <floor@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_round>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  (%rsi),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <floor@plt>
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
ucomisd 0xeb3(%rip),%xmm1
jb     1158 <f_round+0x38>
movapd %xmm2,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @f_round(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = call double @floor(double %8)
%10 = fsub double %6, %9
%11 = fcmp oge double %10, 5.000000e-01
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load double*, double** %4
%14 = load double, double* %13
%15 = call double @llvm.ceil.f64(double %14)
%16 = load double*, double** %3
store double %15, double* %16
br label %22
17: ; preds = %2
%18 = load double*, double** %4
%19 = load double, double* %18
%20 = call double @floor(double %19)
%21 = load double*, double** %3
store double %20, double* %21
br label %22
22: ; preds = %17, %12
ret i8 0
}

LLVM IR (-O2):
define signext i8 @f_round(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fsub double %3, %4
%6 = fcmp ult double %5, 5.000000e-01
%7 = tail call double @llvm.ceil.f64(double %3)
%8 = select i1 %6, double %4, double %7
store double %8, double* %0
ret i8 0
}
void *obs_id_(void *id_) { return id_; }


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

x86 assembly (clang, -O2):
<obs_id_>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @obs_id_(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Flush_Buffer(int);
unsigned int Show_Bits(int);
unsigned int Get_Bits(signed int N) {
  unsigned int Val;
  Val = Show_Bits(N);
  Flush_Buffer(N);
  return Val;
}


x86 assembly (clang, -O0):
<Get_Bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Show_Bits@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <Flush_Buffer@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Bits>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <Show_Bits@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <Flush_Buffer@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Get_Bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @Show_Bits(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @Flush_Buffer(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @Get_Bits(i32 %0) {
%2 = tail call i32 @Show_Bits(i32 %0)
%3 = tail call i32 @Flush_Buffer(i32 %0)
ret i32 %2
}
int main(int argc, const char *argv[]) {
  int i;
  int current;
  int next;
  int twoaway;
  next = current = 1;
  for (i = 0; i < 10; i++) {
    twoaway = current + next;
    current = next;
    next = twoaway;
  }
  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   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1154 <main+0x54>
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <main+0x27>
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 i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
store i32 1, i32* %8
store i32 0, i32* %6
br label %10
10: ; preds = %19, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = add nsw i32 %14, %15
store i32 %16, i32* %9
%17 = load i32, i32* %8
store i32 %17, i32* %7
%18 = load i32, i32* %9
store i32 %18, i32* %8
br label %19
19: ; preds = %13
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %10
22: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void put1(const char *string) {
  while (*string != '\0') {
    putchar(*string++);
  }
}


x86 assembly (clang, -O0):
<put1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <put1+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <put1+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @put1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @putchar(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *strchr(char const *, int);
int strlen(char const *);
char *strchrnul(const char *s, int c) {
  const char *found = strchr(s, c);
  if (NULL == found) {
    found = s + strlen(s);
  }
  return (char *)found;
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    116c <strchrnul+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strchr@plt>
test   %rax,%rax
je     1130 <strchrnul+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ %8, %5 ], [ %3, %2 ]
ret i8* %10
}
void *mem_lock(void *ptr) { return (ptr); }


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

x86 assembly (clang, -O2):
<mem_lock>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @mem_lock(i8* readnone returned %0) {
ret i8* %0
}
void PEM_dek_info(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_dek_info() {
ret void
}
char *XGetOMValues() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @XGetOMValues() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *);
char *name_get(unsigned int);
int /*<<< orphan*/ printf(char *, char const *);
int remove(char const *);
void do_unlink(unsigned name) {
  const char *namestr;
  namestr = name_get(name);
  if (remove(namestr) == -1) {
    err(1, "%s: remove", namestr);
  }
  printf("remove %s\n", namestr);
}


x86 assembly (clang, -O0):
<do_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <name_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0xffffffff,%eax
jne    117e <do_unlink+0x3e>
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    0xe87(%rip),%rsi
call   1050 <err@plt>
mov    -0x10(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_unlink>:
push   %rbx
call   1060 <name_get@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <remove@plt>
cmp    $0xffffffff,%eax
jne    116a <do_unlink+0x2a>
lea    0xea3(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1050 <err@plt>
lea    0xe9a(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s: remove\00"
@.str.1 = [11 x i8] c"remove %s\0A\00"
define void @do_unlink(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @name_get(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @remove(i8* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @err(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %3
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s: remove\00"
@.str.1 = [11 x i8] c"remove %s\0A\00"
define void @do_unlink(i32 %0) {
%2 = tail call i8* @name_get(i32 %0)
%3 = tail call i32 @remove(i8* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isxdigit(char const);
bool is_hex(const char *s) {
  const char *ptr = s;
  while (*++ptr) {
    if (!isxdigit(*ptr)) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<is_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,0x1(%rax)
je     1163 <is_hex+0x53>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%eax
jne    115e <is_hex+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    116a <is_hex+0x5a>
jmp    1124 <is_hex+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex>:
push   %rbx
mov    %rdi,%rbx
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
test   %al,%al
je     113b <is_hex+0x2b>
movsbl %al,%edi
call   1030 <isxdigit@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1120 <is_hex+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_hex(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %4, %7 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @isxdigit(i8 signext %5)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %2
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %11
}
int main_restart(int argc, char **argv) {
  (void)argc, (void)argv;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main_restart(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
unsigned char f7(unsigned char x, int y) { return (x << y) | (x >> (8 - y)); }


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f7(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 8, %11
%13 = ashr i32 %10, %12
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @f7(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}