xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t galois8(uint8_t lfsr) { return (lfsr >> 1) ^ (-(lfsr & 1u) & 0xB8); }


x86 assembly (clang, -O0):
<galois8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
and    $0xb8,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<galois8>:
mov    %edi,%eax
sar    %eax
and    $0x1,%edi
neg    %edi
and    $0xb8,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @galois8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, 1
%7 = sub i32 0, %6
%8 = and i32 %7, 184
%9 = xor i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @galois8(i32 %0) {
%2 = ashr i32 %0, 1
%3 = and i32 %0, 1
%4 = sub nsw i32 0, %3
%5 = and i32 %4, 184
%6 = xor i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_help_show(char *);
void roadmap_help_options(void) { roadmap_help_show("options"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"options\00"
define void @roadmap_help_options() {
%1 = tail call i32 @roadmap_help_show(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void V_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @V_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_error_string(unsigned long, int /*<<< orphan*/ *);
unsigned long ERR_get_error_line(char const **, int *);
int /*<<< orphan*/ jlog(int, char *, int /*<<< orphan*/);
void openssl_error_stack() {
  const char *file;
  int line;
  unsigned long e;
  do {
    e = ERR_get_error_line(&file, &line);
    jlog(0x04, "openssl]> %s", ERR_error_string(e, NULL));
  } while (e);
}


x86 assembly (clang, -O0):
<openssl_error_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <ERR_get_error_line@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <ERR_error_string@plt>
mov    %eax,%edx
mov    $0x4,%edi
lea    0xe9c(%rip),%rsi
call   1040 <jlog@plt>
cmpq   $0x0,-0x18(%rbp)
jne    1138 <openssl_error_stack+0x8>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_error_stack>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%r15
lea    0xeb4(%rip),%r12
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <ERR_get_error_line@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <ERR_error_string@plt>
mov    $0x4,%edi
mov    %r12,%rsi
mov    %eax,%edx
call   1040 <jlog@plt>
test   %rbx,%rbx
jne    1150 <openssl_error_stack+0x20>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"openssl]> %s\00"
define void @openssl_error_stack() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i64
br label %4
4: ; preds = %9, %0
%5 = call i64 @ERR_get_error_line(i8** %1, i32* %2)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @ERR_error_string(i64 %6, i32* null)
%8 = call i32 @jlog(i32 4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %4
%10 = load i64, i64* %3
%11 = icmp ne i64 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"openssl]> %s\00"
define void @openssl_error_stack() {
%1 = alloca i8*
%2 = alloca i32
%3 = bitcast i8** %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
%6 = call i64 @ERR_get_error_line(i8** %1, i32* %2)
%7 = call i32 @ERR_error_string(i64 %6, i32* null)
%8 = call i32 @jlog(i32 4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp eq i64 %6, 0
br i1 %9, label %10, label %5
10: ; preds = %5
ret void
}
int sgn(int cislo) {
  if (cislo > 0)
    return 1;
  else if (cislo < 0)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111d <sgn+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113a <sgn+0x3a>
cmpl   $0x0,-0x8(%rbp)
jge    1133 <sgn+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <sgn+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
mov    %edi,%ecx
sar    $0x1f,%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sgn(i32 %0) {
%2 = ashr i32 %0, 31
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 %2, i32 1
ret i32 %4
}
void I2CSlaveDataPut(unsigned int baseAdd, unsigned int data) {
  (*((volatile unsigned int *)(baseAdd + (0x9C)))) = data;
}


x86 assembly (clang, -O0):
<I2CSlaveDataPut>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x9c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveDataPut>:
add    $0x9c,%edi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @I2CSlaveDataPut(i32 %0, i32 %1) {
%3 = add i32 %0, 156
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Variables and functions */
scalar_t__ calloc(unsigned long, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
int /*<<< orphan*/ stderr;
void *HTscalloc(unsigned long size) {
  void *retval;
  retval = (void *)calloc(size, 1);
  if (!retval && size > 0) {
    fprintf(stderr, "HTscalloc: Unable to allocate %lu bytes of memory\n",
            size);
    exit(1);
  }
  return retval;
}


x86 assembly (clang, -O0):
<HTscalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1187 <HTscalloc+0x57>
cmpq   $0x0,-0x8(%rbp)
jbe    1187 <HTscalloc+0x57>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTscalloc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <calloc@plt>
test   %rbx,%rbx
je     1148 <HTscalloc+0x18>
test   %rax,%rax
je     114a <HTscalloc+0x1a>
pop    %rbx
ret
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"HTscalloc: Unable to allocate %lu bytes of memory\0A\00"
define i8* @HTscalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @calloc(i64 %4, i32 1)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %17, label %9
9: ; preds = %1
%10 = load i64, i64* %2
%11 = icmp ugt i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* @stderr
%14 = load i64, i64* %2
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %9, %1
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"HTscalloc: Unable to allocate %lu bytes of memory\0A\00"
define i8* @HTscalloc(i64 %0) {
%2 = tail call i64 @calloc(i64 %0, i32 1)
%3 = icmp eq i64 %2, 0
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = inttoptr i64 %2 to i8*
ret i8* %11
}
void print_list(int a[]) {}


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

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

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

LLVM IR (-O2):
define void @print_list(i32* nocapture %0) {
ret void
}
void free_dummy(int side) {}


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

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

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

LLVM IR (-O2):
define void @free_dummy(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_wasm_grow_memory(long);
void f2(long delta) { __builtin_wasm_grow_memory(delta); }


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

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

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

LLVM IR (-O2):
define void @f2(i64 %0) {
%2 = tail call i32 @__builtin_wasm_grow_memory(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_speakerset();
void inqSpeakerSet() { send_speakerset(); }


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

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

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

LLVM IR (-O2):
define void @inqSpeakerSet() {
%1 = tail call i32 (...) @send_speakerset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printn(int);
void main() {
  int x = 1;
  while (1 == 1) {
    printn(x);
    if (x == 4)
      printn(40);
    x++;
    if (x == 12)
      break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <printn@plt>
cmpl   $0x4,-0x4(%rbp)
jne    113b <main+0x2b>
mov    $0x28,%edi
call   1030 <printn@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jne    1153 <main+0x43>
jmp    1158 <main+0x48>
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <printn@plt>
mov    $0x2,%edi
call   1030 <printn@plt>
mov    $0x3,%edi
call   1030 <printn@plt>
mov    $0x4,%edi
call   1030 <printn@plt>
mov    $0x28,%edi
call   1030 <printn@plt>
mov    $0x5,%edi
call   1030 <printn@plt>
mov    $0x6,%edi
call   1030 <printn@plt>
mov    $0x7,%edi
call   1030 <printn@plt>
mov    $0x8,%edi
call   1030 <printn@plt>
mov    $0x9,%edi
call   1030 <printn@plt>
mov    $0xa,%edi
call   1030 <printn@plt>
mov    $0xb,%edi
pop    %rax
jmp    1030 <printn@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @printn(i32 1)
%2 = tail call i32 @printn(i32 2)
%3 = tail call i32 @printn(i32 3)
%4 = tail call i32 @printn(i32 4)
%5 = tail call i32 @printn(i32 40)
%6 = tail call i32 @printn(i32 5)
%7 = tail call i32 @printn(i32 6)
%8 = tail call i32 @printn(i32 7)
%9 = tail call i32 @printn(i32 8)
%10 = tail call i32 @printn(i32 9)
%11 = tail call i32 @printn(i32 10)
%12 = tail call i32 @printn(i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmd_error(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *str_dup(char *str) {
  char *p;
  if ((p = malloc(strlen(str) + 1)) == NULL) {
    cmd_error("out of memory\n");
  }
  strcpy(p, str);
  return p;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117b <str_dup+0x3b>
lea    0xe8a(%rip),%rdi
call   1060 <cmd_error@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1169 <str_dup+0x29>
lea    0xe9c(%rip),%rdi
call   1060 <cmd_error@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @cmd_error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @str_dup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @cmd_error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ audiopaser(char *, char *, char *);
int /*<<< orphan*/ videoparser(char *, char *, char *);
int main(int argc, char *argv[]) {
  audiopaser("test.mp3", ".", ".");
  videoparser("test.mp4", ".", ".");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xec5(%rip),%rdx
mov    %rdx,%rsi
call   1030 <audiopaser@plt>
lea    0xeb8(%rip),%rdi
lea    0xeaf(%rip),%rdx
mov    %rdx,%rsi
call   1040 <videoparser@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rbx
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <audiopaser@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1040 <videoparser@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.mp3\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [9 x i8] c"test.mp4\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @audiopaser(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @videoparser(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.mp3\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [9 x i8] c"test.mp4\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @audiopaser(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @videoparser(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
float nmea183ConvertDMS2Degrees(float in) {
  int degrees = in / 100;
  float decDegrees = (in - (100 * degrees)) / 60.0;
  return degrees + decDegrees;
}


x86 assembly (clang, -O0):
<nmea183ConvertDMS2Degrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
imul   $0x64,-0x8(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmea183ConvertDMS2Degrees>:
movaps %xmm0,%xmm1
divss  0xef5(%rip),%xmm1
cvttss2si %xmm1,%eax
imul   $0x64,%eax,%eax
cvtsi2ss %eax,%xmm2
subss  %xmm2,%xmm0
divss  0xee2(%rip),%xmm0
cvttps2dq %xmm1,%xmm1
cvtdq2ps %xmm1,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @nmea183ConvertDMS2Degrees(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = fdiv float %5, 1.000000e+02
%7 = fptosi float %6 to i32
store i32 %7, i32* %3
%8 = load float, float* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 100, %9
%11 = sitofp i32 %10 to float
%12 = fsub float %8, %11
%13 = fpext float %12 to double
%14 = fdiv double %13, 6.000000e+01
%15 = fptrunc double %14 to float
store float %15, float* %4
%16 = load i32, i32* %3
%17 = sitofp i32 %16 to float
%18 = load float, float* %4
%19 = fadd float %17, %18
ret float %19
}

LLVM IR (-O2):
define float @nmea183ConvertDMS2Degrees(float %0) {
%2 = fdiv float %0, 1.000000e+02
%3 = fptosi float %2 to i32
%4 = mul nsw i32 %3, 100
%5 = sitofp i32 %4 to float
%6 = fsub float %0, %5
%7 = fdiv float %6, 6.000000e+01
%8 = sitofp i32 %3 to float
%9 = fadd float %7, %8
ret float %9
}
int do_057() { return 57; }


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

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

LLVM IR (-O0):
define i32 @do_057() {
ret i32 57
}

LLVM IR (-O2):
define i32 @do_057() {
ret i32 57
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ putchar(char);
int main(int argc, char *argv[]) {
  char base = 'A';
  int add = 0;
  if (argc > 2) {
    base = argv[1][0];
    add = atoi(argv[2]);
  }
  base += add;
  putchar(base);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x41,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1168 <main+0x48>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
movsbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x41,%al
cmp    $0x3,%edi
jl     1139 <main+0x19>
mov    0x8(%rsi),%rax
mov    0x10(%rsi),%rdi
mov    (%rax),%bl
call   1040 <atoi@plt>
add    %bl,%al
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = trunc i32 %10 to i8
%12 = add i8 %7, %11
br label %13
13: ; preds = %4, %2
%14 = phi i8 [ %12, %4 ], [ 65, %2 ]
%15 = tail call i32 @putchar(i8 signext %14)
ret i32 0
}
void testClosureFSFrV(void (*closure)(float, short, float), float a1, short a2,
                      float a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureFSFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
movss  %xmm1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
mov    -0xe(%rbp),%cx
movss  -0x14(%rbp),%xmm1
movswl %cx,%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFSFrV>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureFSFrV(void (float, i16, float)* %0, float %1, i16 signext %2, float %3) {
%5 = alloca void (float, i16, float)*
%6 = alloca float
%7 = alloca i16
%8 = alloca float
store void (float, i16, float)* %0, void (float, i16, float)** %5
store float %1, float* %6
store i16 %2, i16* %7
store float %3, float* %8
%9 = load void (float, i16, float)*, void (float, i16, float)** %5
%10 = load float, float* %6
%11 = load i16, i16* %7
%12 = load float, float* %8
ret void
}

LLVM IR (-O2):
define void @testClosureFSFrV(void (float, i16, float)* nocapture %0, float %1, i16 signext %2, float %3) {
tail call void %0(float %1, i16 signext %2, float %3)
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int rand_r(unsigned int *);
void thread_sleep(void) {
  struct timespec t;
  int seed = 0;
  t.tv_sec = 0;
  t.tv_nsec = rand_r((unsigned int *)&seed) % (10000000 + 1);
  nanosleep(&t, NULL);
}


x86 assembly (clang, -O0):
<thread_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <rand_r@plt>
mov    $0x989681,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_sleep>:
sub    $0x18,%rsp
movl   $0x0,0x4(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <rand_r@plt>
cltq
imul   $0x6b5fc9b7,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x36,%rcx
add    %edx,%ecx
imul   $0x989681,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @thread_sleep() {
%1 = alloca %struct.timespec
%2 = alloca i32
store i32 0, i32* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %3
%4 = call i32 @rand_r(i32* %2)
%5 = srem i32 %4, 10000001
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @thread_sleep() {
%1 = alloca %struct.timespec
%2 = alloca i32
%3 = bitcast %struct.timespec* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 0, i64* %5
%6 = call i32 @rand_r(i32* %2)
%7 = srem i32 %6, 10000001
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ log_printf(int, char *, char const *);
scalar_t__ lseek(int, long, int /*<<< orphan*/);
int safe_rewind(int fd, const char *filename) {
  if (lseek(fd, 0L, SEEK_SET) < 0) {
    log_printf(2, "While seeking to start of %s: %m\n", filename);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<safe_rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <lseek@plt>
cmp    $0x0,%rax
jge    116f <safe_rewind+0x4f>
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
lea    0xea2(%rip),%rsi
call   1040 <log_printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1176 <safe_rewind+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_rewind>:
push   %rbx
mov    %rsi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
js     1143 <safe_rewind+0x23>
pop    %rbx
ret
lea    0xeb6(%rip),%rsi
mov    $0x2,%edi
mov    %rbx,%rdx
call   1040 <log_printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [34 x i8] c"While seeking to start of %s: %m\0A\00"
define i32 @safe_rewind(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i64 @lseek(i32 %6, i64 0, i32 %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i32 @log_printf(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [34 x i8] c"While seeking to start of %s: %m\0A\00"
define i32 @safe_rewind(i32 %0, i8* %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i64 @lseek(i32 %0, i64 0, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @log_printf(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %9
}
int main() {
  int bidon;
  bidon = 1;
  bidon++;
  return 0;
}


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

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

LLVM IR (-O0):
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 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int gb18030_match(unsigned char *s, const unsigned char *bytes,
                  unsigned char len) {
  int i;
  for (i = 0; i < len; ++i)
    if ((s[i]) != bytes[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<gb18030_match>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
movzbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jge    1166 <gb18030_match+0x66>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1153 <gb18030_match+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116d <gb18030_match+0x6d>
jmp    1158 <gb18030_match+0x58>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1118 <gb18030_match+0x18>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb18030_match>:
mov    $0x1,%eax
test   %edx,%edx
je     1122 <gb18030_match+0x22>
movzbl %dl,%r8d
xor    %edx,%edx
nop
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <gb18030_match+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <gb18030_match+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @gb18030_match(i8* nocapture %0, i8* nocapture %1, i8 zeroext %2) {
%4 = icmp eq i8 %2, 0
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = zext i8 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
const char *pathconN_nm10_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm10_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <pathconN_nm10_name_in+0x27>
jmp    1117 <pathconN_nm10_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <pathconN_nm10_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm10_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
define i8* @pathconN_nm10_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @pathconN_nm10_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Variables and functions */
char *dirname(char *);
int /*<<< orphan*/ printf(char *, char *);
int __dirname(char *arg) {
  printf("%s\n", dirname(arg));
  return 0;
}


x86 assembly (clang, -O0):
<__dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dirname@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dirname>:
push   %rax
call   1040 <dirname@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @__dirname(i8* %0) {
%2 = tail call i8* @dirname(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int test_imm_43int16_mem(short *val) {
  return ((*val) & (-0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffbd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_43int16_mem>:
movzwl (%rdi),%eax
test   $0xffbd,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_43int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -67
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_43int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -67
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float tan_32s(float x) {
  static const float c1 = -3.6112171;
  static const float c2 = -4.6133253;
  float x2;
  x2 = x * x;
  return (x * c1 / (c2 + x2));
}


x86 assembly (clang, -O0):
<tan_32s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee4(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xed3(%rip),%xmm1
addss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan_32s>:
movaps %xmm0,%xmm1
mulss  0xef5(%rip),%xmm0
mulss  %xmm1,%xmm1
addss  0xeed(%rip),%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@tan_32s.c1 = internal constant float 0xC00CE3C5C0000000
@tan_32s.c2 = internal constant float 0xC012740B80000000
define float @tan_32s(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %2
%8 = fmul float %7, 0xC00CE3C5C0000000
%9 = load float, float* %3
%10 = fadd float 0xC012740B80000000, %9
%11 = fdiv float %8, %10
ret float %11
}

LLVM IR (-O2):
define float @tan_32s(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %0, 0xC00CE3C5C0000000
%4 = fadd float %2, 0xC012740B80000000
%5 = fdiv float %3, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ toupper(int /*<<< orphan*/);
int begins_with(char *ptr, char *string) {
  while (*string)
    if (toupper(*ptr++) != *string++)
      return 0;
  return -1;
}


x86 assembly (clang, -O0):
<begins_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116f <begins_with+0x5f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     116a <begins_with+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1176 <begins_with+0x66>
jmp    1120 <begins_with+0x10>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<begins_with>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl (%r15,%rbx,1),%ebp
test   %ebp,%ebp
je     113f <begins_with+0x2f>
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
add    $0x1,%rbx
cmp    %ebp,%eax
je     1120 <begins_with+0x10>
xor    %eax,%eax
jmp    1144 <begins_with+0x34>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @begins_with(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %13, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = tail call i32 @toupper(i32 %11)
%13 = getelementptr inbounds i8, i8* %5, i64 1
%14 = sext i8 %6 to i32
%15 = icmp eq i32 %12, %14
br i1 %15, label %3, label %16
16: ; preds = %3, %8
%17 = phi i32 [ 0, %8 ], [ -1, %3 ]
ret i32 %17
}
int hash_string(char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = (unsigned char)(*str++)))
    hash = ((hash << 5UL) + hash) + (unsigned long)c;
  return (int)(hash % 43);
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash_string+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_string+0x10>
mov    -0x10(%rbp),%rax
mov    $0x2b,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%al
test   %al,%al
je     1147 <hash_string+0x47>
add    $0x1,%rdi
mov    $0x1505,%ecx
nop
mov    %rcx,%rdx
shl    $0x5,%rdx
add    %rcx,%rdx
movzbl %al,%ecx
add    %rdx,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_string+0x10>
movabs $0xbe82fa0be82fa0bf,%rdx
fa 82 be
mov    %rcx,%rax
mul    %rdx
shr    $0x5,%rdx
imul   $0x2b,%edx,%eax
sub    %eax,%ecx
mov    %ecx,%eax
ret
mov    $0x6,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %11, 43
%16 = trunc i64 %15 to i32
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 6, %1 ], [ %16, %14 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f3(int var) { printf("this is f3 and var is: %d\n", var); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"this is f3 and var is: %d\0A\00"
define void @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"this is f3 and var is: %d\0A\00"
define void @f3(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void sigintHandler(int sig_num) {}


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

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

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

LLVM IR (-O2):
define void @sigintHandler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_load_pipe();
int /*<<< orphan*/ t16_blx_lrimm();
void t16_blx_h3() {
  t16_blx_lrimm();
  arm_load_pipe();
}


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

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

LLVM IR (-O0):
define void @t16_blx_h3() {
%1 = call i32 (...) @t16_blx_lrimm()
%2 = call i32 (...) @arm_load_pipe()
ret void
}

LLVM IR (-O2):
define void @t16_blx_h3() {
%1 = tail call i32 (...) @t16_blx_lrimm()
%2 = tail call i32 (...) @arm_load_pipe()
ret void
}
/* Variables and functions */
int getNumOfChar(char **, char, int);
int getNumOfSquirrel(char **address, int size) {
  return getNumOfChar(address, 'd', size);
}


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

x86 assembly (clang, -O2):
<getNumOfSquirrel>:
mov    %esi,%edx
mov    $0x64,%esi
jmp    1030 <getNumOfChar@plt>

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

LLVM IR (-O2):
define i32 @getNumOfSquirrel(i8** %0, i32 %1) {
%3 = tail call i32 @getNumOfChar(i8** %0, i8 signext 100, i32 %1)
ret i32 %3
}
void task_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @task_resume() {
ret void
}
void foo077(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo077(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ROL16(int /*<<< orphan*/, int);
int /*<<< orphan*/ SA1Direct(int);
void Op26M0(void) { ROL16(SA1Direct(3), 0xFFFF); }


x86 assembly (clang, -O0):
<Op26M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <ROL16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op26M0>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <ROL16@plt>

LLVM IR (-O0):
define void @Op26M0() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @ROL16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op26M0() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @ROL16(i32 %1, i32 65535)
ret void
}
void ff_hevc_put_hevc_uni_qpel_h8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h8_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ R_Systeminit();
int /*<<< orphan*/ __DI();
void hdwinit(void) {
  __DI();
  R_Systeminit();
}


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

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

LLVM IR (-O0):
define void @hdwinit() {
%1 = call i32 (...) @__DI()
%2 = call i32 (...) @R_Systeminit()
ret void
}

LLVM IR (-O2):
define void @hdwinit() {
%1 = tail call i32 (...) @__DI()
%2 = tail call i32 (...) @R_Systeminit()
ret void
}
int searchListFound() { return 1; }


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

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

LLVM IR (-O0):
define i32 @searchListFound() {
ret i32 1
}

LLVM IR (-O2):
define i32 @searchListFound() {
ret i32 1
}