xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int vhangup() {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<vhangup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vhangup>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @vhangup() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @vhangup() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Variables and functions */
int number_occurrences_char(char, char *);
int timlib_count_delimiters(char delimiter, char *source) {
  return number_occurrences_char(delimiter, source);
}


x86 assembly (clang, -O0):
<timlib_count_delimiters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <number_occurrences_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @timlib_count_delimiters(i8 signext %0, i8* %1) {
%3 = tail call i32 @number_occurrences_char(i8 signext %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ e_izpx();
int /*<<< orphan*/ e_sta();
int /*<<< orphan*/ e_writeback();
void e_sta_izpx() {
  e_izpx();
  e_sta();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_sta_izpx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <e_izpx@plt>
mov    $0x0,%al
call   1050 <e_sta@plt>
mov    $0x0,%al
call   1040 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_sta_izpx>:
push   %rax
xor    %eax,%eax
call   1030 <e_izpx@plt>
xor    %eax,%eax
call   1050 <e_sta@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_writeback@plt>

LLVM IR (-O0):
define void @e_sta_izpx() {
%1 = call i32 (...) @e_izpx()
%2 = call i32 (...) @e_sta()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_sta_izpx() {
%1 = tail call i32 (...) @e_izpx()
%2 = tail call i32 (...) @e_sta()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ctest_test_assert_add(int, char *);
int ctest_assert_fail(char *message) {
  ctest_test_assert_add(1, message);
  return -1;
}


x86 assembly (clang, -O0):
<ctest_assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <ctest_test_assert_add@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctest_assert_fail>:
push   %rax
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <ctest_test_assert_add@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ctest_assert_fail(i8* %0) {
%2 = tail call i32 @ctest_test_assert_add(i32 1, i8* %0)
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void I2CSlaveIntDisableEx(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000080C))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<I2CSlaveIntDisableEx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x80c(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x80c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntDisableEx>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x80c(%rcx)
ret

LLVM IR (-O0):
define void @I2CSlaveIntDisableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 2060
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntDisableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 2060
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *, char const *);
char *getenv(char const *);
const char *get_pathlike_from_env(const char *env_var_name) {
  const char *env_value = getenv(env_var_name);
  if (NULL == env_value) {
    errx(EXIT_FAILURE, "%s environment variable not found", env_var_name);
  }
  return env_value;
}


x86 assembly (clang, -O0):
<get_pathlike_from_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    115e <get_pathlike_from_env+0x3e>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea7(%rip),%rsi
call   1040 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pathlike_from_env>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <get_pathlike_from_env+0x2c>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %r14,%rdx
call   1040 <errx@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [34 x i8] c"%s environment variable not found\00"
define i8* @get_pathlike_from_env(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = load i8*, i8** %2
%11 = call i32 @errx(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [34 x i8] c"%s environment variable not found\00"
define i8* @get_pathlike_from_env(i8* %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @errx(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ system_display_update();
int /*<<< orphan*/ system_keyboard_update();
void system_update(void) {
  system_display_update();
  system_keyboard_update();
}


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

x86 assembly (clang, -O2):
<system_update>:
push   %rax
xor    %eax,%eax
call   1030 <system_display_update@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <system_keyboard_update@plt>

LLVM IR (-O0):
define void @system_update() {
%1 = call i32 (...) @system_display_update()
%2 = call i32 (...) @system_keyboard_update()
ret void
}

LLVM IR (-O2):
define void @system_update() {
%1 = tail call i32 (...) @system_display_update()
%2 = tail call i32 (...) @system_keyboard_update()
ret void
}
void strength_test4(int *data) {
  int i;
  if (data[1]) {
    i = 2;
    goto here;
  }
  i = 0;
  do {
    i = i + 1;
  here:
    data[data[2]] = 2;
  } while (21 * i < data[3]);
}


x86 assembly (clang, -O0):
<strength_test4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     1122 <strength_test4+0x22>
movl   $0x2,-0xc(%rbp)
jmp    1132 <strength_test4+0x32>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
imul   $0x15,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     1129 <strength_test4+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test4>:
mov    $0x2,%eax
xor    %ecx,%ecx
cmpl   $0x0,0x4(%rdi)
jne    1112 <strength_test4+0x12>
add    $0x1,%ecx
mov    %ecx,%eax
movslq 0x8(%rdi),%rcx
movl   $0x2,(%rdi,%rcx,4)
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%edx
mov    %eax,%ecx
cmp    0xc(%rdi),%edx
jl     110d <strength_test4+0xd>
ret

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

LLVM IR (-O2):
define void @strength_test4(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1, %8
%6 = phi i32 [ %9, %8 ], [ 0, %1 ]
%7 = add nsw i32 %6, 1
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ 2, %1 ]
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 2, i32* %13
%14 = mul nsw i32 %9, 21
%15 = getelementptr inbounds i32, i32* %0, i64 3
%16 = load i32, i32* %15
%17 = icmp slt i32 %14, %16
br i1 %17, label %5, label %18
18: ; preds = %8
ret void
}
void a() {
  extern int ab;
  ab = 1;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ee5(%rip),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mov    0x2ee9(%rip),%rax
movl   $0x1,(%rax)
ret

LLVM IR (-O0):
@ab = external global i32
define void @a() {
store i32 1, i32* @ab
ret void
}

LLVM IR (-O2):
@ab = external global i32
define void @a() {
store i32 1, i32* @ab
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int semget(int /*<<< orphan*/, int, int);
int semaphore_allocation(key_t key) {
  int rc;
  if ((rc = semget(key, 2, IPC_CREAT | 0700)) == -1) {
    perror("error in the function semaphore_allocation()");
    exit(1);
  };
  return rc;
}


x86 assembly (clang, -O0):
<semaphore_allocation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
or     $0x1c0,%edx
mov    $0x2,%esi
call   1030 <semget@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1179 <semaphore_allocation+0x49>
lea    0xe96(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semaphore_allocation>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    $0x1c0,%edx
or     (%rax),%edx
mov    $0x2,%esi
call   1030 <semget@plt>
cmp    $0xffffffff,%eax
je     1150 <semaphore_allocation+0x20>
pop    %rcx
ret
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [45 x i8] c"error in the function semaphore_allocation()\00"
define i32 @semaphore_allocation(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @IPC_CREAT
%6 = or i32 %5, 448
%7 = call i32 @semget(i32 %4, i32 2, i32 %6)
store i32 %7, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@.str = [45 x i8] c"error in the function semaphore_allocation()\00"
define i32 @semaphore_allocation(i32 %0) {
%2 = load i32, i32* @IPC_CREAT
%3 = or i32 %2, 448
%4 = tail call i32 @semget(i32 %0, i32 2, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  signed x = -1;
  printf("signed x = [%d]\n", x);
  printf("unsigned x = [%u]\n", (unsigned)x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"signed x = [%d]\0A\00"
@.str.1 = [19 x i8] c"unsigned x = [%u]\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 -1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 -1)
ret i32 0
}
char is_primitive_type(unsigned int tag) {
  return (tag & 0xc0) == 0 && (tag & 0x1f) != ((0x00 | 0x20 | 0x10) & 0x1f) &&
         (tag & 0x1f) != ((0x00 | 0x20 | 0x11) & 0x1f);
}


x86 assembly (clang, -O0):
<is_primitive_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xc0,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1141 <is_primitive_type+0x41>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
xor    %eax,%eax
cmp    $0x10,%ecx
mov    %al,-0x5(%rbp)
je     1141 <is_primitive_type+0x41>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
cmp    $0x11,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_primitive_type>:
test   $0xc0,%dil
jne    110e <is_primitive_type+0xe>
and    $0x1f,%edi
cmp    $0x10,%edi
jne    1111 <is_primitive_type+0x11>
xor    %eax,%eax
ret
cmp    $0x11,%edi
setne  %al
ret

LLVM IR (-O0):
define signext i8 @is_primitive_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 31
%9 = icmp ne i32 %8, 16
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = and i32 %11, 31
%13 = icmp ne i32 %12, 17
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ false, %6 ], [ false, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @is_primitive_type(i32 %0) {
%2 = and i32 %0, 192
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = and i32 %0, 31
%6 = icmp eq i32 %5, 16
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = icmp ne i32 %5, 17
%9 = zext i1 %8 to i8
br label %10
10: ; preds = %7, %4, %1
%11 = phi i8 [ 0, %4 ], [ 0, %1 ], [ %9, %7 ]
ret i8 %11
}
int sys_exit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sys_exit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error2(char *message) {
  printf("\nError: %s.\n", message);
  exit(-1);
}


x86 assembly (clang, -O0):
<error2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error2>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\0AError: %s.\0A\00"
define void @error2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"\0AError: %s.\0A\00"
define void @error2(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int g(int a, int b, int (*gi)(int, int)) {
  if ((*gi)(a, b))
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   *%rax
cmp    $0x0,%eax
je     1132 <g+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <g+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   *%rdx
test   %eax,%eax
cmove  %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 %1, i32 %0
ret i32 %6
}
/* Type definitions */
struct aatree_node {
  int dummy;
};

/* Variables and functions */
struct aatree_node *__aatree_iterate(struct aatree_node const *,
                                     int /*<<< orphan*/);
struct aatree_node *aatree_prev(const struct aatree_node *node) {
  return __aatree_iterate(node, 0);
}


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

x86 assembly (clang, -O2):
<aatree_prev>:
xor    %esi,%esi
jmp    1030 <__aatree_iterate@plt>

LLVM IR (-O0):
%struct.aatree_node = type { i32 }
define %struct.aatree_node* @aatree_prev(%struct.aatree_node* %0) {
%2 = alloca %struct.aatree_node*
store %struct.aatree_node* %0, %struct.aatree_node** %2
%3 = load %struct.aatree_node*, %struct.aatree_node** %2
%4 = call %struct.aatree_node* @__aatree_iterate(%struct.aatree_node* %3, i32 0)
ret %struct.aatree_node* %4
}

LLVM IR (-O2):
%struct.aatree_node = type { i32 }
define %struct.aatree_node* @aatree_prev(%struct.aatree_node* %0) {
%2 = tail call %struct.aatree_node* @__aatree_iterate(%struct.aatree_node* %0, i32 0)
ret %struct.aatree_node* %2
}
/* Variables and functions */
int /*<<< orphan*/ move_cursor_left();
void cmd_left(const char *pf, char **args) { move_cursor_left(); }


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

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

LLVM IR (-O0):
define void @cmd_left(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 (...) @move_cursor_left()
ret void
}

LLVM IR (-O2):
define void @cmd_left(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @move_cursor_left()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t CondSwapFromBus16(uint16_t d) { return d; }


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

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

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

LLVM IR (-O2):
define i32 @CondSwapFromBus16(i32 returned %0) {
ret i32 %0
}
void dummy(void) { ; }


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

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

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

LLVM IR (-O2):
define void @dummy() {
ret void
}
int f(char *x) {
  asm(".global f_end_lbl\nf_end_lbl:");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @f(i8* nocapture readnone %0) {
tail call void asm sideeffect ".global f_end_lbl\0Af_end_lbl:", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int stringmatchlen(char const *, int /*<<< orphan*/, char const *,
                   int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *);
int stringmatch(const char *pattern, const char *string, int nocase) {
  return stringmatchlen(pattern, strlen(pattern), string, strlen(string),
                        nocase);
}


x86 assembly (clang, -O0):
<stringmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
mov    -0x14(%rbp),%r8d
call   1040 <stringmatchlen@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringmatch>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <stringmatchlen@plt>

LLVM IR (-O0):
define i32 @stringmatch(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = load i8*, i8** %5
%11 = load i8*, i8** %5
%12 = call i32 @strlen(i8* %11)
%13 = load i32, i32* %6
%14 = call i32 @stringmatchlen(i8* %7, i32 %9, i8* %10, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @stringmatch(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @stringmatchlen(i8* %0, i32 %4, i8* %1, i32 %5, i32 %2)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int ssize_t;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) {
  int i;
  ssize_t ssize = size;
  i = vsnprintf(buf, size, fmt, args);
  return (i >= ssize) ? (ssize - 1) : i;
}


x86 assembly (clang, -O0):
<vscnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jl     115f <vscnprintf+0x4f>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1165 <vscnprintf+0x55>
mov    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscnprintf>:
push   %rbx
mov    %rsi,%rbx
call   1030 <vsnprintf@plt>
lea    -0x1(%rbx),%ecx
cmp    %ebx,%eax
cmovge %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @vscnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
store i32 %12, i32* %10
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = load i8*, i8** %7
%16 = load i32, i32* %8
%17 = call i32 @vsnprintf(i8* %13, i64 %14, i8* %15, i32 %16)
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = icmp sge i32 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %4
%22 = load i32, i32* %10
%23 = sub nsw i32 %22, 1
br label %26
24: ; preds = %4
%25 = load i32, i32* %9
br label %26
26: ; preds = %24, %21
%27 = phi i32 [ %23, %21 ], [ %25, %24 ]
ret i32 %27
}

LLVM IR (-O2):
define i32 @vscnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = trunc i64 %1 to i32
%6 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%7 = icmp slt i32 %6, %5
%8 = add nsw i32 %5, -1
%9 = select i1 %7, i32 %6, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ log_error(char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ terminate();
void use_die(const char *msg) {
  log_error(msg);
  fprintf(stderr, "%s\n", msg);
  terminate();
}


x86 assembly (clang, -O0):
<use_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <log_error@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea7(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1050 <terminate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_die>:
push   %rbx
mov    %rdi,%rbx
call   1030 <log_error@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <terminate@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @use_die(i8* %0) {
%2 = tail call i32 @log_error(i8* %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 (...) @terminate()
ret void
}
void SIO1_writeBaud16(unsigned short val) {}


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

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

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

LLVM IR (-O2):
define void @SIO1_writeBaud16(i16 zeroext %0) {
ret void
}
void zeroStr(char *str, int len) {
  int i;
  for (i = 0; i < len; i++) {
    *(str + i) = '0';
  }
}


x86 assembly (clang, -O0):
<zeroStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <zeroStr+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zeroStr+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroStr>:
test   %esi,%esi
jle    1125 <zeroStr+0x15>
push   %rax
mov    %esi,%edx
mov    $0x30,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zeroStr(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void PWMSyncUpdate(uint32_t ui32Base, uint32_t ui32GenBits) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ui32GenBits;
}


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

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

LLVM IR (-O0):
define void @PWMSyncUpdate(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 0
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @PWMSyncUpdate(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Variables and functions */
unsigned int s5p_sdhci_init(unsigned int, int, int);
int samsung_get_base_mmc();
unsigned int s5p_mmc_init(int index, int bus_width) {
  unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
  return s5p_sdhci_init(base, index, bus_width);
}


x86 assembly (clang, -O0):
<s5p_mmc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <samsung_get_base_mmc@plt>
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <s5p_sdhci_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s5p_mmc_init>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <samsung_get_base_mmc@plt>
mov    %ebp,%edi
shl    $0x10,%edi
add    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <s5p_sdhci_init@plt>

LLVM IR (-O0):
define i32 @s5p_mmc_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @samsung_get_base_mmc()
%7 = load i32, i32* %3
%8 = mul nsw i32 65536, %7
%9 = add nsw i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @s5p_sdhci_init(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @s5p_mmc_init(i32 %0, i32 %1) {
%3 = tail call i32 (...) @samsung_get_base_mmc()
%4 = shl nsw i32 %0, 16
%5 = add nsw i32 %3, %4
%6 = tail call i32 @s5p_sdhci_init(i32 %5, i32 %0, i32 %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  const char *msg;
  msg = "LINKAGE TEST";
  write(STDOUT_FILENO, msg, strlen(msg));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%rax
mov    (%rax),%ebx
lea    0xecc(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"LINKAGE TEST\00"
@STDOUT_FILENO = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i32, i32* @STDOUT_FILENO
%8 = load i8*, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"LINKAGE TEST\00"
@STDOUT_FILENO = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int Add(int, int);
int /*<<< orphan*/ printf(char *, int);
void ExportA2() { printf("ExportA2: 3 + 9 = %d\n", Add(3, 9)); }


x86 assembly (clang, -O0):
<ExportA2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x9,%esi
call   1040 <Add@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExportA2>:
push   %rax
mov    $0x3,%edi
mov    $0x9,%esi
call   1040 <Add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"ExportA2: 3 + 9 = %d\0A\00"
define void @ExportA2() {
%1 = call i32 @Add(i32 3, i32 9)
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"ExportA2: 3 + 9 = %d\0A\00"
define void @ExportA2() {
%1 = tail call i32 @Add(i32 3, i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
size_t var_len(char *str) {
  size_t i;
  for (i = 1; isalnum(str[i]) || str[i] == '_'; i++)
    ;
  return i - 1;
}


x86 assembly (clang, -O0):
<var_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115c <var_len+0x4c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116c <var_len+0x5c>
jmp    1182 <var_len+0x72>
jmp    1171 <var_len+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <var_len+0x14>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
jmp    1124 <var_len+0x14>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    1120 <var_len+0x10>
cmpb   $0x5f,0x1(%r14,%rbx,1)
je     1120 <var_len+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @var_len(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i64 [ 1, %1 ], [ %12, %11 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i64 @isalnum(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8, i8* %4
%10 = icmp eq i8 %9, 95
br i1 %10, label %11, label %13
11: ; preds = %2, %8
%12 = add i64 %3, 1
br label %2
13: ; preds = %8
%14 = add i64 %3, -1
ret i64 %14
}
/* Type definitions */
struct reordering_mpdu {
  int dummy;
};
struct reordering_list {
  int dummy;
};

/* Variables and functions */
struct reordering_mpdu *ba_dequeue(struct reordering_list *);
struct reordering_mpdu *
ba_reordering_mpdu_dequeue(struct reordering_list *list) {
  return (ba_dequeue(list));
}


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

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

LLVM IR (-O0):
%struct.reordering_mpdu = type { i32 }
%struct.reordering_list = type { i32 }
define %struct.reordering_mpdu* @ba_reordering_mpdu_dequeue(%struct.reordering_list* %0) {
%2 = alloca %struct.reordering_list*
store %struct.reordering_list* %0, %struct.reordering_list** %2
%3 = load %struct.reordering_list*, %struct.reordering_list** %2
%4 = call %struct.reordering_mpdu* @ba_dequeue(%struct.reordering_list* %3)
ret %struct.reordering_mpdu* %4
}

LLVM IR (-O2):
%struct.reordering_mpdu = type { i32 }
%struct.reordering_list = type { i32 }
define %struct.reordering_mpdu* @ba_reordering_mpdu_dequeue(%struct.reordering_list* %0) {
%2 = tail call %struct.reordering_mpdu* @ba_dequeue(%struct.reordering_list* %0)
ret %struct.reordering_mpdu* %2
}
void cond_dummy_free(const struct XCSF *xcsf, const struct Cl *c) {
  (void)xcsf;
  (void)c;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_free(%struct.XCSF* %0, %struct.Cl* %1) {
%3 = alloca %struct.XCSF*
%4 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %3
store %struct.Cl* %1, %struct.Cl** %4
%5 = load %struct.XCSF*, %struct.XCSF** %3
%6 = load %struct.Cl*, %struct.Cl** %4
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_free(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char const *strerror(int /*<<< orphan*/);
void displayError(const char *on_what) {
  fputs(strerror(errno), stderr);
  fputs(": ", stderr);
  fputs(on_what, stderr);
  fputc('\n', stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<displayError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
lea    0xe85(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e55(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<displayError>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    0x2e84(%rip),%rbx
mov    (%rbx),%esi
mov    %rax,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xe91(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [3 x i8] c": \00"
define void @displayError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @errno
%4 = call i8* @strerror(i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* %4, i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %2
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fputc(i8 signext 10, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [3 x i8] c": \00"
define void @displayError(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputs(i8* %0, i32 %8)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputc(i8 signext 10, i32 %10)
%12 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *lsl_library_info();
int lsl_library_version();
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  printf("LSL version: %d\n%s\n", lsl_library_version(), lsl_library_info());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <lsl_library_version@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <lsl_library_info@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rdx
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <lsl_library_version@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <lsl_library_info@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"LSL version: %d\0A%s\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @lsl_library_version()
%2 = tail call i8* (...) @lsl_library_info()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stb_free(void *);
void *stb_malloc(void *, size_t);
void *stb_realloc(void *, size_t);
void *stb_realloc_c(void *context, void *ptr, size_t newsize) {
  if (ptr == NULL)
    return stb_malloc(context, newsize);
  if (newsize == 0) {
    stb_free(ptr);
    return NULL;
  }
  return stb_realloc(ptr, newsize);
}


x86 assembly (clang, -O0):
<stb_realloc_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <stb_realloc_c+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <stb_malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1197 <stb_realloc_c+0x67>
cmpq   $0x0,-0x20(%rbp)
jne    1186 <stb_realloc_c+0x56>
mov    -0x18(%rbp),%rdi
call   1040 <stb_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1197 <stb_realloc_c+0x67>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <stb_realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_realloc_c>:
test   %rsi,%rsi
je     1145 <stb_realloc_c+0x15>
test   %rdx,%rdx
je     114d <stb_realloc_c+0x1d>
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <stb_realloc@plt>
mov    %rdx,%rsi
jmp    1050 <stb_malloc@plt>
push   %rax
mov    %rsi,%rdi
call   1040 <stb_free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @stb_realloc_c(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i64, i64* %7
%13 = call i8* @stb_malloc(i8* %11, i64 %12)
store i8* %13, i8** %4
br label %24
14: ; preds = %3
%15 = load i64, i64* %7
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i8*, i8** %6
%19 = call i32 @stb_free(i8* %18)
store i8* null, i8** %4
br label %24
20: ; preds = %14
%21 = load i8*, i8** %6
%22 = load i64, i64* %7
%23 = call i8* @stb_realloc(i8* %21, i64 %22)
store i8* %23, i8** %4
br label %24
24: ; preds = %20, %17, %10
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @stb_realloc_c(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* @stb_malloc(i8* %0, i64 %2)
br label %13
7: ; preds = %3
%8 = icmp eq i64 %2, 0
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @stb_free(i8* %1)
br label %13
11: ; preds = %7
%12 = tail call i8* @stb_realloc(i8* %1, i64 %2)
br label %13
13: ; preds = %11, %9, %5
%14 = phi i8* [ %6, %5 ], [ null, %9 ], [ %12, %11 ]
ret i8* %14
}