xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SQLITE_CONFIG_LOG;
int sqlite3_config(int /*<<< orphan*/, void (*)(void *, int, char const *),
                   void *);
int persistent_sqlite_set_log(void (*logFn)(void *, int, const char *),
                              void *arg) {
  return sqlite3_config(SQLITE_CONFIG_LOG, logFn, arg);
}


x86 assembly (clang, -O0):
<persistent_sqlite_set_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <sqlite3_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<persistent_sqlite_set_log>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2edb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sqlite3_config@plt>

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

LLVM IR (-O2):
@SQLITE_CONFIG_LOG = global i32 0
define i32 @persistent_sqlite_set_log(void (i8*, i32, i8*)* %0, i8* %1) {
%3 = load i32, i32* @SQLITE_CONFIG_LOG
%4 = tail call i32 @sqlite3_config(i32 %3, void (i8*, i32, i8*)* %0, i8* %1)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t rtpx_get_length(const uint8_t *p_rtpx) {
  return (p_rtpx[2] << 8) | p_rtpx[3];
}


x86 assembly (clang, -O0):
<rtpx_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtpx_get_length>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rtpx_get_length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @rtpx_get_length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x_base;
  scalar_t__ x_private;
};
typedef TYPE_1__ XDR;

/* Variables and functions */
unsigned int xdrmem_getpos(const XDR *xdrs) {
  return ((unsigned long)xdrs->x_private - (unsigned long)xdrs->x_base);
}


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

x86 assembly (clang, -O2):
<xdrmem_getpos>:
mov    0x8(%rdi),%eax
sub    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define i32 @xdrmem_getpos(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sub i64 %5, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i64 }
define i32 @xdrmem_getpos(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = sub i64 %3, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int waddch(int /*<<< orphan*/ *, int /*<<< orphan*/ const);
int __darwin_waddch(WINDOW *w, const uint32_t c) { return waddch(w, c); }


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

x86 assembly (clang, -O2):
<__darwin_waddch>:
jmp    1030 <waddch@plt>

LLVM IR (-O0):
define i32 @__darwin_waddch(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 @waddch(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__darwin_waddch(i32* %0, i32 %1) {
%3 = tail call i32 @waddch(i32* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *malloc(size_t const);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
char *Fnv1a_create_string(uint32_t const inHash) {
  size_t const charCount = 4 * 2 + 1;
  char *retVal = malloc(charCount * (sizeof *retVal));
  assert(retVal != NULL);
  sprintf(retVal, "%x", (unsigned int)inHash);
  retVal[charCount - 1] = '\0';
  return retVal;
}


x86 assembly (clang, -O0):
<Fnv1a_create_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x9,-0x10(%rbp)
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xe8b(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0x8(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fnv1a_create_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
call   1050 <sprintf@plt>
movb   $0x0,0x8(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define i8* @Fnv1a_create_string(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %2
store i64 9, i64* %3
%5 = call i8* @malloc(i64 9)
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %4
%11 = load i64, i64* %2
%12 = trunc i64 %11 to i32
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 8
store i8 0, i8* %15
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define noalias i8* @Fnv1a_create_string(i64 %0) {
%2 = tail call dereferenceable_or_null(9) i8* @malloc(i64 9)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = trunc i64 %0 to i32
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds i8, i8* %2, i64 8
store i8 0, i8* %8
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ __NR_pivot_root;
int syscall(int /*<<< orphan*/, char const *, char const *);
int pivot_root(const char *new_root, const char *put_old) {
  return syscall(__NR_pivot_root, new_root, put_old);
}


x86 assembly (clang, -O0):
<pivot_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pivot_root>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_pivot_root = global i32 0
define i32 @pivot_root(i8* %0, i8* %1) {
%3 = load i32, i32* @__NR_pivot_root
%4 = tail call i32 @syscall(i32 %3, i8* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
size_t len_str(char *str) {
  size_t i;
  for (i = 0; str[i] != '\0'; i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<len_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113b <len_str+0x3b>
jmp    112a <len_str+0x2a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <len_str+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len_str>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <len_str+0x10>
ret

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

LLVM IR (-O2):
define i64 @len_str(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fstat(int, struct stat *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, char *);
void ls(char *path) {
  int fd, size;
  struct stat stat;
  fd = open(path, O_RDONLY);
  fstat(fd, &stat);
  size = stat.st_size;
  printf("%6d %s\n", size, path);
  close(fd);
}


x86 assembly (clang, -O0):
<ls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1060 <fstat@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebp
mov    %rsp,%rsi
mov    %eax,%edi
call   1060 <fstat@plt>
mov    (%rsp),%esi
lea    0xe96(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <close@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@O_RDONLY = global i32 0
@.str = [8 x i8] c"%6d %s\0A\00"
define void @ls(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @fstat(i32 %9, %struct.stat* %5)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = load i8*, i8** %2
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %14)
%16 = load i32, i32* %3
%17 = call i32 @close(i32 %16)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@O_RDONLY = global i32 0
@.str = [8 x i8] c"%6d %s\0A\00"
define void @ls(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = call i32 @fstat(i32 %5, %struct.stat* %2)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %0)
%10 = tail call i32 @close(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("one %d two\n", 1);
  printf("one %d two %d three\n", 1, 2);
  printf("one two three\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"one %d two\0A\00"
@.str.1 = [21 x i8] c"one %d two %d three\0A\00"
@.str.2 = [15 x i8] c"one two three\0A\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"one %d two\0A\00"
@.str.1 = [21 x i8] c"one %d two %d three\0A\00"
@str = [14 x i8] c"one two three\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort_if_false(int /*<<< orphan*/);
int /*<<< orphan*/ expect_nonnull(char const *, int, void const *);
void assert_nonnull(const char *file, int line, const void *ptr) {
  expect_nonnull(file, line, ptr);
  abort_if_false(ptr != NULL);
}


x86 assembly (clang, -O0):
<assert_nonnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <expect_nonnull@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <abort_if_false@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_nonnull>:
push   %rbx
mov    %rdx,%rbx
call   1040 <expect_nonnull@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
pop    %rbx
jmp    1030 <abort_if_false@plt>

LLVM IR (-O0):
define void @assert_nonnull(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @expect_nonnull(i8* %7, i32 %8, i8* %9)
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @abort_if_false(i32 %13)
ret void
}

LLVM IR (-O2):
define void @assert_nonnull(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @expect_nonnull(i8* %0, i32 %1, i8* %2)
%5 = icmp ne i8* %2, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @abort_if_false(i32 %6)
ret void
}
int addOK(int x, int y) {
  int signSum = (x + y) >> 31;
  int signX = x >> 31;
  int signY = y >> 31;
  return !(~(signX ^ signY) & (signX ^ signSum));
}


x86 assembly (clang, -O0):
<addOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x10(%rbp),%ecx
xor    -0xc(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addOK>:
lea    (%rsi,%rdi,1),%eax
sar    $0x1f,%eax
sar    $0x1f,%edi
sar    $0x1f,%esi
xor    %edi,%esi
not    %esi
xor    %eax,%edi
xor    %eax,%eax
test   %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @addOK(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = ashr i32 %10, 31
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = ashr i32 %12, 31
store i32 %13, i32* %6
%14 = load i32, i32* %4
%15 = ashr i32 %14, 31
store i32 %15, i32* %7
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = xor i32 %16, %17
%19 = xor i32 %18, -1
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = xor i32 %20, %21
%23 = and i32 %19, %22
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @addOK(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = ashr i32 %3, 31
%5 = ashr i32 %0, 31
%6 = ashr i32 %1, 31
%7 = xor i32 %5, %6
%8 = xor i32 %7, -1
%9 = xor i32 %4, %5
%10 = and i32 %9, %8
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: logname\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    $0x1,%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    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"usage: logname\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ UtilsDelay(int);
void RTCUseSet(void) {
  unsigned short usRegValue;
  usRegValue = (*(unsigned short *)(0x4402F800 + 0x00000420 + 2)) | (1 << 15);
  UtilsDelay((80 * 200) / 3);
  (*(unsigned short *)(0x4402F800 + 0x00000420 + 2)) = usRegValue;
}


x86 assembly (clang, -O0):
<RTCUseSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4402fc22,%eax
movzwl (%rax),%eax
or     $0x8000,%eax
mov    %ax,-0x2(%rbp)
mov    $0x14d5,%edi
call   1030 <UtilsDelay@plt>
mov    -0x2(%rbp),%cx
mov    $0x4402fc22,%eax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTCUseSet>:
push   %rbx
mov    $0x8000,%bx
or     0x4402fc22,%bx
44
mov    $0x14d5,%edi
call   1030 <UtilsDelay@plt>
mov    %bx,0x4402fc22
44
pop    %rbx
ret

LLVM IR (-O0):
define void @RTCUseSet() {
%1 = alloca i16
%2 = load i16, i16* inttoptr (i64 1141046306 to i16*)
%3 = zext i16 %2 to i32
%4 = or i32 %3, 32768
%5 = trunc i32 %4 to i16
store i16 %5, i16* %1
%6 = call i32 @UtilsDelay(i32 5333)
%7 = load i16, i16* %1
store i16 %7, i16* inttoptr (i64 1141046306 to i16*)
ret void
}

LLVM IR (-O2):
define void @RTCUseSet() {
%1 = load i16, i16* inttoptr (i64 1141046306 to i16*)
%2 = or i16 %1, -32768
%3 = tail call i32 @UtilsDelay(i32 5333)
store i16 %2, i16* inttoptr (i64 1141046306 to i16*)
ret void
}
void rop3_45_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_45_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_45_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
not    %cl
or     %sil,%cl
xor    %dl,%cl
xor    %cl,%al
and    %sil,%al
xor    %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_45_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_45_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %5, %1
%7 = xor i8 %6, %2
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %4, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
void stress_ftrace_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @stress_ftrace_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _zlog_buffer_unlock();
void zlog_finish_buffer(void) { _zlog_buffer_unlock(); }


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

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

LLVM IR (-O0):
define void @zlog_finish_buffer() {
%1 = call i32 (...) @_zlog_buffer_unlock()
ret void
}

LLVM IR (-O2):
define void @zlog_finish_buffer() {
%1 = tail call i32 (...) @_zlog_buffer_unlock()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
char *ny_str(unsigned int ny) {
  static char string[30];
  if (ny == 0)
    return "-1";
  sprintf(string, "%u", ny);
  return string;
}


x86 assembly (clang, -O0):
<ny_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <ny_str+0x25>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <ny_str+0x46>
mov    -0xc(%rbp),%edx
lea    0x2f01(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2eee(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ny_str>:
push   %rbx
test   %edi,%edi
je     112f <ny_str+0x1f>
mov    %edi,%edx
lea    0x2f22(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    1136 <ny_str+0x26>
lea    0xeca(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ny_str.string = internal global [30 x i8] zeroinitializer
@.str = [3 x i8] c"-1\00"
@.str.1 = [3 x i8] c"%u\00"
define i8* @ny_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @ny_str.string, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @ny_str.string, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@ny_str.string = internal global [30 x i8] zeroinitializer
@.str = [3 x i8] c"-1\00"
@.str.1 = [3 x i8] c"%u\00"
define i8* @ny_str(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @ny_str.string, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @ny_str.string, i64 0, i64 0), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void mqc_abort_(void) {
  fflush(stdout);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<mqc_abort_>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<mqc_abort_>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
define void @mqc_abort_() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
define void @mqc_abort_() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ uwsgi_add_safe_fd(int);
int /*<<< orphan*/ uwsgi_log(char *, int);
void uwsgi_opt_safe_fd(char *opt, char *value, void *foobar) {
  int fd = atoi(value);
  if (fd < 0) {
    uwsgi_log("invalid file descriptor: %d\n", fd);
    exit(1);
  }
  uwsgi_add_safe_fd(fd);
}


x86 assembly (clang, -O0):
<uwsgi_opt_safe_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1183 <uwsgi_opt_safe_fd+0x43>
mov    -0x1c(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <uwsgi_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%edi
call   1060 <uwsgi_add_safe_fd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_opt_safe_fd>:
push   %rax
mov    %rsi,%rdi
call   1040 <atoi@plt>
test   %eax,%eax
js     1155 <uwsgi_opt_safe_fd+0x15>
mov    %eax,%edi
pop    %rax
jmp    1060 <uwsgi_add_safe_fd@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1030 <uwsgi_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"invalid file descriptor: %d\0A\00"
define void @uwsgi_opt_safe_fd(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** %5
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i32, i32* %7
%14 = call i32 @uwsgi_log(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %3
%17 = load i32, i32* %7
%18 = call i32 @uwsgi_add_safe_fd(i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"invalid file descriptor: %d\0A\00"
define void @uwsgi_opt_safe_fd(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = tail call i32 @atoi(i8* %1)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @uwsgi_log(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
%10 = tail call i32 @uwsgi_add_safe_fd(i32 %4)
ret void
}
/* Variables and functions */
int MIN(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 1;
  int b = 2;
  int c = MIN(a, b);
  printf("c:%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <MIN@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <MIN@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"c:%d\0A\00"
define i32 @main() {
%1 = tail call i32 @MIN(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int write(int, char *, int);
int sendfin(int sock) {
  int bsent;
  bsent = write(sock, "FIN", sizeof("FIN"));
  if (bsent < sizeof("FIN"))
    return (-1);
  return 0;
}


x86 assembly (clang, -O0):
<sendfin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x4,%rax
jae    114c <sendfin+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <sendfin+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendfin>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x4,%eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"FIN\00"
define i32 @sendfin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"FIN\00"
define i32 @sendfin(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp ult i32 %2, 4
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ const *);
char *ctime(const time_t *timer) { return asctime(localtime(timer)); }


x86 assembly (clang, -O0):
<ctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime>:
push   %rax
call   1030 <localtime@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <asctime@plt>

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

LLVM IR (-O2):
define i8* @ctime(i32* %0) {
%2 = tail call i32 @localtime(i32* %0)
%3 = tail call i8* @asctime(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void CarStep3(void) { printf("CarStep3\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"CarStep3\00"
define void @CarStep3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
void finalize() {}


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

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

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

LLVM IR (-O2):
define void @finalize() {
ret void
}
void lor_test(void) {
  int i;
  i = 1 || 2;
}


x86 assembly (clang, -O0):
<lor_test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lor_test() {
ret void
}
int doNEGATE(int v1) { return v1 * (-1); }


x86 assembly (clang, -O0):
<doNEGATE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xffffffff,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doNEGATE>:
mov    %edi,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @doNEGATE(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
int check_term_lock(char *name) {}


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

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

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

LLVM IR (-O2):
define i32 @check_term_lock(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int varint64(char *data, int64_t *value) {
  int64_t result = 0;
  int shifts = 0;
  do {
    result |= ((0x7F & *data) << (shifts * 7));
    shifts++;
  } while ((*data++ & 0x80));
  *value = result;
  return shifts;
}


x86 assembly (clang, -O0):
<varint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x7f,%eax
imul   $0x7,-0x18(%rbp),%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    111a <varint64+0x1a>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<varint64>:
xor    %ecx,%ecx
xor    %eax,%eax
xor    %r9d,%r9d
nopw   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%r8d
mov    %r8d,%edx
and    $0x7f,%edx
shl    %cl,%edx
or     %edx,%r9d
add    $0x1,%rax
add    $0x7,%ecx
test   $0x80,%r8b
jne    1110 <varint64+0x10>
mov    %r9d,(%rsi)
ret

LLVM IR (-O0):
define i32 @varint64(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
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = and i32 127, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 7
%14 = shl i32 %11, %13
%15 = load i32, i32* %5
%16 = or i32 %15, %14
store i32 %16, i32* %5
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %19
19: ; preds = %7
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
%22 = load i8, i8* %20
%23 = sext i8 %22 to i32
%24 = and i32 %23, 128
%25 = icmp ne i32 %24, 0
br i1 %25, label %7, label %26
26: ; preds = %19
%27 = load i32, i32* %5
%28 = load i32*, i32** %4
store i32 %27, i32* %28
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
define i32 @varint64(i8* nocapture %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %14, %3 ]
%5 = phi i32 [ 0, %2 ], [ %12, %3 ]
%6 = phi i32 [ 0, %2 ], [ %13, %3 ]
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = and i32 %8, 127
%10 = mul nsw i32 %6, 7
%11 = shl i32 %9, %10
%12 = or i32 %11, %5
%13 = add nuw nsw i32 %6, 1
%14 = getelementptr inbounds i8, i8* %4, i64 1
%15 = and i32 %8, 128
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %3
17: ; preds = %3
store i32 %12, i32* %1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void htmlFooter() { printf("</BODY></HTML>"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"</BODY></HTML>\00"
define void @htmlFooter() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"</BODY></HTML>\00"
define void @htmlFooter() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
char encode(unsigned char u) {
  if (u < 26) {
    return 'A' + u;
  }
  if (u < 52) {
    return 'a' + (u - 26);
  }
  if (u < 62) {
    return '0' + (u - 52);
  }
  if (u == 62) {
    return '+';
  }
  return '/';
}


x86 assembly (clang, -O0):
<encode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x1a,%eax
jge    1126 <encode+0x26>
movzbl -0x2(%rbp),%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    117e <encode+0x7e>
movzbl -0x2(%rbp),%eax
cmp    $0x34,%eax
jge    1145 <encode+0x45>
movzbl -0x2(%rbp),%eax
sub    $0x1a,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    117e <encode+0x7e>
movzbl -0x2(%rbp),%eax
cmp    $0x3e,%eax
jge    1164 <encode+0x64>
movzbl -0x2(%rbp),%eax
sub    $0x34,%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    117e <encode+0x7e>
movzbl -0x2(%rbp),%eax
cmp    $0x3e,%eax
jne    117a <encode+0x7a>
movb   $0x2b,-0x1(%rbp)
jmp    117e <encode+0x7e>
movb   $0x2f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode>:
mov    %edi,%eax
cmp    $0x19,%al
ja     1109 <encode+0x9>
add    $0x41,%al
ret
cmp    $0x33,%al
ja     1110 <encode+0x10>
add    $0x47,%al
ret
cmp    $0x3d,%al
ja     1117 <encode+0x17>
add    $0xfc,%al
ret
cmp    $0x3e,%al
setne  %al
shl    $0x2,%al
or     $0x2b,%al
ret

LLVM IR (-O0):
define signext i8 @encode(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 26
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = add nsw i32 65, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %38
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp slt i32 %14, 52
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = sub nsw i32 %18, 26
%20 = add nsw i32 97, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %38
22: ; preds = %12
%23 = load i8, i8* %3
%24 = zext i8 %23 to i32
%25 = icmp slt i32 %24, 62
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = sub nsw i32 %28, 52
%30 = add nsw i32 48, %29
%31 = trunc i32 %30 to i8
store i8 %31, i8* %2
br label %38
32: ; preds = %22
%33 = load i8, i8* %3
%34 = zext i8 %33 to i32
%35 = icmp eq i32 %34, 62
br i1 %35, label %36, label %37
36: ; preds = %32
store i8 43, i8* %2
br label %38
37: ; preds = %32
store i8 47, i8* %2
br label %38
38: ; preds = %37, %36, %26, %16, %7
%39 = load i8, i8* %2
ret i8 %39
}

LLVM IR (-O2):
define signext i8 @encode(i8 zeroext %0) {
%2 = icmp ult i8 %0, 26
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nuw nsw i8 %0, 65
br label %16
5: ; preds = %1
%6 = icmp ult i8 %0, 52
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = add nuw nsw i8 %0, 71
br label %16
9: ; preds = %5
%10 = icmp ult i8 %0, 62
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = add nsw i8 %0, -4
br label %16
13: ; preds = %9
%14 = icmp eq i8 %0, 62
%15 = select i1 %14, i8 43, i8 47
br label %16
16: ; preds = %13, %11, %7, %3
%17 = phi i8 [ %4, %3 ], [ %8, %7 ], [ %12, %11 ], [ %15, %13 ]
ret i8 %17
}
/* Variables and functions */
int /*<<< orphan*/ modify_string(char *, int);
int /*<<< orphan*/ print_string(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char str[100];
  int n;
  scanf("%s", str);
  scanf("%d", &n);
  modify_string(str, n);
  print_string(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xea8(%rip),%rdi
lea    -0x74(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
call   1030 <modify_string@plt>
lea    -0x70(%rbp),%rdi
call   1040 <print_string@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xec1(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeae(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <modify_string@plt>
mov    %rbx,%rdi
call   1040 <print_string@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @modify_string(i8* %7, i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i32 @print_string(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @modify_string(i8* %3, i32 %7)
%9 = call i32 @print_string(i8* %3)
ret i32 0
}
float f(float x) {
  float f = 5.0;
  float y = f + x * f * x + x * f - f * x * x;
  return 2.0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe8b(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
store float 5.000000e+00, float* %3
%5 = load float, float* %3
%6 = load float, float* %2
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = load float, float* %2
%10 = call float @llvm.fmuladd.f32(float %8, float %9, float %5)
%11 = load float, float* %2
%12 = load float, float* %3
%13 = call float @llvm.fmuladd.f32(float %11, float %12, float %10)
%14 = load float, float* %3
%15 = load float, float* %2
%16 = fmul float %14, %15
%17 = load float, float* %2
%18 = fneg float %16
%19 = call float @llvm.fmuladd.f32(float %18, float %17, float %13)
store float %19, float* %4
ret float 2.000000e+00
}

LLVM IR (-O2):
define float @f(float %0) {
ret float 2.000000e+00
}
__attribute__((always_)) unsigned int cpumask_check(unsigned int cpu) {
  return cpu;
}


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

x86 assembly (clang, -O2):
<cpumask_check>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cpumask_check(i32 returned %0) {
ret i32 %0
}
void iotransmitstart(struct audioio *audioio) {}


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

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

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

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