xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int32_t limit(int32_t n, int32_t a, int32_t b) {
  assert(a <= b);
  if (n > b) {
    n = b;
  } else if (n < a) {
    n = a;
  }
  return n;
}


x86 assembly (clang, -O0):
<limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1154 <limit+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <limit+0x5f>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    116a <limit+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <limit+0x5f>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
cmp    %rdx,%rsi
setle  %dil
call   1030 <assert@plt>
cmp    %rbx,%r15
cmovge %r15,%rbx
cmp    %r14,%r15
cmovg  %r14,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @limit(i64 %0, i64 %1, i64 %2) {
%4 = icmp sle i64 %1, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp sgt i64 %0, %2
%8 = icmp slt i64 %0, %1
%9 = select i1 %8, i64 %1, i64 %0
%10 = select i1 %7, i64 %2, i64 %9
ret i64 %10
}
int msgu_vector_map_cmp(const void *a, const void *b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msgu_vector_map_cmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void av_crc_get_table() {}


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

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

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

LLVM IR (-O2):
define void @av_crc_get_table() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x7c() {
  Assert_real((isprint(124)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              625, ("isprint should be 1 for |"));
}


x86 assembly (clang, -O0):
<t_isprint_0x7c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7c,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x271,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x7c>:
push   %rax
mov    $0x7c,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x271,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for |\00"
define void @t_isprint_0x7c() {
%1 = call i32 @isprint(i32 124)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 625, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for |\00"
define void @t_isprint_0x7c() {
%1 = tail call i32 @isprint(i32 124)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 625, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bar(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bar() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ indirectx();
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc16(int /*<<< orphan*/);
void sbcIndirectx16(void) { sbc16(readmemw65816(indirectx())); }


x86 assembly (clang, -O0):
<sbcIndirectx16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectx@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <sbc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcIndirectx16>:
push   %rax
xor    %eax,%eax
call   1040 <indirectx@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sbc16@plt>

LLVM IR (-O0):
define void @sbcIndirectx16() {
%1 = call i32 (...) @indirectx()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @sbc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcIndirectx16() {
%1 = tail call i32 (...) @indirectx()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @sbc16(i32 %2)
ret void
}
int squashfs_1_0_supported(struct squashfs_sb_info *msblk) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.squashfs_sb_info = type opaque
define i32 @squashfs_1_0_supported(%struct.squashfs_sb_info* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_MUTEX_RECURSIVE;
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_settype(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/);
void mutex_init_reentrant(pthread_mutex_t *mutex) {
  pthread_mutexattr_t attr;
  pthread_mutexattr_init(&attr);
  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  pthread_mutex_init(mutex, &attr);
}


x86 assembly (clang, -O0):
<mutex_init_reentrant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <pthread_mutex_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_init_reentrant>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <pthread_mutex_init@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
define void @mutex_init_reentrant(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @pthread_mutexattr_init(i32* %3)
%5 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE
%6 = call i32 @pthread_mutexattr_settype(i32* %3, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @pthread_mutex_init(i32* %7, i32* %3)
ret void
}

LLVM IR (-O2):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
define void @mutex_init_reentrant(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @pthread_mutexattr_init(i32* %2)
%5 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE
%6 = call i32 @pthread_mutexattr_settype(i32* %2, i32 %5)
%7 = call i32 @pthread_mutex_init(i32* %0, i32* %2)
ret void
}
/* Variables and functions */
scalar_t__ xor128();
double random_next() { return (double)xor128() / (double)(4294967295); }


x86 assembly (clang, -O0):
<random_next>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <xor128@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_next>:
push   %rax
xor    %eax,%eax
call   1030 <xor128@plt>
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @random_next() {
%1 = call i64 (...) @xor128()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41EFFFFFFFE00000
ret double %3
}

LLVM IR (-O2):
define double @random_next() {
%1 = tail call i64 (...) @xor128()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41EFFFFFFFE00000
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ enginedb();
int sqlite3_exec(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
                 int /*<<< orphan*/, int /*<<< orphan*/);
int sql_exec(const char *buf) { return sqlite3_exec(enginedb(), buf, 0, 0, 0); }


x86 assembly (clang, -O0):
<sql_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <enginedb@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sqlite3_exec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sql_exec>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <enginedb@plt>
mov    %eax,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
pop    %rbx
jmp    1030 <sqlite3_exec@plt>

LLVM IR (-O0):
define i32 @sql_exec(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @enginedb()
%4 = load i8*, i8** %2
%5 = call i32 @sqlite3_exec(i32 %3, i8* %4, i32 0, i32 0, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @sql_exec(i8* %0) {
%2 = tail call i32 (...) @enginedb()
%3 = tail call i32 @sqlite3_exec(i32 %2, i8* %0, i32 0, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putcharerrno(char c) { write(2, &c, 1); }


x86 assembly (clang, -O0):
<ft_putcharerrno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putcharerrno>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ft_putcharerrno(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 2, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @ft_putcharerrno(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 2, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open_sysfs(char const *, char const *, int /*<<< orphan*/);
float read_sysfs_float_fd(int, char const *, char const *);
float read_sysfs_float(const char *sys_pfx, const char *node) {
  extern int errno;
  int fd;
  float val;
  fd = open_sysfs(sys_pfx, node, O_RDONLY);
  val = read_sysfs_float_fd(fd, sys_pfx, node);
  close(fd);
  return val;
}


x86 assembly (clang, -O0):
<read_sysfs_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1040 <open_sysfs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <read_sysfs_float_fd@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_sysfs_float>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
call   1040 <open_sysfs@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read_sysfs_float_fd@plt>
movss  %xmm0,0xc(%rsp)
mov    %ebp,%edi
call   1050 <close@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define float @read_sysfs_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = load i32, i32* @O_RDONLY
%10 = call i32 @open_sysfs(i8* %7, i8* %8, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call float @read_sysfs_float_fd(i32 %11, i8* %12, i8* %13)
store float %14, float* %6
%15 = load i32, i32* %5
%16 = call i32 @close(i32 %15)
%17 = load float, float* %6
ret float %17
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define float @read_sysfs_float(i8* %0, i8* %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open_sysfs(i8* %0, i8* %1, i32 %3)
%5 = tail call float @read_sysfs_float_fd(i32 %4, i8* %0, i8* %1)
%6 = tail call i32 @close(i32 %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ wordPerLine();
int main() {
  wordPerLine();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @wordPerLine()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xBuffer_free(void *pvMem) {
  ;
  free(pvMem);
  return;
}


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

x86 assembly (clang, -O2):
<xBuffer_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @xBuffer_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int xw_set_signals(void) {
  signal(SIGINT, SIG_DFL);
  signal(SIGTERM, SIG_DFL);
  signal(SIGFPE, SIG_DFL);
  return 0;
}


x86 assembly (clang, -O0):
<xw_set_signals>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xw_set_signals>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
@SIGTERM = global i32 0
@SIGFPE = global i32 0
define i32 @xw_set_signals() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGTERM
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGFPE
%8 = load i32, i32* @SIG_DFL
%9 = call i32 @signal(i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
@SIGTERM = global i32 0
@SIGFPE = global i32 0
define i32 @xw_set_signals() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGTERM
%5 = load i32, i32* @SIG_DFL
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGFPE
%8 = load i32, i32* @SIG_DFL
%9 = tail call i32 @signal(i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int bar();
int foo1(int x, int y) {
  if (y < 10)
    return bar();
  if (x > 9)
    return bar();
  return x < y ? x : y;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1137 <foo1+0x27>
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <foo1+0x63>
cmpl   $0x9,-0x8(%rbp)
jle    1150 <foo1+0x40>
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <foo1+0x63>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <foo1+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116d <foo1+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
cmp    $0xa,%esi
jl     111d <foo1+0xd>
cmp    $0xa,%edi
jge    111d <foo1+0xd>
mov    %edi,%eax
ret
xor    %eax,%eax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo1(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* %5
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @bar()
store i32 %9, i32* %3
br label %25
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 9
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @bar()
store i32 %14, i32* %3
br label %25
15: ; preds = %10
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i32, i32* %4
br label %23
21: ; preds = %15
%22 = load i32, i32* %5
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
store i32 %24, i32* %3
br label %25
25: ; preds = %23, %13, %8
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @foo1(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 10
%4 = icmp sgt i32 %0, 9
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @bar()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void show_usage(const char *progname) {
  fprintf(stderr, "USAGE: %s <abs path to nuttx.hex>\n", progname);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"USAGE: %s <abs path to nuttx.hex>\0A\00"
define void @show_usage(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 ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"USAGE: %s <abs path to nuttx.hex>\0A\00"
define void @show_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *realloc(void *, unsigned int);
void *fz_realloc_default(void *opaque, void *old, unsigned int size) {
  return realloc(old, size);
}


x86 assembly (clang, -O0):
<fz_realloc_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <realloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_realloc_default>:
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define i8* @fz_realloc_default(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i8* @realloc(i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *);
void usage(void) { eprintf("USAGE\n"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"USAGE\0A\00"
define void @usage() {
%1 = tail call i32 @eprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void abcde5fghijklmn9opqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcde5fghijklmn9opqrstuvwxzy() {
ret void
}
void test(int i) {
#pragma omp atomic
  ++i;
}


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

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

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

LLVM IR (-O2):
define void @test(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addCodeLine(char *, char ***, unsigned int *);
char *concatenateStrings(int, char *, char const *, char *);
int /*<<< orphan*/ free(char *);
void generateCodeForRelativeInclude(const char *header, char ***codeLines,
                                    unsigned *numLines) {
  char *relativeInclude = concatenateStrings(3, "#include \"", header, "\"");
  addCodeLine(relativeInclude, codeLines, numLines);
  free(relativeInclude);
}


x86 assembly (clang, -O0):
<generateCodeForRelativeInclude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x3,%edi
lea    0xeac(%rip),%rsi
lea    0xeae(%rip),%rcx
call   1050 <concatenateStrings@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <addCodeLine@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateCodeForRelativeInclude>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rdx
lea    0xebb(%rip),%rsi
lea    0xebd(%rip),%rcx
mov    $0x3,%edi
call   1050 <concatenateStrings@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <addCodeLine@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"#include \22\00"
@.str.1 = [2 x i8] c"\22\00"
define void @generateCodeForRelativeInclude(i8* %0, i8*** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8***
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i8*** %1, i8**** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = call i8* @concatenateStrings(i32 3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8***, i8**** %5
%12 = load i32*, i32** %6
%13 = call i32 @addCodeLine(i8* %10, i8*** %11, i32* %12)
%14 = load i8*, i8** %7
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"#include \22\00"
@.str.1 = [2 x i8] c"\22\00"
define void @generateCodeForRelativeInclude(i8* %0, i8*** %1, i32* %2) {
%4 = tail call i8* @concatenateStrings(i32 3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @addCodeLine(i8* %4, i8*** %1, i32* %2)
%6 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void strtoupper(char *s) {
  int n;
  for (n = 0; n < strlen(s); n++)
    s[n] = toupper(s[n]);
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <strtoupper+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <strtoupper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <strtoupper+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <strtoupper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @strtoupper(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %23
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call signext i8 @toupper(i8 signext %14)
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @strtoupper(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
void *tfun(void *arg) {
  printf("            Thread %ld starting\n", pthread_self());
  pause();
  printf("            Thread %ld exiting\n", pthread_self());
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<tfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pause@plt>
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfun>:
push   %rax
xor    %eax,%eax
call   1060 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <pause@plt>
xor    %eax,%eax
call   1060 <pthread_self@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c" Thread %ld starting\0A\00"
@.str.1 = [32 x i8] c" Thread %ld exiting\0A\00"
define i8* @tfun(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @pthread_self()
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @pause()
%7 = call i32 (...) @pthread_self()
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [33 x i8] c" Thread %ld starting\0A\00"
@.str.1 = [32 x i8] c" Thread %ld exiting\0A\00"
define noalias i8* @tfun(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @pause()
%5 = tail call i32 (...) @pthread_self()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ get_name(char *);
int /*<<< orphan*/ set_name(char const *);
int /*<<< orphan*/ u_assert_int_eq(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ u_assert_str_eq(char const *, char *);
void test_get_name(void) {
  const char name[] = "testname";
  u_assert_int_eq(set_name(name), 0);
  char name_out[9];
  u_assert_int_eq(get_name(name_out), 0);
  u_assert_str_eq(name, name_out);
}


x86 assembly (clang, -O0):
<test_get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rdi
call   1050 <set_name@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <u_assert_int_eq@plt>
lea    -0x12(%rbp),%rdi
call   1060 <get_name@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <u_assert_int_eq@plt>
lea    -0x9(%rbp),%rdi
lea    -0x12(%rbp),%rsi
call   1030 <u_assert_str_eq@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_get_name>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x656d616e74736574,%rax
61 6d 65
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <set_name@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <u_assert_int_eq@plt>
lea    0xf(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <get_name@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <u_assert_int_eq@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <u_assert_str_eq@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.test_get_name.name = [9 x i8] c"testname\00"
define void @test_get_name() {
%1 = alloca [9 x i8]
%2 = alloca [9 x i8]
%3 = bitcast [9 x i8]* %1 to i8*
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%5 = call i32 @set_name(i8* %4)
%6 = call i32 @u_assert_int_eq(i32 %5, i32 0)
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%8 = call i32 @get_name(i8* %7)
%9 = call i32 @u_assert_int_eq(i32 %8, i32 0)
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%12 = call i32 @u_assert_str_eq(i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@__const.test_get_name.name = [9 x i8] c"testname\00"
define void @test_get_name() {
%1 = alloca [9 x i8]
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = call i32 @set_name(i8* %3)
%5 = call i32 @u_assert_int_eq(i32 %4, i32 0)
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%7 = call i32 @get_name(i8* %6)
%8 = call i32 @u_assert_int_eq(i32 %7, i32 0)
%9 = call i32 @u_assert_str_eq(i8* %3, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "%s\n%s\n",
          "usage: lam [ -f min.max ] [ -s sepstring ] [ -t c ] file ...",
          "       lam [ -p min.max ] [ -s sepstring ] [ -t c ] file ...");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xecc(%rip),%rdx
lea    0xf02(%rip),%rcx
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
lea    0xecf(%rip),%rdx
lea    0xf05(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [61 x i8] c"usage: lam [ -f min.max ] [ -s sepstring ] [ -t c ] file ...\00"
@.str.2 = [61 x i8] c" lam [ -p min.max ] [ -s sepstring ] [ -t c ] file ...\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [61 x i8] c"usage: lam [ -f min.max ] [ -s sepstring ] [ -t c ] file ...\00"
@.str.2 = [61 x i8] c" lam [ -p min.max ] [ -s sepstring ] [ -t c ] file ...\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_faddd(int s1, int s2, int d) {
  assem_debug("faddd d%d,d%d,d%d\n", d, s1, s2);
  output_w32(0xee300b00 | ((d & 7) << 12) | ((s1 & 7) << 16) | (s2 & 7));
}


x86 assembly (clang, -O0):
<emit_faddd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebf(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0xc(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xee300b00,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
shl    $0x10,%eax
or     %eax,%edi
mov    -0x8(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_faddd>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xece(%rip),%rdi
mov    %edx,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <assem_debug@plt>
and    $0x7,%r14d
shl    $0xc,%r14d
and    $0x7,%ebp
shl    $0x10,%ebp
and    $0x7,%ebx
or     %ebp,%ebx
lea    (%r14,%rbx,1),%edi
add    $0xee300b00,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"faddd d%d,d%d,d%d\0A\00"
define void @emit_faddd(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @assem_debug(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = and i32 %11, 7
%13 = shl i32 %12, 12
%14 = or i32 -298841344, %13
%15 = load i32, i32* %4
%16 = and i32 %15, 7
%17 = shl i32 %16, 16
%18 = or i32 %14, %17
%19 = load i32, i32* %5
%20 = and i32 %19, 7
%21 = or i32 %18, %20
%22 = call i32 @output_w32(i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"faddd d%d,d%d,d%d\0A\00"
define void @emit_faddd(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @assem_debug(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0, i32 %1)
%5 = shl i32 %2, 12
%6 = and i32 %5, 28672
%7 = shl i32 %0, 16
%8 = and i32 %7, 458752
%9 = and i32 %1, 7
%10 = or i32 %8, %9
%11 = or i32 %10, %6
%12 = or i32 %11, -298841344
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
/* Variables and functions */
scalar_t__ gethostname(char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void SMB_Get_My_Name(char *name, int len) {
  if (gethostname(name, len) < 0) {
    strncpy(name, "unknown", len);
  }
}


x86 assembly (clang, -O0):
<SMB_Get_My_Name>:
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   1040 <gethostname@plt>
cmp    $0x0,%rax
jge    1158 <SMB_Get_My_Name+0x38>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xead(%rip),%rsi
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SMB_Get_My_Name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <gethostname@plt>
test   %rax,%rax
js     1139 <SMB_Get_My_Name+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define void @SMB_Get_My_Name(i8* %0, i32 %1) {
%3 = tail call i64 @gethostname(i8* %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
double atan2(double, double);
double atan2_wrapper(double *arg_list) {
  return (atan2(arg_list[0], arg_list[1]));
}


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

x86 assembly (clang, -O2):
<atan2_wrapper>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @atan2_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = call double @atan2(double %5, double %8)
ret double %9
}

LLVM IR (-O2):
define double @atan2_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = tail call double @atan2(double %2, double %4)
ret double %5
}
/* Variables and functions */
int length(char *sentence) {
  if (sentence == NULL)
    return 0;
  int count = 0;
  while (sentence[count++] != '\0')
    ;
  return (count > 0) ? count - 1 : count;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <length+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    116e <length+0x6e>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114a <length+0x4a>
jmp    1126 <length+0x26>
cmpl   $0x0,-0x14(%rbp)
jle    1162 <length+0x62>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1168 <length+0x68>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
test   %rdi,%rdi
je     111d <length+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ 0, %1 ]
%5 = add nuw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
double Modulus(double arg1, double arg2) {
  int i;
  double ret_val;
  ret_val = arg1;
  i = ret_val / arg2;
  ret_val -= i * arg2;
  if (ret_val < 0)
    ret_val += arg2;
  return (ret_val);
}


x86 assembly (clang, -O0):
<Modulus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1179 <Modulus+0x79>
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Modulus>:
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
movsd  0xecf(%rip),%xmm2
andnpd %xmm2,%xmm3
orpd   %xmm1,%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @Modulus(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
store double %7, double* %6
%8 = load double, double* %6
%9 = load double, double* %4
%10 = fdiv double %8, %9
%11 = fptosi double %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = load double, double* %4
%15 = load double, double* %6
%16 = fneg double %13
%17 = call double @llvm.fmuladd.f64(double %16, double %14, double %15)
store double %17, double* %6
%18 = load double, double* %6
%19 = fcmp olt double %18, 0.000000e+00
br i1 %19, label %20, label %24
20: ; preds = %2
%21 = load double, double* %4
%22 = load double, double* %6
%23 = fadd double %22, %21
store double %23, double* %6
br label %24
24: ; preds = %20, %2
%25 = load double, double* %6
ret double %25
}

LLVM IR (-O2):
define double @Modulus(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fneg double %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %0)
%8 = fcmp olt double %7, 0.000000e+00
%9 = select i1 %8, double %1, double -0.000000e+00
%10 = fadd double %7, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *usage_string) {
  printf("%s\n", usage_string);
  exit(0);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}