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

/* Variables and functions */
int /*<<< orphan*/ mul2Matrices(int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ const *);
void mul3Matrices(const __m128 rowM1[4], const __m128 rowM2[4],
                  const __m128 rowM3[4], __m128 result[4]) {
  mul2Matrices(rowM1, rowM2, result);
  mul2Matrices(result, rowM3, result);
}


x86 assembly (clang, -O0):
<mul3Matrices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <mul2Matrices@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <mul2Matrices@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul3Matrices>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rcx,%rdx
call   1030 <mul2Matrices@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mul2Matrices@plt>

LLVM IR (-O0):
define void @mul3Matrices(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %8
%12 = call i32 @mul2Matrices(i32* %9, i32* %10, i32* %11)
%13 = load i32*, i32** %8
%14 = load i32*, i32** %7
%15 = load i32*, i32** %8
%16 = call i32 @mul2Matrices(i32* %13, i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @mul3Matrices(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @mul2Matrices(i32* %0, i32* %1, i32* %3)
%6 = tail call i32 @mul2Matrices(i32* %3, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_36(int /*<<< orphan*/);
int gen_36() { handle_36(0); }


x86 assembly (clang, -O0):
<gen_36>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <handle_36@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_36>:
xor    %edi,%edi
jmp    1030 <handle_36@plt>

LLVM IR (-O0):
define i32 @gen_36() {
%1 = alloca i32
%2 = call i32 @handle_36(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_36() {
%1 = tail call i32 @handle_36(i32 0)
ret i32 undef
}
/* Variables and functions */
scalar_t__ errno;
unsigned long strtoul(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int getaddr(const char *in, unsigned long *addrout) {
  unsigned long int res = 0;
  errno = 0;
  res = strtoul(in, 0, 0);
  if (errno) {
    return 1;
  }
  *addrout = res;
  return 0;
}


x86 assembly (clang, -O0):
<getaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2eb1(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <strtoul@plt>
mov    %rax,-0x20(%rbp)
mov    0x2e92(%rip),%rax
cmpq   $0x0,(%rax)
je     1164 <getaddr+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1176 <getaddr+0x66>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getaddr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    0x2ec2(%rip),%rbx
movq   $0x0,(%rbx)
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    $0x1,%ecx
cmpq   $0x0,(%rbx)
jne    113e <getaddr+0x2e>
mov    %rax,(%r14)
xor    %ecx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@errno = global i64 0
define i32 @getaddr(i8* %0, i64* nocapture writeonly %1) {
store i64 0, i64* @errno
%3 = tail call i64 @strtoul(i8* %0, i32 0, i32 0)
%4 = load i64, i64* @errno
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
store i64 %3, i64* %1
br label %7
7: ; preds = %2, %6
%8 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void quote(char *string) {
  char tmp[1024] = "\"";
  strncat(tmp, string, 1022);
  strcat(tmp, "\"");
  strncpy(string, tmp, 1024);
}


x86 assembly (clang, -O0):
<quote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movb   $0x22,-0x410(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3fe,%edx
call   1050 <strncat@plt>
lea    -0x410(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quote>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x400,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movb   $0x22,(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3fe,%edx
call   1050 <strncat@plt>
lea    0xe86(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\22\00"
define void @quote(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = bitcast [1024 x i8]* %3 to i8*
%5 = bitcast i8* %4 to [1024 x i8]*
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i32 0, i32 0
store i8 34, i8* %6
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = call i32 @strncat(i8* %7, i8* %8, i32 1022)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %2
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%14 = call i32 @strncpy(i8* %12, i8* %13, i32 1024)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\22\00"
define void @quote(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8 34, i8* %3
%4 = call i32 @strncat(i8* %3, i8* %0, i32 1022)
%5 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strncpy(i8* %0, i8* %3, i32 1024)
ret void
}
/* Variables and functions */
int strlen(char *s) {
  int n = 0;
  while (*s++) {
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ check_isort(int, char **);
int /*<<< orphan*/ check_string_scan(int, char **);
int main(int argc, char **argv) {
  check_isort(argc, argv);
  check_string_scan(argc, argv);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <check_isort@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <check_string_scan@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @check_isort(i32 %0, i8** %1)
%4 = tail call i32 @check_string_scan(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ad_unlink(char *, int /*<<< orphan*/ *);
char *run_cmd(char *, char *);
char *make_ad_fn_c_try_cpp(__attribute__((unused)) char const *nm,
                           __attribute__((unused)) unsigned int argc,
                           char **argv) {
  char *result;
  result = run_cmd("${CPP} ${CPPFLAGS} %s", argv[0]);
  ad_unlink(argv[0], NULL);
  return result;
}


x86 assembly (clang, -O0):
<make_ad_fn_c_try_cpp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xebf(%rip),%rdi
call   1040 <run_cmd@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <ad_unlink@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ad_fn_c_try_cpp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    (%rdx),%rsi
lea    0xecf(%rip),%rdi
call   1040 <run_cmd@plt>
mov    %rax,%r14
mov    (%rbx),%rdi
xor    %esi,%esi
call   1030 <ad_unlink@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"${CPP} ${CPPFLAGS} %s\00"
define i8* @make_ad_fn_c_try_cpp(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i8* @run_cmd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %10)
store i8* %11, i8** %7
%12 = load i8**, i8*** %6
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @ad_unlink(i8* %14, i32* null)
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
@.str = [22 x i8] c"${CPP} ${CPPFLAGS} %s\00"
define i8* @make_ad_fn_c_try_cpp(i8* nocapture readnone %0, i32 %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i8* @run_cmd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = tail call i32 @ad_unlink(i8* %6, i32* null)
ret i8* %5
}
int fun308() { return 308; }


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

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

LLVM IR (-O0):
define i32 @fun308() {
ret i32 308
}

LLVM IR (-O2):
define i32 @fun308() {
ret i32 308
}
/* Variables and functions */
int /*<<< orphan*/ console_close(int);
void command_bye(int id, char *input) {
  (void)input;
  console_close(id);
}


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

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

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

LLVM IR (-O2):
define void @command_bye(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @console_close(i32 %0)
ret void
}
void XkbInitCanonicalKeyTypes() {}


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

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

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

LLVM IR (-O2):
define void @XkbInitCanonicalKeyTypes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *app) {
  printf("usage: %s <-i image> "
         "[-d dump] [-c count] [-f format] "
         "[-t type] [-s sig <part>]\n",
         app);
}


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

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

LLVM IR (-O0):
@.str = [81 x i8] c"usage: %s <-i image> [-d dump] [-c count] [-f format] [-t type] [-s sig <part>]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [81 x i8] c"usage: %s <-i image> [-d dump] [-c count] [-f format] [-t type] [-s sig <part>]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ warning(char *);
void *ckfree(void *ptr) {
  if (ptr == NULL)
    warning("Bad call to ckfree\n");
  else {
    free(ptr);
    ptr = NULL;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<ckfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <ckfree+0x28>
lea    0xec2(%rip),%rdi
call   1040 <warning@plt>
jmp    1159 <ckfree+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckfree>:
push   %rax
test   %rdi,%rdi
je     112d <ckfree+0xd>
call   1030 <free@plt>
jmp    1139 <ckfree+0x19>
lea    0xecc(%rip),%rdi
call   1040 <warning@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Bad call to ckfree\0A\00"
define i8* @ckfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @warning(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
store i8* null, i8** %2
br label %10
10: ; preds = %7, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [20 x i8] c"Bad call to ckfree\0A\00"
define noalias i8* @ckfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @warning(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret i8* null
}
int main() {
  switch (1) {
  case 0:
    return 1;
  case 1:
  default:
    return 4;
  }
  return 5;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
void f(void) { static const int yo[] = {1, 2}; }


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

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

LLVM IR (-O0):
@f.yo = internal constant [2 x i32] [i32 1, i32 2]
define void @f() {
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(int j) {
  if (j >= 4)
    f(j - 1);
  else if (j == 0)
    return;
  printf("Hi");
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jl     1145 <f+0x25>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
jmp    1159 <f+0x39>
cmpl   $0x0,-0x4(%rbp)
jne    1154 <f+0x34>
jmp    1165 <f+0x45>
jmp    1159 <f+0x39>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x4,%edi
jl     1134 <f+0x14>
push   %rax
add    $0xffffffff,%edi
call   1030 <f@plt>
add    $0x8,%rsp
jmp    1138 <f+0x18>
test   %edi,%edi
je     1144 <f+0x24>
lea    0xec1(%rip),%rdi
jmp    1040 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"Hi\00"
define void @f(i32 %0) {
%2 = icmp sgt i32 %0, 3
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nsw i32 %0, -1
tail call void @f(i32 %4)
br label %7
5: ; preds = %1
%6 = icmp eq i32 %0, 0
br i1 %6, label %9, label %7
7: ; preds = %5, %3
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %7
ret void
}
/* Type definitions */
struct gate {
  int dummy;
};

/* Variables and functions */
int xor_op(struct gate const *);
int xnor_op(const struct gate *gate) {
  int truth = xor_op(gate);
  return truth == -1 ? truth : !truth;
}


x86 assembly (clang, -O0):
<xnor_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xor_op@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    113d <xnor_op+0x2d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114e <xnor_op+0x3e>
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xnor_op>:
push   %rax
call   1030 <xor_op@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
cmp    $0xffffffff,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.gate = type { i32 }
define i32 @xnor_op(%struct.gate* %0) {
%2 = alloca %struct.gate*
%3 = alloca i32
store %struct.gate* %0, %struct.gate** %2
%4 = load %struct.gate*, %struct.gate** %2
%5 = call i32 @xor_op(%struct.gate* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %10, %8
%16 = phi i32 [ %9, %8 ], [ %14, %10 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.gate = type { i32 }
define i32 @xnor_op(%struct.gate* %0) {
%2 = tail call i32 @xor_op(%struct.gate* %0)
%3 = icmp eq i32 %2, -1
%4 = icmp eq i32 %2, 0
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ native_irq_enable();
void raw_local_irq_enable(void) { native_irq_enable(); }


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

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

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

LLVM IR (-O2):
define void @raw_local_irq_enable() {
%1 = tail call i32 (...) @native_irq_enable()
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int pause(void) {
  printf("\n\nPress enter to return to the menu.");
  getchar();
  while ('\n' != getchar()) {
    ;
  }
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
je     1157 <pause+0x37>
jmp    113b <pause+0x1b>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1140 <pause+0x20>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0A\0APress enter to return to the menu.\00"
define i32 @pause() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call signext i8 (...) @getchar()
br label %4
4: ; preds = %8, %0
%5 = call signext i8 (...) @getchar()
%6 = sext i8 %5 to i32
%7 = icmp ne i32 10, %6
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0A\0APress enter to return to the menu.\00"
define i32 @pause() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
br label %3
3: ; preds = %3, %0
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3
ret i32 undef
}
int fn4(int x) { return (1 & x) + x; }


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

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

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

LLVM IR (-O2):
define i32 @fn4(i32 %0) {
%2 = and i32 %0, 1
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
int sys_wait_thread(pthread_t *id) { return pthread_join(*id, NULL); }


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

x86 assembly (clang, -O2):
<sys_wait_thread>:
mov    (%rdi),%edi
xor    %esi,%esi
jmp    1030 <pthread_join@plt>

LLVM IR (-O0):
define i32 @sys_wait_thread(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @pthread_join(i32 %4, i32* null)
ret i32 %5
}

LLVM IR (-O2):
define i32 @sys_wait_thread(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @pthread_join(i32 %2, i32* null)
ret i32 %3
}
int npCParseIsNumber(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<npCParseIsNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <npCParseIsNumber+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<npCParseIsNumber>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @npCParseIsNumber(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @npCParseIsNumber(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_print_version() { printf("1.0.1\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"1.0.1\00"
define void @help_print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int maxSubArray(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int nums[] = {-2, 1, -3, 4, -1, 2, 1, -5, 4};
  printf("%d\n", maxSubArray(nums, sizeof(nums) / sizeof(*nums)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
call   1050 <maxSubArray@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <maxSubArray@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i32]
%4 = bitcast [9 x i32]* %3 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%6 = call i32 @maxSubArray(i32* %5, i32 9)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ fail(char *);
void *allocvec(int columns, int size) {
  void *p;
  p = calloc(columns, size);
  if (p == NULL)
    fail("allocvec: calloc failed!");
  return p;
}


x86 assembly (clang, -O0):
<allocvec>:
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   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <allocvec+0x34>
lea    0xeb1(%rip),%rdi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocvec>:
push   %rbx
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <allocvec+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"allocvec: calloc failed!\00"
define i8* @allocvec(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8* @calloc(i32 %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @fail(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"allocvec: calloc failed!\00"
define noalias i8* @allocvec(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fail(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
void NPdset0(double *p, const size_t n) {
  size_t i;
  for (i = 0; i < n; i++) {
    p[i] = 0;
  }
}


x86 assembly (clang, -O0):
<NPdset0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1143 <NPdset0+0x43>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <NPdset0+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NPdset0>:
test   %rsi,%rsi
je     1128 <NPdset0+0x18>
push   %rax
mov    %rsi,%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @NPdset0(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %14, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds double, double* %11, i64 %12
store double 0.000000e+00, double* %13
br label %14
14: ; preds = %10
%15 = load i64, i64* %5
%16 = add i64 %15, 1
store i64 %16, i64* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @NPdset0(double* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = shl nuw i64 %1, 3
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void LZ4_copy8(void *dst, const void *src) { memcpy(dst, src, 8); }


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

x86 assembly (clang, -O2):
<LZ4_copy8>:
mov    $0x8,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @LZ4_copy8(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 i32 @memcpy(i8* %5, i8* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @LZ4_copy8(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 8)
ret void
}
unsigned short wimaxll_cpu_to_le16(unsigned short x) {
  unsigned short le16;
  le16 = x;
  return le16;
}


x86 assembly (clang, -O0):
<wimaxll_cpu_to_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @wimaxll_cpu_to_le16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
store i16 %4, i16* %3
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @wimaxll_cpu_to_le16(i16 returned zeroext %0) {
ret i16 %0
}
/* Type definitions */
struct si_sm_data {
  int dummy;
};

/* Variables and functions */
int read_smic_flags(struct si_sm_data *);
int smic_detect(struct si_sm_data *smic) {
  if (read_smic_flags(smic) == 0xff)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<smic_detect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <read_smic_flags@plt>
cmp    $0xff,%eax
jne    113c <smic_detect+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <smic_detect+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smic_detect>:
push   %rax
call   1030 <read_smic_flags@plt>
xor    %ecx,%ecx
cmp    $0xff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.si_sm_data = type { i32 }
define i32 @smic_detect(%struct.si_sm_data* %0) {
%2 = alloca i32
%3 = alloca %struct.si_sm_data*
store %struct.si_sm_data* %0, %struct.si_sm_data** %3
%4 = load %struct.si_sm_data*, %struct.si_sm_data** %3
%5 = call i32 @read_smic_flags(%struct.si_sm_data* %4)
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.si_sm_data = type { i32 }
define i32 @smic_detect(%struct.si_sm_data* %0) {
%2 = tail call i32 @read_smic_flags(%struct.si_sm_data* %0)
%3 = icmp eq i32 %2, 255
%4 = zext i1 %3 to i32
ret i32 %4
}
void startRepeating2LBRA() {}


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

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

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

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

/* Variables and functions */
uint32_t fmix32(uint32_t h) {
  h ^= h >> 16;
  h *= 0x85ebca6b;
  h ^= h >> 13;
  h *= 0xc2b2ae35;
  h ^= h >> 16;
  return h;
}


x86 assembly (clang, -O0):
<fmix32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0x85ebca6b,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xd,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0xc2b2ae35,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmix32>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
imul   $0x85ebca6b,%eax,%eax
mov    %eax,%ecx
sar    $0xd,%ecx
xor    %eax,%ecx
imul   $0xc2b2ae35,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fmix32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = mul i32 %7, -2048144789
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 13
%11 = load i32, i32* %2
%12 = xor i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = mul i32 %13, -1028477387
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 16
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @fmix32(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul i32 %3, -2048144789
%5 = ashr i32 %4, 13
%6 = xor i32 %5, %4
%7 = mul i32 %6, -1028477387
%8 = ashr i32 %7, 16
%9 = xor i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ checkStatus();
int /*<<< orphan*/ writePacket(int, int, int /*<<< orphan*/,
                               int /*<<< orphan*/ *);
void flex_clear_pu_status() {
  writePacket(0x00, 258, 0, NULL);
  checkStatus();
}


x86 assembly (clang, -O0):
<flex_clear_pu_status>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x102,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %edx,%edi
call   1030 <writePacket@plt>
mov    $0x0,%al
call   1040 <checkStatus@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flex_clear_pu_status>:
push   %rax
xor    %edi,%edi
mov    $0x102,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <writePacket@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <checkStatus@plt>

LLVM IR (-O0):
define void @flex_clear_pu_status() {
%1 = call i32 @writePacket(i32 0, i32 258, i32 0, i32* null)
%2 = call i32 (...) @checkStatus()
ret void
}

LLVM IR (-O2):
define void @flex_clear_pu_status() {
%1 = tail call i32 @writePacket(i32 0, i32 258, i32 0, i32* null)
%2 = tail call i32 (...) @checkStatus()
ret void
}
/* Variables and functions */
int actual_main(int, char **);
int main(int argc, char *argv[]) { return (actual_main(argc, argv)); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <actual_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @actual_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @actual_main(i32 %0, i8** %1)
ret i32 %3
}
void hge_not_alarm(const unsigned int value, const char *expr,
                   const char *format, ...) {}


x86 assembly (clang, -O0):
<hge_not_alarm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @hge_not_alarm(i32 %0, i8* %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @hge_not_alarm(i32 %0, i8* nocapture %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void wsys_sleep(int secs) { sleep(secs); }


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

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

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

LLVM IR (-O2):
define void @wsys_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mapit(int /*<<< orphan*/, unsigned int *, unsigned int *);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int main() {
  unsigned in = 2, out = 0;
  mapit(0, &out, &in);
  printf("%d %d\n", in, out);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
xor    %edi,%edi
call   1040 <mapit@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @mapit(i32 0, i32* %2, i32* %1)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ htable_release(void *);
void _htable_release(void *t) { htable_release(t); }


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

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

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

LLVM IR (-O2):
define void @_htable_release(i8* %0) {
%2 = tail call i32 @htable_release(i8* %0)
ret void
}
/* Variables and functions */
double __ieee754_atan2(double, double);
double jatan2(double y, double x) { return __ieee754_atan2(y, x); }


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

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

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

LLVM IR (-O2):
define double @jatan2(double %0, double %1) {
%3 = tail call double @__ieee754_atan2(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int volatile *);
int main(void) {
  volatile int x = 5;
  f(&x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 5, i32* %1
%3 = call i32 @f(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
  int tm_mon;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void UTC_Calendar_Now(struct tm *cdate) {
  time_t t;
  t = time(0);
  *cdate = *gmtime(&t);
  cdate->tm_year += 1900;
  cdate->tm_mon += 1;
}


x86 assembly (clang, -O0):
<UTC_Calendar_Now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rcx),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x76c,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTC_Calendar_Now>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <gmtime@plt>
mov    (%rax),%rax
lea    0x76c(%rax),%ecx
mov    %ecx,(%rbx)
shr    $0x20,%rax
add    $0x1,%eax
mov    %eax,0x4(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
define void @UTC_Calendar_Now(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca i32
store %struct.tm* %0, %struct.tm** %2
%4 = call i32 @time(i32 0)
store i32 %4, i32* %3
%5 = load %struct.tm*, %struct.tm** %2
%6 = call %struct.tm* @gmtime(i32* %3)
%7 = bitcast %struct.tm* %5 to i8*
%8 = bitcast %struct.tm* %6 to i8*
%9 = load %struct.tm*, %struct.tm** %2
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1900
store i32 %12, i32* %10
%13 = load %struct.tm*, %struct.tm** %2
%14 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
define void @UTC_Calendar_Now(%struct.tm* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32 0)
store i32 %4, i32* %2
%5 = call %struct.tm* @gmtime(i32* %2)
%6 = bitcast %struct.tm* %5 to i64*
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%9 = trunc i64 %7 to i32
%10 = add nsw i32 %9, 1900
store i32 %10, i32* %8
%11 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%12 = lshr i64 %7, 32
%13 = trunc i64 %12 to i32
%14 = add nsw i32 %13, 1
store i32 %14, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mcfioC_SetForSaveDecoding(int);
void mcfio_setforsavedecoding_(int *value) {
  mcfioC_SetForSaveDecoding(*value);
}


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

x86 assembly (clang, -O2):
<mcfio_setforsavedecoding_>:
mov    (%rdi),%edi
jmp    1030 <mcfioC_SetForSaveDecoding@plt>

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

LLVM IR (-O2):
define void @mcfio_setforsavedecoding_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @mcfioC_SetForSaveDecoding(i32 %2)
ret void
}