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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vsnprintf(char *, int, char const *const,
                             int /*<<< orphan*/);
void vprint_error(const char *const format, va_list args) {
  char buffer[1024];
  vsnprintf(buffer, sizeof(buffer), format, args);
  fprintf(stderr, buffer);
}


x86 assembly (clang, -O0):
<vprint_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rsi
call   1040 <fprintf@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprint_error>:
push   %rbx
sub    $0x400,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <fprintf@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
define void @vprint_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @vsnprintf(i8* %6, i32 1024, i8* %7, i32 %8)
%10 = load i32, i32* @stderr
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%12 = call i32 @fprintf(i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @vprint_error(i8* nocapture %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @vsnprintf(i8* %4, i32 1024, i8* %0, i32 %1)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* %4)
ret void
}
void test1() { int z = 0; }


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

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

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

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void version(void) { fprintf(stderr, "version 0.01\n"); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"version 0.01\0A\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"version 0.01\0A\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
long dummy(char foo[42]) { return sizeof(foo); }


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

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

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

LLVM IR (-O2):
define i64 @dummy(i8* nocapture readnone %0) {
ret i64 8
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
char *strdup(char *);
char *query_attribute_statistics_get_temp_filename(char *attribute_name) {
  char temp_filename[1024];
  sprintf(temp_filename, "/tmp/query_attribute_statistics_%s_%d",
          attribute_name, getpid());
  return strdup(temp_filename);
}


x86 assembly (clang, -O0):
<query_attribute_statistics_get_temp_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x420(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x418(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x420(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    %eax,%ecx
lea    0xe8a(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1050 <strdup@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_attribute_statistics_get_temp_filename>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb5(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1050 <strdup@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [38 x i8] c"/tmp/query_attribute_statistics_%s_%d\00"
define i8* @query_attribute_statistics_get_temp_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 (...) @getpid()
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i8* @strdup(i8* %8)
ret i8* %9
}

LLVM IR (-O2):
@.str = [38 x i8] c"/tmp/query_attribute_statistics_%s_%d\00"
define noalias i8* @query_attribute_statistics_get_temp_filename(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (...) @getpid()
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
%6 = call i8* @strdup(i8* %3)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 100; i++) {
    if (i % 2 == 0) {
      printf("%d, ", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1166 <main+0x56>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1153 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    1128 <main+0x18>
nop
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1139 <main+0x29>
test   $0x1,%bl
jne    1120 <main+0x10>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 0, %0 ], [ %8, %7 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_CC_VREN_PIN() { set_io_bit(-4, 4); }


x86 assembly (clang, -O0):
<TOSH_SET_CC_VREN_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffc,%edi
mov    $0x4,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_CC_VREN_PIN>:
mov    $0xfffffffc,%edi
mov    $0x4,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_CC_VREN_PIN() {
%1 = call i32 @set_io_bit(i32 -4, i32 4)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_CC_VREN_PIN() {
%1 = tail call i32 @set_io_bit(i32 -4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void beep(void) { fputs("\007", stdout); }


x86 assembly (clang, -O0):
<beep>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<beep>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
@stdout = global i32 0
define void @beep() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\07\00"
@stdout = global i32 0
define void @beep() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_or_si64(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_or_si64(__m64 a, __m64 b) { return _mm_or_si64(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_or_si64>:
jmp    1030 <_mm_or_si64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_or_si64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_or_si64(i32 %0, i32 %1)
ret i32 %3
}
int rename(const char *old, const char *new) { return 0; }


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

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

LLVM IR (-O0):
define i32 @rename(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 @rename(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void irsnd_init(void) {}


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

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

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

LLVM IR (-O2):
define void @irsnd_init() {
ret void
}
unsigned long mfn_to_pfn(unsigned long mfn) { return mfn; }


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

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

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

LLVM IR (-O2):
define i64 @mfn_to_pfn(i64 returned %0) {
ret i64 %0
}
void hdlr(int sig) { (void)sig; }


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

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

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

LLVM IR (-O2):
define void @hdlr(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern char *shmem_version(void) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define i8* @shmem_version() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define noalias i8* @shmem_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
size_t strlen(char const *);
char *strpbrk(char const *, char const *);
size_t strcspn(const char *s1, const char *s2) {
  char *pbrk = strpbrk(s1, s2);
  return (pbrk == 0) ? strlen(s1) : (size_t)(pbrk - s1);
}


x86 assembly (clang, -O0):
<strcspn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strpbrk@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <strcspn+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
jmp    116d <strcspn+0x4d>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcspn>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strpbrk@plt>
test   %rax,%rax
je     1133 <strcspn+0x13>
sub    %rbx,%rax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @strcspn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @strpbrk(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i64 @strlen(i8* %12)
br label %20
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
br label %20
20: ; preds = %14, %11
%21 = phi i64 [ %13, %11 ], [ %19, %14 ]
ret i64 %21
}

LLVM IR (-O2):
define i64 @strcspn(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strpbrk(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %11
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
br label %11
11: ; preds = %7, %5
%12 = phi i64 [ %6, %5 ], [ %10, %7 ]
ret i64 %12
}
/* Variables and functions */
long lswap4(long);
int /*<<< orphan*/ memmove(unsigned char *, unsigned char *, int);
long read_blk2len(unsigned char *datablk) {
  long len;
  memmove((unsigned char *)&len, datablk + 7, sizeof(long));
  return lswap4(len);
}


x86 assembly (clang, -O0):
<read_blk2len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x7,%rsi
mov    $0x8,%edx
call   1040 <memmove@plt>
mov    -0x10(%rbp),%rdi
call   1030 <lswap4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_blk2len>:
push   %rax
lea    0x7(%rdi),%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1040 <memmove@plt>
mov    (%rsp),%rdi
call   1030 <lswap4@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @read_blk2len(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = bitcast i64* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 7
%7 = call i32 @memmove(i8* %4, i8* %6, i32 8)
%8 = load i64, i64* %3
%9 = call i64 @lswap4(i64 %8)
ret i64 %9
}

LLVM IR (-O2):
define i64 @read_blk2len(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 7
%5 = call i32 @memmove(i8* %3, i8* %4, i32 8)
%6 = load i64, i64* %2
%7 = call i64 @lswap4(i64 %6)
ret i64 %7
}
void f(void) {
#pragma hlt distribute
  while (1)
    ;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f+0x9>
jmp    1109 <f+0x9>

x86 assembly (clang, -O2):
<f>:
jmp    1100 <f>

LLVM IR (-O0):
define void @f() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @f() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ bgntmesh();
void bgntmesh_() { bgntmesh(); }


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

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

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

LLVM IR (-O2):
define void @bgntmesh_() {
%1 = tail call i32 (...) @bgntmesh()
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *src, int left, int right) {
  if (left < right) {
    int mid = partition(src, left, right);
    quick_sort(src, left, mid - 1);
    quick_sort(src, mid + 1, right);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int fun894() { return 894; }


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

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

LLVM IR (-O0):
define i32 @fun894() {
ret i32 894
}

LLVM IR (-O2):
define i32 @fun894() {
ret i32 894
}
/* Variables and functions */
int utf8stricmp(char const *, char const *);
int qsort_utf8stricmp_callback(const void *a, const void *b) {
  return utf8stricmp((const char *)*(char **)a, (const char *)*(char **)b);
}


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

x86 assembly (clang, -O2):
<qsort_utf8stricmp_callback>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <utf8stricmp@plt>

LLVM IR (-O0):
define i32 @qsort_utf8stricmp_callback(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @utf8stricmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @qsort_utf8stricmp_callback(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @utf8stricmp(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printer(void) { printf("printer(void): hello"); }


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"printer(void): hello\00"
define void @printer() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *addColor(char *, char *);
char *bgGreen(char *str) { return addColor("42", str); }


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

x86 assembly (clang, -O2):
<bgGreen>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <addColor@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"42\00"
define i8* @bgGreen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"42\00"
define i8* @bgGreen(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcmp(char *, char *);
int main(void) {
  char *p = 20;
  int c = strcmp(p, "foo");
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x14,%edi
call   1040 <strcmp@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @strcmp(i8* inttoptr (i64 20 to i8*), i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
double asin(double);
double __dasind(double x) { return (asin(x) * 57.29577951308232); }


x86 assembly (clang, -O0):
<__dasind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <asin@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dasind>:
push   %rax
call   1030 <asin@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @__dasind(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @asin(double %3)
%5 = fmul double %4, 0x404CA5DC1A63C1F8
ret double %5
}

LLVM IR (-O2):
define double @__dasind(double %0) {
%2 = tail call double @asin(double %0)
%3 = fmul double %2, 0x404CA5DC1A63C1F8
ret double %3
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_bus_message_get_creds(void *m) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_message_get_creds(i8* nocapture readnone %0) {
ret i8* null
}
void mailsem_internal_destroy(struct mailsem_internal *s) {}


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

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

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

LLVM IR (-O2):
%struct.mailsem_internal = type opaque
define void @mailsem_internal_destroy(%struct.mailsem_internal* nocapture %0) {
ret void
}
int SyncTelToLST(double newlst) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SyncTelToLST(double %0) {
ret i32 0
}
int seq_release(struct inode *a, struct file *b) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @seq_release(%struct.inode* %0, %struct.file* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.file*
store %struct.inode* %0, %struct.inode** %3
store %struct.file* %1, %struct.file** %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @seq_release(%struct.inode* nocapture readnone %0, %struct.file* nocapture readnone %1) {
ret i32 0
}
void testHeap() {}


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

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

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

LLVM IR (-O2):
define void @testHeap() {
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int read(int, void *, int);
void file_read(int file, void *pos, ssize_t size) {
  int bytes_read = read(file, pos, size);
  if (bytes_read < size) {
    printf("Did not read full file\n"
           "asked for: %ld\n"
           "received: %d\n",
           size, bytes_read);
  }
}


x86 assembly (clang, -O0):
<file_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1162 <file_read+0x42>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_read>:
push   %rbx
mov    %edx,%ebx
call   1040 <read@plt>
cmp    %ebx,%eax
jge    113d <file_read+0x1d>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Did not read full file\0Aasked for: %ld\0Areceived: %d\0A\00"
define void @file_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
br label %19
19: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Did not read full file\0Aasked for: %ld\0Areceived: %d\0A\00"
define void @file_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t read(int fd, void *buf, size_t count) {
  uint32_t ret;
  asm volatile("syscall"
               : "=a"(ret)
               : "0"(0), "D"(fd), "S"(buf), "d"(count)
               : "cc", "rcx", "r11", "memory");
  return ret;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
syscall
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{cc},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 0, i32 %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
ret i8* %12
}

LLVM IR (-O2):
define i8* @read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i8* asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{cc},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 0, i32 %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void sysfail(char *msg) {
  perror(msg);
  exit(1);
}


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

x86 assembly (clang, -O2):
<sysfail>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sysfail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sysfail(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((visibility("hidden"))) int cpi_comp_ptr(const void *ptr1,
                                                       const void *ptr2) {
  return !(ptr1 == ptr2);
}


x86 assembly (clang, -O0):
<cpi_comp_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpi_comp_ptr>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define hidden i32 @cpi_comp_ptr(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 = icmp eq i8* %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define hidden i32 @cpi_comp_ptr(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double __ieee754_sinh(double);
double sinh(double x) { return __ieee754_sinh(x); }


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

x86 assembly (clang, -O2):
<sinh>:
jmp    1030 <__ieee754_sinh@plt>

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__ieee754_sinh(double %3)
ret double %4
}

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call double @__ieee754_sinh(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ print_fini();
void ppp_fini(void) { print_fini(); }


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

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

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

LLVM IR (-O2):
define void @ppp_fini() {
%1 = tail call i32 (...) @print_fini()
ret void
}
/* Variables and functions */
int jsY_iswhite(int c) {
  return c == 0x9 || c == 0xB || c == 0xC || c == 0x20 || c == 0xA0 ||
         c == 0xFEFF;
}


x86 assembly (clang, -O0):
<jsY_iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1162 <jsY_iswhite+0x62>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1162 <jsY_iswhite+0x62>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1162 <jsY_iswhite+0x62>
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1162 <jsY_iswhite+0x62>
mov    $0x1,%al
cmpl   $0xa0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1162 <jsY_iswhite+0x62>
cmpl   $0xfeff,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsY_iswhite>:
mov    $0x1,%eax
cmp    $0x20,%edi
ja     111c <jsY_iswhite+0x1c>
mov    %edi,%ecx
movabs $0x100001a00,%rdx
bt     %rcx,%rdx
jb     1124 <jsY_iswhite+0x24>
cmp    $0xa0,%edi
jne    1125 <jsY_iswhite+0x25>
ret
xor    %eax,%eax
cmp    $0xfeff,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @jsY_iswhite(i32 %0) {
switch i32 %0, label %2 [
i32 160, label %5
i32 32, label %5
i32 12, label %5
i32 11, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 65279
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMREB_get(void) { return U_WMRCORENONE_get("U_WMREB"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMREB\00"
define i32 @U_WMREB_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMREB\00"
define i32 @U_WMREB_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ w5100_readGAR(int /*<<< orphan*/ *);
void w5100_getGatewayIp(uint8_t *addr) { w5100_readGAR(addr); }


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

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

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

LLVM IR (-O2):
define void @w5100_getGatewayIp(i32* %0) {
%2 = tail call i32 @w5100_readGAR(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void IOPinWritePort(int PortNo, uint32_t Data) {}


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

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

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

LLVM IR (-O2):
define void @IOPinWritePort(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *stderr;
int main(void) {
  fprintf(stderr, "hi\n");
  stderr = NULL;
  fprintf(stderr, "segfault!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%rdi
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
movq   $0x0,(%rax)
mov    0x2e96(%rip),%rax
mov    (%rax),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%rcx
lea    0xede(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
movq   $0x0,(%rbx)
lea    0xec5(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <fwrite@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32* null
@.str = [4 x i8] c"hi\0A\00"
@.str.1 = [11 x i8] c"segfault!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32*, i32** @stderr
%3 = call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32* null, i32** @stderr
%4 = load i32*, i32** @stderr
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [4 x i8] c"hi\0A\00"
@.str.1 = [11 x i8] c"segfault!\0A\00"
define i32 @main() {
%1 = load i32*, i32** @stderr
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %1)
store i32* null, i32** @stderr
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i64 10, i64 1, i32* null)
ret i32 0
}
int board_init(const char *mac) {
  ((void)mac);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @board_init(i8* nocapture readnone %0) {
ret i32 0
}
int hash_maker(int key) { return key % 7; }


x86 assembly (clang, -O0):
<hash_maker>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_maker>:
movslq %edi,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_maker(i32 %0) {
%2 = srem i32 %0, 7
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char *);
void key_4_handler(void) {
  uart_puts("\nkey_4_handler");
  return;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"\0Akey_4_handler\00"
define void @key_4_handler() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void printUsage(void) {
  fprintf(stdout,
          "Usage: seq -m <rows> -n <cols> -i <input-file> -o <output-file>\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [65 x i8] c"Usage: seq -m <rows> -n <cols> -i <input-file> -o <output-file>\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [65 x i8] c"Usage: seq -m <rows> -n <cols> -i <input-file> -o <output-file>\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct SimplexPipe {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ spipe_can_write(struct SimplexPipe *);
int /*<<< orphan*/ spipe_stop_read_impl(struct SimplexPipe *);
int /*<<< orphan*/ spipe_stop_read_write(struct SimplexPipe *);
void spipe_stop_read(struct SimplexPipe *spipe) {
  spipe_stop_read_impl(spipe);
  if (!spipe_can_write(spipe)) {
    spipe_stop_read_write(spipe);
  }
}


x86 assembly (clang, -O0):
<spipe_stop_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <spipe_stop_read_impl@plt>
mov    -0x8(%rbp),%rdi
call   1040 <spipe_can_write@plt>
cmp    $0x0,%eax
jne    1160 <spipe_stop_read+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <spipe_stop_read_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spipe_stop_read>:
push   %rbx
mov    %rdi,%rbx
call   1050 <spipe_stop_read_impl@plt>
mov    %rbx,%rdi
call   1040 <spipe_can_write@plt>
test   %eax,%eax
je     1147 <spipe_stop_read+0x17>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <spipe_stop_read_write@plt>

LLVM IR (-O0):
%struct.SimplexPipe = type { i32 }
define void @spipe_stop_read(%struct.SimplexPipe* %0) {
%2 = alloca %struct.SimplexPipe*
store %struct.SimplexPipe* %0, %struct.SimplexPipe** %2
%3 = load %struct.SimplexPipe*, %struct.SimplexPipe** %2
%4 = call i32 @spipe_stop_read_impl(%struct.SimplexPipe* %3)
%5 = load %struct.SimplexPipe*, %struct.SimplexPipe** %2
%6 = call i32 @spipe_can_write(%struct.SimplexPipe* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load %struct.SimplexPipe*, %struct.SimplexPipe** %2
%10 = call i32 @spipe_stop_read_write(%struct.SimplexPipe* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.SimplexPipe = type { i32 }
define void @spipe_stop_read(%struct.SimplexPipe* %0) {
%2 = tail call i32 @spipe_stop_read_impl(%struct.SimplexPipe* %0)
%3 = tail call i32 @spipe_can_write(%struct.SimplexPipe* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @spipe_stop_read_write(%struct.SimplexPipe* %0)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ workThread();
int main(int argc, const char *argv[]) {
  workThread();
  return 0;
}


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

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

LLVM IR (-O0):
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 = call i32 (...) @workThread()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @workThread()
ret i32 0
}
void mpu_init(void) {}


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

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

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

LLVM IR (-O2):
define void @mpu_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SII9234_HW_Off();
void MHD_HW_Off(void) { SII9234_HW_Off(); }


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

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

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

LLVM IR (-O2):
define void @MHD_HW_Off() {
%1 = tail call i32 (...) @SII9234_HW_Off()
ret void
}