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

/* Variables and functions */
int cache_invalidate_block_(char const *, int /*<<< orphan*/, int);
int cache_invalidate_block(const char *filename, uint32_t block) {
  return cache_invalidate_block_(filename, block, true);
}


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

x86 assembly (clang, -O2):
<cache_invalidate_block>:
mov    $0x1,%edx
jmp    1030 <cache_invalidate_block_@plt>

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

LLVM IR (-O2):
define i32 @cache_invalidate_block(i8* %0, i32 %1) {
%3 = tail call i32 @cache_invalidate_block_(i8* %0, i32 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(void *, int);
void *malloc(int);
void *ft_memalloc(int size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr)
    ft_bzero(ptr, size);
  return (ptr);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114e <ft_memalloc+0x2e>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <ft_bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113c <ft_memalloc+0x1c>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <ft_bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @ft_memalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @ft_bzero(i8* %2, i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int omap_mux_wakeup_event(char *muxname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_mux_wakeup_event(i8* nocapture readnone %0) {
ret i32 0
}
int getX86CpuIDAndInfoEx(unsigned value, unsigned subleaf, unsigned *rEAX,
                         unsigned *rEBX, unsigned *rECX, unsigned *rEDX) {
  __asm__("movq\t%%rbx, %%rsi\n\t"
          "cpuid\n\t"
          "xchgq\t%%rbx, %%rsi\n\t"
          : "=a"(*rEAX), "=S"(*rEBX), "=c"(*rECX), "=d"(*rEDX)
          : "a"(value), "c"(subleaf));
  return 0;
}


x86 assembly (clang, -O0):
<getX86CpuIDAndInfoEx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    %rbx,%rsi
cpuid
xchg   %rsi,%rbx
mov    %eax,%r10d
mov    -0x38(%rbp),%rax
mov    %esi,%r8d
mov    %ecx,%esi
mov    -0x30(%rbp),%rcx
mov    %r10d,(%r9)
mov    %r8d,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getX86CpuIDAndInfoEx>:
mov    %rcx,%r10
mov    %rdx,%r11
mov    %esi,%ecx
mov    %edi,%eax
mov    %rbx,%rsi
cpuid
xchg   %rsi,%rbx
mov    %eax,(%r11)
mov    %esi,(%r10)
mov    %ecx,(%r8)
mov    %edx,(%r9)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getX86CpuIDAndInfoEx(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32*, i32** %11
%16 = load i32*, i32** %12
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call { i32, i32, i32, i32 } asm "movq\09%rbx, %rsi\0A\09cpuid\0A\09xchgq\09%rbx, %rsi\0A\09", "={ax},={si},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %17, i32 %18)
%20 = extractvalue { i32, i32, i32, i32 } %19, 0
%21 = extractvalue { i32, i32, i32, i32 } %19, 1
%22 = extractvalue { i32, i32, i32, i32 } %19, 2
%23 = extractvalue { i32, i32, i32, i32 } %19, 3
store i32 %20, i32* %13
store i32 %21, i32* %14
store i32 %22, i32* %15
store i32 %23, i32* %16
ret i32 0
}

LLVM IR (-O2):
define i32 @getX86CpuIDAndInfoEx(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
%7 = tail call { i32, i32, i32, i32 } asm "movq\09%rbx, %rsi\0A\09cpuid\0A\09xchgq\09%rbx, %rsi\0A\09", "={ax},={si},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
%8 = extractvalue { i32, i32, i32, i32 } %7, 0
%9 = extractvalue { i32, i32, i32, i32 } %7, 1
%10 = extractvalue { i32, i32, i32, i32 } %7, 2
%11 = extractvalue { i32, i32, i32, i32 } %7, 3
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
store i32 %11, i32* %5
ret i32 0
}
/* Variables and functions */
scalar_t__ clock();
long long back_clock(void) { return (long long)clock(); }


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

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

LLVM IR (-O0):
define i64 @back_clock() {
%1 = call i64 (...) @clock()
ret i64 %1
}

LLVM IR (-O2):
define i64 @back_clock() {
%1 = tail call i64 (...) @clock()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void abertura(int m) { printf("Tabuada do %d\n", m); }


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

x86 assembly (clang, -O2):
<abertura>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Tabuada do %d\0A\00"
define void @abertura(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Tabuada do %d\0A\00"
define void @abertura(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memfree(void *);
void memory_free(void *ptr) { memfree(ptr); }


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

x86 assembly (clang, -O2):
<memory_free>:
jmp    1030 <memfree@plt>

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

LLVM IR (-O2):
define void @memory_free(i8* %0) {
%2 = tail call i32 @memfree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
unsigned foo(unsigned i) {
  if (i == 2) {
    i = i << 2;
    if (i != 8)
      link_error();
  }
  return i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1144 <foo+0x34>
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
je     113f <foo+0x2f>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    1144 <foo+0x34>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x2,%edi
mov    $0x8,%eax
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 8, i32 %0
ret i32 %3
}
void test_PTHREAD_MUTEX_ERRORCHECK(void) {
  int dummy = "PTHREAD_MUTEX_ERRORCHECK";
}


x86 assembly (clang, -O0):
<test_PTHREAD_MUTEX_ERRORCHECK>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"PTHREAD_MUTEX_ERRORCHECK\00"
define void @test_PTHREAD_MUTEX_ERRORCHECK() {
%1 = alloca i32
store i32 ptrtoint ([25 x i8]* @.str to i32), i32* %1
ret void
}

LLVM IR (-O2):
define void @test_PTHREAD_MUTEX_ERRORCHECK() {
ret void
}
/* Variables and functions */
int atoi(char *);
double julian_int(int, int, int);
double julian_char(char date[]) {
  int day, month, year;
  year = atoi(date);
  month = atoi(date + 5);
  day = atoi(date + 8);
  return julian_int(year, month, day);
}


x86 assembly (clang, -O0):
<julian_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x5,%rdi
call   1030 <atoi@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1030 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <julian_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_char>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <atoi@plt>
mov    %eax,%r14d
lea    0x5(%rbx),%rdi
call   1030 <atoi@plt>
mov    %eax,%ebp
add    $0x8,%rbx
mov    %rbx,%rdi
call   1030 <atoi@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <julian_int@plt>

LLVM IR (-O0):
define double @julian_char(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @atoi(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 5
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %4
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 8
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %3
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = call double @julian_int(i32 %14, i32 %15, i32 %16)
ret double %17
}

LLVM IR (-O2):
define double @julian_char(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 5
%4 = tail call i32 @atoi(i8* %3)
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = tail call i32 @atoi(i8* %5)
%7 = tail call double @julian_int(i32 %2, i32 %4, i32 %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
size_t strlen(char *);
size_t read(char *buffer) {
  scanf("%s", buffer);
  return strlen(buffer);
}


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

x86 assembly (clang, -O2):
<read>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i64 @read(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
ret i64 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i64 @read(i8* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %3
}
/* Variables and functions */
scalar_t__ NewPtr(int);
unsigned char *gNewPtr(int size) {
  unsigned char *p = (unsigned char *)NewPtr(size + 8);
  return p;
}


x86 assembly (clang, -O0):
<gNewPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x8,%edi
call   1030 <NewPtr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gNewPtr>:
add    $0x8,%edi
jmp    1030 <NewPtr@plt>

LLVM IR (-O0):
define i8* @gNewPtr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 8
%6 = call i64 @NewPtr(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @gNewPtr(i32 %0) {
%2 = add nsw i32 %0, 8
%3 = tail call i64 @NewPtr(i32 %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void oom() { die("Out of mana!"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Out of mana!\00"
define void @oom() {
%1 = call i32 @die(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Out of mana!\00"
define void @oom() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void internal6(void) {}


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

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

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

LLVM IR (-O2):
define void @internal6() {
ret void
}
int cycle_is_visible(unsigned int flags) {
  return (flags & 0x00400000) ? 1 : 0;
}


x86 assembly (clang, -O0):
<cycle_is_visible>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x400000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_visible>:
mov    %edi,%eax
shr    $0x16,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @cycle_is_visible(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4194304
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @cycle_is_visible(i32 %0) {
%2 = lshr i32 %0, 22
%3 = and i32 %2, 1
ret i32 %3
}
float rsqrt_f(float a) { return 1.0f / __builtin_sqrtf(a); }


x86 assembly (clang, -O0):
<rsqrt_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsqrt_f>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <rsqrt_f+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <rsqrt_f+0x14>
call   1030 <sqrtf@plt>
movss  0xed4(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rsqrt_f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
%5 = fdiv float 1.000000e+00, %4
ret float %5
}

LLVM IR (-O2):
define float @rsqrt_f(float %0) {
%2 = tail call float @sqrtf(float %0)
%3 = fdiv float 1.000000e+00, %2
ret float %3
}
/* Variables and functions */
int fun(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  char a[] = "this is a book";
  printf("\"%s\" have %d word", a, fun(a));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xeb2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeaa(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x13(%rbp),%rdi
call   1030 <fun@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6b6f6f62206120,%rax
mov    %rax,0x7(%rsp)
movabs $0x2073692073696874,%rax
69 73 20
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <fun@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [15 x i8] c"this is a book\00"
@.str = [18 x i8] c"\22%s\22 have %d word\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
store i32 0, i32* %1
%3 = bitcast [15 x i8]* %2 to i8*
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%6 = call i32 @fun(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [15 x i8] c"this is a book\00"
@.str = [18 x i8] c"\22%s\22 have %d word\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @fun(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
%5 = call i32 (...) @getchar()
ret i32 0
}
double n_over_k(const int n, const int k, const double *fac) {
  double result = 0.0;
  if (k >= 0 && k <= n) {
    result = fac[n] / (fac[n - k] * fac[k]);
  }
  return result;
}


x86 assembly (clang, -O0):
<n_over_k>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1161 <n_over_k+0x61>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1161 <n_over_k+0x61>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_over_k>:
xorpd  %xmm0,%xmm0
test   %esi,%esi
js     1128 <n_over_k+0x28>
mov    %edi,%eax
sub    %esi,%eax
jl     1128 <n_over_k+0x28>
movslq %edi,%rcx
movsd  (%rdx,%rcx,8),%xmm0
cltq
movsd  (%rdx,%rax,8),%xmm1
mov    %esi,%eax
mulsd  (%rdx,%rax,8),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @n_over_k(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
store double 0.000000e+00, double* %7
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %34
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %34
14: ; preds = %10
%15 = load double*, double** %6
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = load double*, double** %6
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = sub nsw i32 %21, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %20, i64 %24
%26 = load double, double* %25
%27 = load double*, double** %6
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = fmul double %26, %31
%33 = fdiv double %19, %32
store double %33, double* %7
br label %34
34: ; preds = %14, %10, %3
%35 = load double, double* %7
ret double %35
}

LLVM IR (-O2):
define double @n_over_k(i32 %0, i32 %1, double* nocapture %2) {
%4 = icmp slt i32 %1, 0
%5 = icmp slt i32 %0, %1
%6 = or i1 %4, %5
br i1 %6, label %20, label %7
7: ; preds = %3
%8 = sext i32 %0 to i64
%9 = getelementptr inbounds double, double* %2, i64 %8
%10 = load double, double* %9
%11 = sub nsw i32 %0, %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %2, i64 %12
%14 = load double, double* %13
%15 = zext i32 %1 to i64
%16 = getelementptr inbounds double, double* %2, i64 %15
%17 = load double, double* %16
%18 = fmul double %14, %17
%19 = fdiv double %10, %18
br label %20
20: ; preds = %7, %3
%21 = phi double [ %19, %7 ], [ 0.000000e+00, %3 ]
ret double %21
}
void avx512f_test(short *table) {
  int i;
  for (i = 0; i < 128; ++i)
    table[i] = -1;
}


x86 assembly (clang, -O0):
<avx512f_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1138 <avx512f_test+0x38>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movw   $0xffff,(%rax,%rcx,2)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <avx512f_test+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<avx512f_test>:
pcmpeqd %xmm0,%xmm0
movdqu %xmm0,0xf0(%rdi)
movdqu %xmm0,0xe0(%rdi)
movdqu %xmm0,0xd0(%rdi)
movdqu %xmm0,0xc0(%rdi)
movdqu %xmm0,0xb0(%rdi)
movdqu %xmm0,0xa0(%rdi)
movdqu %xmm0,0x90(%rdi)
movdqu %xmm0,0x80(%rdi)
movdqu %xmm0,0x70(%rdi)
movdqu %xmm0,0x60(%rdi)
movdqu %xmm0,0x50(%rdi)
movdqu %xmm0,0x40(%rdi)
movdqu %xmm0,0x30(%rdi)
movdqu %xmm0,0x20(%rdi)
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @avx512f_test(i16* nocapture writeonly %0) {
%2 = bitcast i16* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_fgets(char *);
int /*<<< orphan*/ my_fputs(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main(void) {
  my_fputs("03.txt");
  my_fgets("03.txt");
  printf("\n");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1060 <my_fputs@plt>
lea    0xe9e(%rip),%rdi
call   1050 <my_fgets@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1060 <my_fputs@plt>
mov    %rbx,%rdi
call   1050 <my_fgets@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9e(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"03.txt\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 @my_fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @my_fgets(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ change_state(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ force_exit();
void dead_state_handle_input(int input) {
  if (input == ('\n'))
    change_state((0), (1), (1));
  if (input == ('q'))
    force_exit();
}


x86 assembly (clang, -O0):
<dead_state_handle_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1143 <dead_state_handle_input+0x23>
xor    %edi,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <change_state@plt>
cmpl   $0x71,-0x4(%rbp)
jne    1154 <dead_state_handle_input+0x34>
mov    $0x0,%al
call   1040 <force_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dead_state_handle_input>:
cmp    $0x71,%edi
je     113b <dead_state_handle_input+0x1b>
cmp    $0xa,%edi
jne    1142 <dead_state_handle_input+0x22>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <change_state@plt>
xor    %eax,%eax
jmp    1040 <force_exit@plt>
ret

LLVM IR (-O0):
define void @dead_state_handle_input(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @change_state(i32 0, i32 1, i32 1)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 113
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @force_exit()
br label %12
12: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
define void @dead_state_handle_input(i32 %0) {
switch i32 %0, label %6 [
i32 10, label %2
i32 113, label %4
]
2: ; preds = %1
%3 = tail call i32 @change_state(i32 0, i32 1, i32 1)
br label %6
4: ; preds = %1
%5 = tail call i32 (...) @force_exit()
br label %6
6: ; preds = %2, %1, %4
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int str_same(const char *a, const char *b) { return strcmp(a, b) == 0; }


x86 assembly (clang, -O0):
<str_same>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_same>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @str_same(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @str_same(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
double doy2ts(year, doy)
int year;
double doy;
{
  double dj;
  dj = doy2jd(year, doy);
  return (jd2ts(dj));
}


x86 assembly (clang, -O0):
<doy2ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <doy2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2ts@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doy2ts>:
push   %rax
mov    $0x1,%al
call   1030 <doy2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1040 <jd2ts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @doy2ts(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%6 = load i32, i32* %3
%7 = load double, double* %4
%8 = call i32 (i32, double, ...) bitcast (i32 (...)* @doy2jd to i32 (i32, double, ...)*)(i32 %6, double %7)
%9 = sitofp i32 %8 to double
store double %9, double* %5
%10 = load double, double* %5
%11 = call i32 (double, ...) bitcast (i32 (...)* @jd2ts to i32 (double, ...)*)(double %10)
%12 = sitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @doy2ts(i32 %0, double %1) {
%3 = tail call i32 (i32, double, ...) bitcast (i32 (...)* @doy2jd to i32 (i32, double, ...)*)(i32 %0, double %1)
%4 = sitofp i32 %3 to double
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2ts to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
ret double %6
}
int whitespace(char c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\r';
}


x86 assembly (clang, -O0):
<whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <whitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<whitespace>:
cmp    $0x20,%dil
ja     1120 <whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <whitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void main() {
  int i;
  int y = 0;
  int x[10];
  for (i = 0; i < 10; i++) {
    x[i] = 1;
    y += i * 4;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1142 <main+0x42>
movslq -0x4(%rbp),%rax
movl   $0x1,-0x30(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <main+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
void RTStrmError(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrmError() {
ret void
}
/* Variables and functions */
int stbi_write_png(char const *, int, int, int, void const *, int);
int wrap_stbi_write_png(char const *filename, int w, int h, int comp,
                        const void *data, int stride_in_bytes) {
  return stbi_write_png(filename, w, h, comp, data, stride_in_bytes);
}


x86 assembly (clang, -O0):
<wrap_stbi_write_png>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <stbi_write_png@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_stbi_write_png>:
jmp    1030 <stbi_write_png@plt>

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

LLVM IR (-O2):
define i32 @wrap_stbi_write_png(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = tail call i32 @stbi_write_png(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
double mt_rand_int32();
double mt_rand_real2(void) { return mt_rand_int32() * (1.0 / 4294967296.0); }


x86 assembly (clang, -O0):
<mt_rand_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt_rand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_real2>:
push   %rax
xor    %eax,%eax
call   1030 <mt_rand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt_rand_real2() {
%1 = call double (...) @mt_rand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}

LLVM IR (-O2):
define double @mt_rand_real2() {
%1 = tail call double (...) @mt_rand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
void resetvdifmark6muxstatistics(struct vdif_mark6_mux_statistics *stats) {}


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

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

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

LLVM IR (-O2):
%struct.vdif_mark6_mux_statistics = type opaque
define void @resetvdifmark6muxstatistics(%struct.vdif_mark6_mux_statistics* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage(void) {
  fprintf(stderr, "Usage : jail_uml jail-directory user "
                  "uml-command-line ...\n");
  fprintf(stderr, "    or: jail_uml jail-directory uid "
                  "uml-command-line ...\n\n");
  fprintf(stderr, "If the user is not found, it's assumed to be a uid.\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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xef2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xf18(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf29(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"Usage : jail_uml jail-directory user uml-command-line ...\0A\00"
@.str.1 = [59 x i8] c" or: jail_uml jail-directory uid uml-command-line ...\0A\0A\00"
@.str.2 = [53 x i8] c"If the user is not found, it's assumed to be a uid.\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"Usage : jail_uml jail-directory user uml-command-line ...\0A\00"
@.str.1 = [59 x i8] c" or: jail_uml jail-directory uid uml-command-line ...\0A\0A\00"
@.str.2 = [53 x i8] c"If the user is not found, it's assumed to be a uid.\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
void gpio_init_mux(volatile uint32_t *regp) {
  uint32_t reg;
  reg = *regp;
  do {
    (reg) &= ~((~(~0u << (4 - 4 + 1))) << (4));
    (reg) |= (0 << 4);
  } while (0);
  do {
    (reg) &= ~((~(~0u << (2 - 0 + 1))) << (0));
    (reg) |= (5 << 0);
  } while (0);
  *regp = reg;
}


x86 assembly (clang, -O0):
<gpio_init_mux>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffffffef,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     $0x0,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <gpio_init_mux+0x28>
mov    -0xc(%rbp),%eax
and    $0xfffffff8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_init_mux>:
mov    (%rdi),%eax
and    $0xffffffe8,%eax
or     $0x5,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @gpio_init_mux(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load volatile i32, i32* %4
store i32 %5, i32* %3
br label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = and i32 %7, -17
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = or i32 %9, 0
store i32 %10, i32* %3
br label %11
11: ; preds = %6
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = and i32 %13, -8
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = or i32 %15, 5
store i32 %16, i32* %3
br label %17
17: ; preds = %12
%18 = load i32, i32* %3
%19 = load i32*, i32** %2
store volatile i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @gpio_init_mux(i32* %0) {
%2 = load volatile i32, i32* %0
%3 = and i32 %2, -24
%4 = or i32 %3, 5
store volatile i32 %4, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_md5;
int jksengine_digests_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int jksengine_md5_init(EVP_MD_CTX *ctx) {
  ;
  return (jksengine_digests_init(ctx, NID_md5));
}


x86 assembly (clang, -O0):
<jksengine_md5_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <jksengine_digests_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_md5_init>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <jksengine_digests_init@plt>

LLVM IR (-O0):
@NID_md5 = global i32 0
define i32 @jksengine_md5_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @NID_md5
%5 = call i32 @jksengine_digests_init(i32* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@NID_md5 = global i32 0
define i32 @jksengine_md5_init(i32* %0) {
%2 = load i32, i32* @NID_md5
%3 = tail call i32 @jksengine_digests_init(i32* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  fprintf(stderr, "EACCES: %s\n", strerror(EACCES));
  errno = ENOENT;
  perror(argv[0]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe83(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%ecx
mov    0x2e3e(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e8b(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9c(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%eax
mov    0x2e52(%rip),%rcx
mov    %eax,(%rcx)
mov    (%rbx),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"EACCES: %s\0A\00"
@EACCES = global i32 0
@ENOENT = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stderr
%7 = load i32, i32* @EACCES
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @ENOENT
store i32 %10, i32* @errno
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @perror(i8* %13)
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"EACCES: %s\0A\00"
@EACCES = global i32 0
@ENOENT = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i32, i32* @EACCES
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @ENOENT
store i32 %7, i32* @errno
%8 = load i8*, i8** %1
%9 = tail call i32 @perror(i8* %8)
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long long strtoll(char const *, char **, int);
long long atoll(const char *nptr) { return strtoll(nptr, (char **)NULL, 10); }


x86 assembly (clang, -O0):
<atoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtoll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoll>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
define i64 @atoll(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtoll(i8* %3, i8** null, i32 10)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atoll(i8* nocapture %0) {
%2 = tail call i64 @strtoll(i8* nocapture %0, i8** null, i32 10)
ret i64 %2
}
int get_sda_line(unsigned long pci_base) {
  int ret_val;
  if (((*(unsigned char *)(pci_base + 0x0e) & (1 << 3)) >> 3))
    ret_val = 1;
  else
    ret_val = 0;
  return (ret_val);
}


x86 assembly (clang, -O0):
<get_sda_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0xe(%rax),%eax
and    $0x8,%eax
sar    $0x3,%eax
cmp    $0x0,%eax
je     112b <get_sda_line+0x2b>
movl   $0x1,-0xc(%rbp)
jmp    1132 <get_sda_line+0x32>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sda_line>:
movzbl 0xe(%rdi),%eax
shr    $0x3,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_sda_line(i64 %0) {
%2 = add i64 %0, 14
%3 = inttoptr i64 %2 to i8*
%4 = load i8, i8* %3
%5 = lshr i8 %4, 3
%6 = and i8 %5, 1
%7 = zext i8 %6 to i32
ret i32 %7
}
void DIGI_Disable() { (*((volatile unsigned long *)0xFFFFF014)) = (1 << 5); }


x86 assembly (clang, -O0):
<DIGI_Disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff014,%eax
movq   $0x20,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DIGI_Disable>:
mov    $0xfffff014,%eax
movq   $0x20,(%rax)
ret

LLVM IR (-O0):
define void @DIGI_Disable() {
store volatile i64 32, i64* inttoptr (i64 4294963220 to i64*)
ret void
}

LLVM IR (-O2):
define void @DIGI_Disable() {
store volatile i64 32, i64* inttoptr (i64 4294963220 to i64*)
ret void
}