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

/* Variables and functions */
int /*<<< orphan*/ spatialdb_geopackage_schema();
int spatialdb_init(int /*<<< orphan*/ *, char const **,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/);
int sqlite3_gpkg_init(sqlite3 *db, const char **pzErrMsg,
                      const sqlite3_api_routines *pThunk) {
  return spatialdb_init(db, pzErrMsg, pThunk, spatialdb_geopackage_schema());
}


x86 assembly (clang, -O0):
<sqlite3_gpkg_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <spatialdb_geopackage_schema@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1030 <spatialdb_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3_gpkg_init>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <spatialdb_geopackage_schema@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <spatialdb_init@plt>

LLVM IR (-O0):
define i32 @sqlite3_gpkg_init(i32* %0, i8** %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32*
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i8**, i8*** %5
%9 = load i32*, i32** %6
%10 = call i32 (...) @spatialdb_geopackage_schema()
%11 = call i32 @spatialdb_init(i32* %7, i8** %8, i32* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @sqlite3_gpkg_init(i32* %0, i8** %1, i32* %2) {
%4 = tail call i32 (...) @spatialdb_geopackage_schema()
%5 = tail call i32 @spatialdb_init(i32* %0, i8** %1, i32* %2, i32 %4)
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int uint32_t;
struct TYPE_2__ {
  int s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
#define AF_INET 128
unsigned int addr_hash(const struct sockaddr *sa, int family, int hash_size) {
  uint32_t addr;
  switch (family) {
  case AF_INET:
    addr = ((struct sockaddr_in *)sa)->sin_addr.s_addr;
  }
  return addr % hash_size;
}


x86 assembly (clang, -O0):
<addr_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    112a <addr_hash+0x2a>
jmp    1121 <addr_hash+0x21>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_hash>:
mov    %edx,%ecx
cmp    $0x80,%esi
jne    110c <addr_hash+0xc>
mov    (%rdi),%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define i32 @addr_hash(%struct.sockaddr* %0, i32 %1, i32 %2) {
%4 = alloca %struct.sockaddr*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.sockaddr* %0, %struct.sockaddr** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
switch i32 %8, label %15 [
i32 128, label %9
]
9: ; preds = %3
%10 = load %struct.sockaddr*, %struct.sockaddr** %4
%11 = bitcast %struct.sockaddr* %10 to %struct.sockaddr_in*
%12 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%13 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %12, i32 0, i32 0
%14 = load i32, i32* %13
store i32 %14, i32* %7
br label %15
15: ; preds = %9, %3
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = srem i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @addr_hash(%struct.sockaddr* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 128
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = getelementptr %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%7 = load i32, i32* %6
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ undef, %3 ]
%10 = srem i32 %9, %2
ret i32 %10
}
char *strchr(const char *string, int c) {
  while (*string) {
    if (*string == c) {
      return (char *)string;
    }
    string++;
  }
  return (char *)0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <strchr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <strchr+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int sudp_init(u_char *data) {
  printf("- PLUGIN: Half-life decoder\n");
  if (data && !data[0]) {
    printf("- no plugin's options\n");
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<sudp_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1158 <sudp_init+0x48>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1158 <sudp_init+0x48>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    115f <sudp_init+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudp_init>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
test   %rbx,%rbx
je     112c <sudp_init+0x1c>
cmpl   $0x0,(%rbx)
je     112e <sudp_init+0x1e>
pop    %rbx
ret
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"- PLUGIN: Half-life decoder\0A\00"
@.str.1 = [23 x i8] c"- no plugin's options\0A\00"
define i32 @sudp_init(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %15
14: ; preds = %7, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@str = [28 x i8] c"- PLUGIN: Half-life decoder\00"
@str.2 = [22 x i8] c"- no plugin's options\00"
define i32 @sudp_init(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = icmp eq i32* %0, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
br label %9
9: ; preds = %1, %4, %7
%10 = phi i32 [ 1, %7 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %10
}
void print_ldArray(Array_p, size) long *Array_p, size;
{
  while (size--)
    printf("%ld\t", *Array_p++);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<print_ldArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     115e <print_ldArray+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1120 <print_ldArray+0x10>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ldArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <print_ldArray+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_ldArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\09\00"
define void @print_ldArray(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i64 %5, -1
%8 = getelementptr inbounds i64, i64* %6, i64 1
%9 = load i64, i64* %6
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = icmp eq i64 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = tail call i32 @putchar(i32 10)
ret void
}
__attribute__((no, noclone)) void bar(long i, unsigned long j) {
  if (i != 1 || j != 1)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x8(%rbp)
jne    1136 <bar+0x26>
cmpq   $0x1,-0x10(%rbp)
je     113b <bar+0x2b>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x1,%rdi
jne    111d <bar+0xd>
cmp    $0x1,%rsi
jne    111d <bar+0xd>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7, %2
unreachable
11: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @bar(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, 1
%4 = icmp ne i64 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
tail call void @abort()
unreachable
7: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ os_freakout();
int setjmp(jmp_buf env) {
  os_freakout();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @setjmp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @os_freakout()
ret i32 0
}

LLVM IR (-O2):
define i32 @setjmp(i32 %0) {
%2 = tail call i32 (...) @os_freakout()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void isOverTwentyAndODD(int num) {
  if ((num % 2) == 1 && num > 20) {
    printf("1");
  } else {
    printf("0");
  }
}


x86 assembly (clang, -O0):
<isOverTwentyAndODD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    114a <isOverTwentyAndODD+0x3a>
cmpl   $0x14,-0x4(%rbp)
jle    114a <isOverTwentyAndODD+0x3a>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    1156 <isOverTwentyAndODD+0x46>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOverTwentyAndODD>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
mov    %edi,%ecx
sub    %eax,%ecx
cmp    $0x1,%ecx
sete   %al
cmp    $0x15,%edi
setge  %cl
and    %al,%cl
movzbl %cl,%edi
or     $0x30,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @isOverTwentyAndODD(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
%4 = icmp sgt i32 %0, 20
%5 = and i1 %4, %3
%6 = select i1 %5, i32 49, i32 48
%7 = tail call i32 @putchar(i32 %6)
ret void
}
int cpumap(int id, int nprocs) { return id % nprocs; }


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

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

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

LLVM IR (-O2):
define i32 @cpumap(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
char to_upper(char);
char *strupr(char *str) {
  char *end;
  end = str;
  while ((*str++ = to_upper(*str)))
    ;
  return end;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <to_upper@plt>
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114e <strupr+0x3e>
jmp    1124 <strupr+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <to_upper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupr+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @to_upper(i8 signext %4)
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %3
%7 = icmp eq i8 %5, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ getppid();
int /*<<< orphan*/ kill(int, int);
int zkself() {
  exit(kill((int)getppid(), 1));
  return (0);
}


x86 assembly (clang, -O0):
<zkself>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getppid@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <kill@plt>
mov    %eax,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<zkself>:
push   %rax
xor    %eax,%eax
call   1040 <getppid@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <kill@plt>
mov    %eax,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @zkself() {
%1 = call i64 (...) @getppid()
%2 = trunc i64 %1 to i32
%3 = call i32 @kill(i32 %2, i32 1)
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define i32 @zkself() {
%1 = tail call i64 (...) @getppid()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @kill(i32 %2, i32 1)
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void CFilterDestroy(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @CFilterDestroy(i8* nocapture %0) {
ret void
}
int rkwifi_set_firmware(char *fw, char *nvram) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rkwifi_set_firmware(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int R(int /*<<< orphan*/);
int /*<<< orphan*/ cudaFreeHost(void *);
int FreeHost(void *hstPtr) { return R(cudaFreeHost(hstPtr)); }


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

x86 assembly (clang, -O2):
<FreeHost>:
push   %rax
call   1040 <cudaFreeHost@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <R@plt>

LLVM IR (-O0):
define i32 @FreeHost(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cudaFreeHost(i8* %3)
%5 = call i32 @R(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @FreeHost(i8* %0) {
%2 = tail call i32 @cudaFreeHost(i8* %0)
%3 = tail call i32 @R(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int _release_elm(void *_data) { printf("release elm %d\n", *(int *)_data); }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"release elm %d\0A\00"
define i32 @_release_elm(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int age;
  bool teenager;
  for (age = 1; age < 25; age++) {
    teenager = age >= 13 && age <= 19 ? true : false;
    printf("Teenager is %d for age %d\n", teenager, age);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x19,-0x8(%rbp)
jge    117c <main+0x6c>
xor    %eax,%eax
cmpl   $0xd,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jl     1149 <main+0x39>
cmpl   $0x13,-0x8(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
lea    -0xd(%rbx),%eax
xor    %esi,%esi
cmp    $0x7,%eax
setb   %sil
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x19,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Teenager is %d for age %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %4
4: ; preds = %20, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 25
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 13
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 19
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %4
23: ; preds = %4
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@.str = [27 x i8] c"Teenager is %d for age %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %7, %1 ]
%3 = add nsw i32 %2, -13
%4 = icmp ult i32 %3, 7
%5 = zext i1 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %2)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 25
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gc_addref(void *);
int /*<<< orphan*/ gc_delref(void *);
void gc_swapref(void **var, void *val) {
  void *oldref = *var;
  gc_addref(val);
  *var = val;
  gc_delref(oldref);
}


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

x86 assembly (clang, -O2):
<gc_swapref>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%r15
mov    %rsi,%rdi
call   1040 <gc_addref@plt>
mov    %r14,(%rbx)
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <gc_delref@plt>

LLVM IR (-O0):
define void @gc_swapref(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @gc_addref(i8* %8)
%10 = load i8*, i8** %4
%11 = load i8**, i8*** %3
store i8* %10, i8** %11
%12 = load i8*, i8** %5
%13 = call i32 @gc_delref(i8* %12)
ret void
}

LLVM IR (-O2):
define void @gc_swapref(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @gc_addref(i8* %1)
store i8* %1, i8** %0
%5 = tail call i32 @gc_delref(i8* %3)
ret void
}
void swapCase(char *c) { *c ^= 0x20; }


x86 assembly (clang, -O0):
<swapCase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    $0x20,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapCase>:
xorb   $0x20,(%rdi)
ret

LLVM IR (-O0):
define void @swapCase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = xor i32 %5, 32
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @swapCase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = xor i8 %2, 32
store i8 %3, i8* %0
ret void
}
void f133(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    a:
      ({ 0; });
      goto a;
      ({ 0; });
      0;
  });
  0;
}


x86 assembly (clang, -O0):
<f133>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    1119 <f133+0x19>

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

LLVM IR (-O0):
define void @f133() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* %1
store i32 0, i32* %2
%7 = load i32, i32* %2
store i32 0, i32* %3
%8 = load i32, i32* %3
br label %9
9: ; preds = %9, %0
store i32 0, i32* %4
%10 = load i32, i32* %4
br label %9
}

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


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

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

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

LLVM IR (-O2):
define void @nseel_asm_add_end() {
ret void
}
/* Variables and functions */
int abs(int);
int euclid_sub(int a, int b) {
  a = abs(a);
  b = abs(b);
  while (a != b) {
    if (a > b) {
      a -= b;
    } else {
      b -= a;
    }
  }
  return a;
}


x86 assembly (clang, -O0):
<euclid_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     116c <euclid_sub+0x5c>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    115c <euclid_sub+0x4c>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <euclid_sub+0x57>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <euclid_sub+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_sub>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
cmp    %ecx,%eax
je     1137 <euclid_sub+0x37>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %eax,%ecx
mov    $0x0,%esi
cmovl  %ecx,%esi
mov    %eax,%edi
cmovl  %edx,%edi
sub    %esi,%eax
sub    %edi,%ecx
cmp    %ecx,%eax
jne    1120 <euclid_sub+0x20>
ret

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

LLVM IR (-O2):
define i32 @euclid_sub(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%5 = icmp eq i32 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %13, %6 ], [ %4, %2 ]
%8 = phi i32 [ %11, %6 ], [ %3, %2 ]
%9 = icmp slt i32 %7, %8
%10 = select i1 %9, i32 %7, i32 0
%11 = sub nsw i32 %8, %10
%12 = select i1 %9, i32 0, i32 %8
%13 = sub nsw i32 %7, %12
%14 = icmp eq i32 %11, %13
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = phi i32 [ %3, %2 ], [ %11, %6 ]
ret i32 %16
}
int next(int a) {
  if (a + 1 == 4)
    return 0;
  return a + 1;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x4,%eax
jne    1122 <next+0x22>
movl   $0x0,-0x4(%rbp)
jmp    112b <next+0x2b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @next(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = icmp eq i32 %2, 4
%4 = select i1 %3, i32 0, i32 %2
ret i32 %4
}
void _data_copy(void) {}


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

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

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

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

/* Variables and functions */
void redLEDToggle(void) { (*((volatile uint32_t *)0x40025008)) ^= 0x02; }


x86 assembly (clang, -O0):
<redLEDToggle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40025008,%eax
mov    (%rax),%ecx
xor    $0x2,%ecx
mov    $0x40025008,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<redLEDToggle>:
xorl   $0x2,0x40025008
02
ret

LLVM IR (-O0):
define void @redLEDToggle() {
%1 = load volatile i32, i32* inttoptr (i64 1073893384 to i32*)
%2 = xor i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 1073893384 to i32*)
ret void
}

LLVM IR (-O2):
define void @redLEDToggle() {
%1 = load volatile i32, i32* inttoptr (i64 1073893384 to i32*)
%2 = xor i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 1073893384 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int smp_file_set_modify_time(char const *, int);
int smp_test_file_modify_time(const char *file) {
  if (smp_file_set_modify_time(file, 1233333) == (-1)) {
    printf("set modify err\n");
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<smp_test_file_modify_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x12d1b5,%esi
call   1040 <smp_file_set_modify_time@plt>
cmp    $0xffffffff,%eax
jne    115b <smp_test_file_modify_time+0x3b>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <smp_test_file_modify_time+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_test_file_modify_time>:
push   %rax
mov    $0x12d1b5,%esi
call   1040 <smp_file_set_modify_time@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1136 <smp_test_file_modify_time+0x16>
pop    %rcx
ret
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"set modify err\0A\00"
define i32 @smp_test_file_modify_time(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @smp_file_set_modify_time(i8* %4, i32 1233333)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@str = [15 x i8] c"set modify err\00"
define i32 @smp_test_file_modify_time(i8* %0) {
%2 = tail call i32 @smp_file_set_modify_time(i8* %0, i32 1233333)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _sl4_hash_key_free_int(void *key) { free(key); }


x86 assembly (clang, -O0):
<_sl4_hash_key_free_int>:
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):
<_sl4_hash_key_free_int>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @_sl4_hash_key_free_int(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 @_sl4_hash_key_free_int(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hw_console_output(char);
int strlen(char *);
void my_str_printf(char *p) {
  int i;
  for (i = 0; i < strlen(p); i++) {
    hw_console_output(p[i]);
  }
}


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

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

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

LLVM IR (-O2):
define void @my_str_printf(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @hw_console_output(i8 signext %7)
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage(void) {
  fprintf(stderr, "usage: stm32boot [ erase | flash <file> | exec <file> ]\n");
  return -1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"usage: stm32boot [ erase | flash <file> | exec <file> ]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"usage: stm32boot [ erase | flash <file> | exec <file> ]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int read(int, char *, int);
int readchar(int fd) {
  char c;
  int n = read(fd, &c, 1);
  if (n == 1)
    return c;
  return -1;
}


x86 assembly (clang, -O0):
<readchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1145 <readchar+0x35>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <readchar+0x3c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readchar>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movsbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @readchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @read(i32 %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @readchar(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ next;
};
typedef TYPE_1__ XExtData;

/* Variables and functions */
void *get_XExtData_next(void *_p) { return (void *)((XExtData *)_p)->next; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XExtData_next(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XExtData_next(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
scalar_t__ Key2PhoneInx(int, int, int, int);
int IsDefPhoEndKey(int key, int kbtype) {
  if (Key2PhoneInx(key, 3, kbtype, 1))
    return 1;
  else {
    if (key == ' ')
      return 1;
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<IsDefPhoEndKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x3,%esi
mov    $0x1,%ecx
call   1030 <Key2PhoneInx@plt>
cmp    $0x0,%rax
je     1149 <IsDefPhoEndKey+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1166 <IsDefPhoEndKey+0x56>
cmpl   $0x20,-0x8(%rbp)
jne    115f <IsDefPhoEndKey+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1166 <IsDefPhoEndKey+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDefPhoEndKey>:
push   %rbx
mov    %esi,%edx
mov    %edi,%ebx
mov    $0x3,%esi
mov    $0x1,%ecx
call   1030 <Key2PhoneInx@plt>
test   %rax,%rax
setne  %al
cmp    $0x20,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @IsDefPhoEndKey(i32 %0, i32 %1) {
%3 = tail call i64 @Key2PhoneInx(i32 %0, i32 3, i32 %1, i32 1)
%4 = icmp ne i64 %3, 0
%5 = icmp eq i32 %0, 32
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, size_t, char *, int /*<<< orphan*/);
char *unix_time_2_datetime(int32_t ts, char *date_str, size_t date_size) {
  time_t t = ts;
  strftime(date_str, date_size, "%Y-%m-%d %H:%M:%S", localtime(&t));
  return date_str;
}


x86 assembly (clang, -O0):
<unix_time_2_datetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%ecx
lea    0xe9d(%rip),%rdx
call   1040 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_time_2_datetime>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec1(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @unix_time_2_datetime(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @localtime(i32* %7)
%12 = call i32 @strftime(i8* %9, i64 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @unix_time_2_datetime(i32 %0, i8* returned %1, i64 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 %0, i32* %4
%6 = call i32 @localtime(i32* %4)
%7 = call i32 @strftime(i8* %1, i64 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i8* %1
}
main() {
  __atomic_thread_fence(0);
  __atomic_thread_fence(1);
  __atomic_thread_fence(2);
  __atomic_thread_fence(3);
  __atomic_thread_fence(4);
  __atomic_thread_fence(5);
  __atomic_signal_fence(0);
  __atomic_signal_fence(1);
  __atomic_signal_fence(2);
  __atomic_signal_fence(3);
  __atomic_signal_fence(4);
  __atomic_signal_fence(5);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
fence acquire
fence acquire
fence release
fence acq_rel
fence seq_cst
fence syncscope("singlethread") acquire
fence syncscope("singlethread") acquire
fence syncscope("singlethread") release
fence syncscope("singlethread") acq_rel
fence syncscope("singlethread") seq_cst
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
fence seq_cst
fence syncscope("singlethread") seq_cst
ret i32 0
}
/* Variables and functions */
int strcoll(char const *const, char const *const);
int compare(const void *p, const void *q) {
  ;
  ;
  return strcoll(*(const char *const *)p, *(const char *const *)q);
}


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

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcoll(i8* %4, i8* %6)
ret i32 %7
}
int compare(const void *num1, const void *num2) {
  return *((int *)num1) - *((int *)num2);
}


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

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}