xunge/DecIR huggingface dataset:
/* Variables and functions */
char *convertToTitle(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *ptr;
  printf("%s\n", (ptr = convertToTitle(701)));
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2bd,%edi
call   1050 <convertToTitle@plt>
mov    %rax,%rsi
mov    %rsi,-0x10(%rbp)
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2bd,%edi
call   1050 <convertToTitle@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @convertToTitle(i32 701)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void __wleu32(uint8_t *buffer, uint32_t value) {
  buffer[3] = (uint8_t)(value >> 24) & 0xFF;
  buffer[2] = (uint8_t)(value >> 16) & 0xFF;
  buffer[1] = (uint8_t)(value >> 8) & 0xFF;
  buffer[0] = (uint8_t)(value >> 0) & 0xFF;
}


x86 assembly (clang, -O0):
<__wleu32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wleu32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x8(%rdi)
mov    %edx,0x4(%rdi)
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @__wleu32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 3
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 2
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = ashr i32 %20, 0
%22 = and i32 %21, 255
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 0
store i32 %22, i32* %24
ret void
}

LLVM IR (-O2):
define void @__wleu32(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %3, i32* %4
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = lshr i32 %1, 8
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %9, i32* %10
%11 = and i32 %1, 255
store i32 %11, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
void freelocale(locale_t locobj) { ; }


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

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

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

LLVM IR (-O2):
define void @freelocale(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char const *);
int check_dir(const char *name) {
  DIR *dirptr;
  dirptr = opendir(name);
  if (dirptr != NULL) {
    closedir(dirptr);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<check_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <check_dir+0x39>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
jmp    1160 <check_dir+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_dir>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     113a <check_dir+0x1a>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @check_dir(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void eprintf(const char *msg) { fprintf(stderr, "%s", msg); }


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

x86 assembly (clang, -O2):
<eprintf>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @eprintf(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int /*<<< orphan*/);
int is_digit(char *number) {
  while (*number)
    if (!isdigit(*number++))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <is_digit+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1155 <is_digit+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1161 <is_digit+0x51>
jmp    111c <is_digit+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1116 <is_digit+0x16>
add    $0x1,%rdi
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     1100 <is_digit>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_digit(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = add nsw i32 %8, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %2, label %11
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
int gca_cmp_long(const void *aa, const void *bb) {
  const long a = *(const long *)aa;
  const long b = *(const long *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
cmp    -0x18(%rbp),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp_long>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp_long(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
%16 = zext i1 %15 to i32
%17 = load i64, i64* %6
%18 = load i64, i64* %5
%19 = icmp sgt i64 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_cmp_long(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
main() {
  int i = (__typeof(i))3;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ Reverse(char *);
int /*<<< orphan*/ itos(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int n = -00;
  char s[128];
  itos(n, s);
  printf("%s\n", s);
  Reverse(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x90(%rbp),%rsi
call   1050 <itos@plt>
lea    -0x90(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <Reverse@plt>
lea    -0x90(%rbp),%rsi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <itos@plt>
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <Reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @itos(i32 0, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @Reverse(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int maxSubArray(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  int nums[2] = {-2, 1};
  int res = maxSubArray(nums, 2);
  printf("结果:%d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1040 <maxSubArray@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
movabs $0x1fffffffe,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1050 <maxSubArray@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@__const.main.nums = [2 x i32] [i32 -2, i32 1]
@.str.1 = [11 x i8] c"\E7\BB\93\E6\9E\9C:%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = bitcast [2 x i32]* %6 to i8*
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%11 = call i32 @maxSubArray(i32* %10, i32 2)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"\E7\BB\93\E6\9E\9C:%d\0A\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = bitcast i64* %3 to i8*
store i64 8589934590, i64* %3
%6 = bitcast i64* %3 to i32*
%7 = call i32 @maxSubArray(i32* %6, i32 2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_82(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_82() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ load_reallysetduty(int);
void load_turnoff(void) { load_reallysetduty(1024); }


x86 assembly (clang, -O0):
<load_turnoff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400,%edi
call   1030 <load_reallysetduty@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_turnoff>:
mov    $0x400,%edi
jmp    1030 <load_reallysetduty@plt>

LLVM IR (-O0):
define void @load_turnoff() {
%1 = call i32 @load_reallysetduty(i32 1024)
ret void
}

LLVM IR (-O2):
define void @load_turnoff() {
%1 = tail call i32 @load_reallysetduty(i32 1024)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xml_free(void *buf) { free(buf); }


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

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

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

LLVM IR (-O2):
define void @xml_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void lcd_brightness(int level) {}


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

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

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

LLVM IR (-O2):
define void @lcd_brightness(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void printd(double d) { printf("%g", d); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define void @printd(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ average(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ random();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  int z = __VERIFIER_nondet_int();
  average(random(), random());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <random@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <random@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <average@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1050 <random@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <random@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <average@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = call i32 (...) @random()
%8 = call i32 (...) @random()
%9 = call i32 @average(i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
%4 = tail call i32 (...) @random()
%5 = tail call i32 (...) @random()
%6 = tail call i32 @average(i32 %4, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void spiffy(void) { puts("\n\nThis function cleans up the keyword."); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"\0A\0AThis function cleans up the keyword.\00"
define void @spiffy() {
%1 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"\0A\0AThis function cleans up the keyword.\00"
define void @spiffy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
int benchmark_initrun() {
  ;
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @benchmark_initrun() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t cbor_peek_u8(uint8_t *data) { return (uint64_t)data[0]; }


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

x86 assembly (clang, -O2):
<cbor_peek_u8>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @cbor_peek_u8(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @cbor_peek_u8(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int int_div(int x, int y) { return x / y; }


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

x86 assembly (clang, -O2):
<int_div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @int_div(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @int_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int SKF_AD_MAX;
int bpf_tell_extensions(void) { return SKF_AD_MAX; }


x86 assembly (clang, -O0):
<bpf_tell_extensions>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_tell_extensions>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SKF_AD_MAX = global i32 0
define i32 @bpf_tell_extensions() {
%1 = load i32, i32* @SKF_AD_MAX
ret i32 %1
}

LLVM IR (-O2):
@SKF_AD_MAX = global i32 0
define i32 @bpf_tell_extensions() {
%1 = load i32, i32* @SKF_AD_MAX
ret i32 %1
}
void stdio_clear(void) {}


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

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

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

LLVM IR (-O2):
define void @stdio_clear() {
ret void
}
/* Variables and functions */
double floor(double);
double test2(double x) { return floor(x); }


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

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

LLVM IR (-O0):
define double @test2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @test2(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
void RTRandU32Ex(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandU32Ex() {
ret void
}
/* Variables and functions */
int nest1();
int nest() { return nest1(); }


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

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

LLVM IR (-O0):
define i32 @nest() {
%1 = call i32 (...) @nest1()
ret i32 %1
}

LLVM IR (-O2):
define i32 @nest() {
%1 = tail call i32 (...) @nest1()
ret i32 %1
}
const char *one_str(void) { return "one"; }


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

x86 assembly (clang, -O2):
<one_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"one\00"
define i8* @one_str() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"one\00"
define i8* @one_str() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef unsigned int u_int;

/* Variables and functions */
unsigned int hash_u_int(void *key) { return (u_int)key; }


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

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

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

LLVM IR (-O2):
define i32 @hash_u_int(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void buildVersionBumpMessage(char *into, const char *version) {
  sprintf(into, "version bump %s", version);
}


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

x86 assembly (clang, -O2):
<buildVersionBumpMessage>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"version bump %s\00"
define void @buildVersionBumpMessage(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 @sprintf(i8* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"version bump %s\00"
define void @buildVersionBumpMessage(i8* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
struct iphdr {
  scalar_t__ check;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
unsigned short in_cksum(unsigned short *, int);
int /*<<< orphan*/ memcpy(char *, unsigned char *, int);
unsigned short ip_checksum(unsigned char *iphdr) {
  char buf[20];
  struct iphdr *iph;
  memcpy(buf, iphdr, sizeof(buf));
  iph = (struct iphdr *)buf;
  iph->check = 0;
  return in_cksum((unsigned short *)buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<ip_checksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x14,%edx
call   1040 <memcpy@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
call   1030 <in_cksum@plt>
movzwl %ax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_checksum>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%edx
call   1040 <memcpy@plt>
movq   $0x0,(%rsp)
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <in_cksum@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.iphdr = type { i64 }
define zeroext i16 @ip_checksum(i8* %0) {
%2 = alloca i8*
%3 = alloca [20 x i8]
%4 = alloca %struct.iphdr*
store i8* %0, i8** %2
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 20)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%9 = bitcast i8* %8 to %struct.iphdr*
store %struct.iphdr* %9, %struct.iphdr** %4
%10 = load %struct.iphdr*, %struct.iphdr** %4
%11 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %10, i32 0, i32 0
store i64 0, i64* %11
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%13 = bitcast i8* %12 to i16*
%14 = call zeroext i16 @in_cksum(i16* %13, i32 20)
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @ip_checksum(i8* %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 20)
%5 = bitcast [20 x i8]* %2 to i64*
store i64 0, i64* %5
%6 = bitcast [20 x i8]* %2 to i16*
%7 = call zeroext i16 @in_cksum(i16* %6, i32 20)
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ GPIO1_INT5_DriverIRQHandler();
__attribute__((weak)) void GPIO1_INT5_IRQHandler(void) {
  GPIO1_INT5_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPIO1_INT5_IRQHandler() {
%1 = call i32 (...) @GPIO1_INT5_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPIO1_INT5_IRQHandler() {
%1 = tail call i32 (...) @GPIO1_INT5_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clog_flush(int *);
void CLOG_FLUSH(int *flag) { clog_flush(flag); }


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

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

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

LLVM IR (-O2):
define void @CLOG_FLUSH(i32* %0) {
%2 = tail call i32 @clog_flush(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage() {
  printf("spng2ppm png_file_name\n\n");
  printf("  reads simple-png input file and\n");
  printf("  writes ppm output to out.ppm file\n\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"spng2ppm png_file_name\0A\0A\00"
@.str.1 = [35 x i8] c" reads simple-png input file and\0A\00"
@.str.2 = [38 x i8] c" writes ppm output to out.ppm file\0A\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [24 x i8] c"spng2ppm png_file_name\0A\00"
@str.3 = [34 x i8] c" reads simple-png input file and\00"
@str.4 = [37 x i8] c" writes ppm output to out.ppm file\0A\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void free_array(int *array) { free(array); }


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

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

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

LLVM IR (-O2):
define void @free_array(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
void X509_VERIFY_PARAM_inherit(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_VERIFY_PARAM_inherit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void g0() { f(5); }


x86 assembly (clang, -O0):
<g0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g0>:
mov    $0x5,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g0() {
%1 = call i32 @f(i32 5)
ret void
}

LLVM IR (-O2):
define void @g0() {
%1 = tail call i32 @f(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ len(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
int errors(const char *errmsg, int exitval) {
  write(2, errmsg, len(errmsg));
  _exit(exitval);
}


x86 assembly (clang, -O0):
<errors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <len@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1050 <write@plt>
mov    -0xc(%rbp),%edi
call   1040 <_exit@plt>

x86 assembly (clang, -O2):
<errors>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <len@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    %ebp,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
define i32 @errors(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @len(i8* %6)
%8 = call i32 @write(i32 2, i8* %5, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @_exit(i32 %9)
unreachable
}

LLVM IR (-O2):
define i32 @errors(i8* %0, i32 %1) {
%3 = tail call i32 @len(i8* %0)
%4 = tail call i32 @write(i32 2, i8* %0, i32 %3)
%5 = tail call i32 @_exit(i32 %1)
unreachable
}
/* Variables and functions */
int const EAI_SYSTEM;
int /*<<< orphan*/ gai_strerror(int const);
int /*<<< orphan*/ warn(char *, char const *const);
int /*<<< orphan*/ warnx(char *, char const *const, int /*<<< orphan*/);
void ai_warn(const int errval, const char *const msg) {
  if (errval == EAI_SYSTEM)
    warn("%s", msg);
  else
    warnx("%s: %s", msg, gai_strerror(errval));
}


x86 assembly (clang, -O0):
<ai_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
jne    1166 <ai_warn+0x36>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <warn@plt>
jmp    1188 <ai_warn+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <gai_strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xe81(%rip),%rdi
call   1040 <warnx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_warn>:
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
je     114f <ai_warn+0x1f>
call   1050 <gai_strerror@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <warnx@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <warn@plt>

LLVM IR (-O0):
@EAI_SYSTEM = constant i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"%s: %s\00"
define void @ai_warn(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 i32, i32* @EAI_SYSTEM
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %16
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i32, i32* %3
%14 = call i32 @gai_strerror(i32 %13)
%15 = call i32 @warnx(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %12, i32 %14)
br label %16
16: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@EAI_SYSTEM = constant i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"%s: %s\00"
define void @ai_warn(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %9
6: ; preds = %2
%7 = tail call i32 @gai_strerror(i32 %0)
%8 = tail call i32 @warnx(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
void ff_hevc_put_hevc_uni_w_epel_v64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v64_8_sse4() {
ret void
}
long long bit26() { return 0x0000000004000000LL; }


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

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

LLVM IR (-O0):
define i64 @bit26() {
ret i64 67108864
}

LLVM IR (-O2):
define i64 @bit26() {
ret i64 67108864
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(int, int, int, int /*<<< orphan*/);
int main() { printf("%d\n", setbits(255, 1, 3, 0)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
mov    $0x1,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1040 <setbits@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xff,%edi
mov    $0x1,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1040 <setbits@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 255, i32 1, i32 3, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ insertionSort(int *, int);
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int array[] = {122, 17, 93, 3, 56};
  int n = sizeof(array) / sizeof(array[0]);
  insertionSort(array, n);
  printArray(array, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <insertionSort@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <insertionSort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [5 x i32] [i32 122, i32 17, i32 93, i32 3, i32 56]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @insertionSort(i32* %5, i32 %6)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @printArray(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [5 x i32] [i32 122, i32 17, i32 93, i32 3, i32 56]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @insertionSort(i32* %3, i32 5)
%5 = call i32 @printArray(i32* %3, i32 5)
ret i32 0
}
/* Variables and functions */
unsigned long __xtensa_copy_user(void *, void const *, unsigned long);
unsigned long __generic_copy_to_user_nocheck(void *to, const void *from,
                                             unsigned long n) {
  return __xtensa_copy_user(to, from, n);
}


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

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

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

LLVM IR (-O2):
define i64 @__generic_copy_to_user_nocheck(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @__xtensa_copy_user(i8* %0, i8* %1, i64 %2)
ret i64 %4
}
void rt_start_scanlinereceives(void *voidhandle) {}


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

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

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

LLVM IR (-O2):
define void @rt_start_scanlinereceives(i8* nocapture %0) {
ret void
}
/* Variables and functions */
size_t contains1(char *block, int res, char nullbyte) {
  while (res--) {
    if (block[res] != nullbyte)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<contains1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     114e <contains1+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
je     1149 <contains1+0x49>
movq   $0x1,-0x8(%rbp)
jmp    1156 <contains1+0x56>
jmp    1110 <contains1+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains1>:
movslq %esi,%rcx
xor    %eax,%eax
mov    %rcx,%rsi
nopl   0x0(%rax,%rax,1)
sub    $0x1,%rsi
jb     1124 <contains1+0x24>
cmp    %dl,-0x1(%rdi,%rcx,1)
mov    %rsi,%rcx
je     1110 <contains1+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @contains1(i8* nocapture %0, i32 %1, i8 signext %2) {
%4 = sext i32 %1 to i64
br label %5
5: ; preds = %9, %3
%6 = phi i64 [ %7, %9 ], [ %4, %3 ]
%7 = add nsw i64 %6, -1
%8 = icmp eq i64 %6, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 %7
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %2
br i1 %12, label %5, label %13
13: ; preds = %5, %9
%14 = phi i64 [ 1, %9 ], [ 0, %5 ]
ret i64 %14
}
void vexpress_spc_powerdown_enable(int cluster, int enable) {}


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

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

LLVM IR (-O0):
define void @vexpress_spc_powerdown_enable(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 @vexpress_spc_powerdown_enable(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc) {
  if (argc == 875)
    puts("aaaa");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
cmpl   $0x36b,-0x8(%rbp)
jne    113b <main+0x2b>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x36b,%edi
jne    1129 <main+0x19>
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"aaaa\00"
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 875
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"aaaa\00"
define i32 @main(i32 %0) {
%2 = icmp eq i32 %0, 875
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i32 0
}