xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ argv_escape_join(char **, int, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  char *out = NULL;
  if (argv_escape_join(argv, argc, &out)) {
    fprintf(stderr, "%s\n", out);
    free(out);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
lea    -0x18(%rbp),%rdx
call   1050 <argv_escape_join@plt>
cmp    $0x0,%rax
je     118a <main+0x5a>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
movq   $0x0,(%rsp)
mov    %rsp,%rdx
mov    %rsi,%rdi
mov    %eax,%esi
call   1050 <argv_escape_join@plt>
test   %rax,%rax
je     116f <main+0x3f>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
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* null, i8** %6
%7 = load i8**, i8*** %5
%8 = load i32, i32* %4
%9 = call i64 @argv_escape_join(i8** %7, i32 %8, i8** %6)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %6
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
br label %17
17: ; preds = %11, %2
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i64 @argv_escape_join(i8** %1, i32 %0, i8** %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %7, %2
ret i32 0
}
/* Variables and functions */
int DE_Manipulate(char);
int DE_Copy() { return (DE_Manipulate('c')); }


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

x86 assembly (clang, -O2):
<DE_Copy>:
mov    $0x63,%edi
jmp    1030 <DE_Manipulate@plt>

LLVM IR (-O0):
define i32 @DE_Copy() {
%1 = call i32 @DE_Manipulate(i8 signext 99)
ret i32 %1
}

LLVM IR (-O2):
define i32 @DE_Copy() {
%1 = tail call i32 @DE_Manipulate(i8 signext 99)
ret i32 %1
}
/* Variables and functions */
char *strchr(char *, char);
char *skip(char *s, int n) {
  char *t;
  while (n--) {
    t = strchr(s, '|');
    if (t == NULL)
      return NULL;
    s = t + 1;
  }
  return s;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     116e <skip+0x5e>
mov    -0x10(%rbp),%rdi
mov    $0x7c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115d <skip+0x4d>
movq   $0x0,-0x8(%rbp)
jmp    1176 <skip+0x66>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <skip+0xf>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
push   %rbx
mov    %rdi,%rax
test   %esi,%esi
je     113d <skip+0x2d>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
mov    $0x7c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113f <skip+0x2f>
add    $0xffffffff,%ebx
add    $0x1,%rax
test   %ebx,%ebx
jne    1120 <skip+0x10>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %6
4: ; preds = %6
%5 = icmp eq i32 %9, 0
br i1 %5, label %13, label %6
6: ; preds = %2, %4
%7 = phi i32 [ %9, %4 ], [ %1, %2 ]
%8 = phi i8* [ %12, %4 ], [ %0, %2 ]
%9 = add nsw i32 %7, -1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 124)
%11 = icmp eq i8* %10, null
%12 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %11, label %13, label %4
13: ; preds = %6, %4, %2
%14 = phi i8* [ %0, %2 ], [ %12, %4 ], [ null, %6 ]
ret i8* %14
}
void MMU_InvalidateTlbsAll(void) {}


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

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

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

LLVM IR (-O2):
define void @MMU_InvalidateTlbsAll() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ activate_threads();
void immediate_notify(void) {
  {
    { activate_threads(); }
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @immediate_notify() {
%1 = tail call i32 (...) @activate_threads()
ret void
}
void I422ToARGBRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGBRow_Any_AVX2() {
ret void
}
long get_minute(long time) { return time % 60; }


x86 assembly (clang, -O0):
<get_minute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_minute>:
movabs $0x8888888888888889,%rcx
88 88 88
mov    %rdi,%rax
imul   %rcx
add    %rdi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x5,%rdx
add    %rax,%rdx
imul   $0x3c,%rdx,%rax
sub    %rax,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @get_minute(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = srem i64 %3, 60
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_minute(i64 %0) {
%2 = srem i64 %0, 60
ret i64 %2
}
/* Type definitions */
struct lk_list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LK_LIST_HEAD(struct lk_list_head *);
int /*<<< orphan*/ lk_list_replace(struct lk_list_head *,
                                   struct lk_list_head *);
void lk_list_replace_init(struct lk_list_head *old, struct lk_list_head *new) {
  lk_list_replace(old, new);
  INIT_LK_LIST_HEAD(old);
}


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

x86 assembly (clang, -O2):
<lk_list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <lk_list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <INIT_LK_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.lk_list_head = type { i32 }
define void @lk_list_replace_init(%struct.lk_list_head* %0, %struct.lk_list_head* %1) {
%3 = alloca %struct.lk_list_head*
%4 = alloca %struct.lk_list_head*
store %struct.lk_list_head* %0, %struct.lk_list_head** %3
store %struct.lk_list_head* %1, %struct.lk_list_head** %4
%5 = load %struct.lk_list_head*, %struct.lk_list_head** %3
%6 = load %struct.lk_list_head*, %struct.lk_list_head** %4
%7 = call i32 @lk_list_replace(%struct.lk_list_head* %5, %struct.lk_list_head* %6)
%8 = load %struct.lk_list_head*, %struct.lk_list_head** %3
%9 = call i32 @INIT_LK_LIST_HEAD(%struct.lk_list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.lk_list_head = type { i32 }
define void @lk_list_replace_init(%struct.lk_list_head* %0, %struct.lk_list_head* %1) {
%3 = tail call i32 @lk_list_replace(%struct.lk_list_head* %0, %struct.lk_list_head* %1)
%4 = tail call i32 @INIT_LK_LIST_HEAD(%struct.lk_list_head* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void errmesg(char *msg) {
  fprintf(stderr, "**** %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<errmesg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errmesg>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"**** %s\0A\00"
define void @errmesg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void ps_clear() {}


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

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

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

LLVM IR (-O2):
define void @ps_clear() {
ret void
}
unsigned long long cpucycles(void) {
  unsigned long long result;
  __asm volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax"
                 : "=a"(result)::"%rdx");
  return result;
}


x86 assembly (clang, -O0):
<cpucycles>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpucycles>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @cpucycles() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @cpucycles() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
unsigned string_hash(const char *str) {
  unsigned result = 0;
  unsigned exponent = 1;
  while (*str != '\0') {
    result += *(str++) * exponent;
    exponent *= 2;
  }
  return result;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <string_hash+0x50>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <string_hash+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1136 <string_hash+0x36>
add    $0x1,%rdi
xor    %eax,%eax
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
imul   %edx,%ecx
add    %ecx,%eax
add    %edx,%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <string_hash+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %13, %4 ], [ 1, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = phi i8* [ %10, %4 ], [ %0, %1 ]
%9 = sext i8 %5 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = mul i32 %6, %9
%12 = add i32 %11, %7
%13 = shl i32 %6, 1
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %17
}
main() { return 0b100 + 0xa; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 14
}
void ff_hevc_put_hevc_uni_qpel_hv8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_hv8_10_sse4() {
ret void
}
void __DELETE_java_lang_Double(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_Double(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void set_sock_nonblock(int sockfd) {
  int arg = fcntl(sockfd, F_GETFL, NULL);
  arg |= O_NONBLOCK;
  fcntl(sockfd, F_SETFL, arg);
}


x86 assembly (clang, -O0):
<set_sock_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sock_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @set_sock_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* @O_NONBLOCK
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = call i32 @fcntl(i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @set_sock_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %5)
ret void
}
/* Variables and functions */
scalar_t__ SD_sendCommand(int, unsigned long);
scalar_t__ transmit_DataBlock(unsigned char *, int);
unsigned char SD_writeSingleBlock(unsigned char *buff,
                                  unsigned long startBlock) {
  if (SD_sendCommand((0x40 + 24), startBlock << 9))
    return 1;
  if (transmit_DataBlock(buff, 0xfe))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<SD_writeSingleBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
shl    $0x9,%rsi
mov    $0x58,%edi
call   1030 <SD_sendCommand@plt>
cmp    $0x0,%rax
je     1155 <SD_writeSingleBlock+0x35>
movb   $0x1,-0x1(%rbp)
jmp    117a <SD_writeSingleBlock+0x5a>
mov    -0x10(%rbp),%rdi
mov    $0xfe,%esi
call   1040 <transmit_DataBlock@plt>
cmp    $0x0,%rax
je     1176 <SD_writeSingleBlock+0x56>
movb   $0x1,-0x1(%rbp)
jmp    117a <SD_writeSingleBlock+0x5a>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SD_writeSingleBlock>:
push   %rbx
mov    %rdi,%rbx
shl    $0x9,%rsi
mov    $0x58,%edi
call   1030 <SD_sendCommand@plt>
mov    %rax,%rcx
mov    $0x1,%al
test   %rcx,%rcx
je     113e <SD_writeSingleBlock+0x1e>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0xfe,%esi
call   1040 <transmit_DataBlock@plt>
test   %rax,%rax
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define zeroext i8 @SD_writeSingleBlock(i8* %0, i64 %1) {
%3 = shl i64 %1, 9
%4 = tail call i64 @SD_sendCommand(i32 88, i64 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @transmit_DataBlock(i8* %0, i32 254)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i8
br label %10
10: ; preds = %6, %2
%11 = phi i8 [ 1, %2 ], [ %9, %6 ]
ret i8 %11
}
int test_imm_CAuint16_reg(unsigned short val) {
  return ((val) & (-0xCA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CAuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff36,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CAuint16_reg>:
test   $0xff36,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CAuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -202
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double sinus(double, int /*<<< orphan*/);
double sin(double x) { return sinus(x, 0); }


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

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

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

LLVM IR (-O2):
define double @sin(double %0) {
%2 = tail call double @sinus(double %0, i32 0)
ret double %2
}
/* Type definitions */
struct timeval {
  long tv_sec;
  scalar_t__ tv_usec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int empty(fd_set *mask, int hifd, int sec) {
  struct timeval t;
  t.tv_sec = (long)sec;
  t.tv_usec = 0;
  return (select(hifd + 1, mask, (fd_set *)0, (fd_set *)0, &t));
}


x86 assembly (clang, -O0):
<empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x20(%rbp),%r8
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty>:
sub    $0x18,%rsp
mov    %rdi,%rax
movslq %edx,%rcx
mov    %rcx,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x1(%rsi),%edi
lea    0x8(%rsp),%r8
mov    %rax,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @empty(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.timeval
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i64 %9, i64* %10
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
store i64 0, i64* %11
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
%14 = load i32*, i32** %4
%15 = call i32 @select(i32 %13, i32* %14, i32* null, i32* null, %struct.timeval* %7)
ret i32 %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @empty(i32* %0, i32 %1, i32 %2) {
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %4 to i8*
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
store i64 %6, i64* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
store i64 0, i64* %8
%9 = add nsw i32 %1, 1
%10 = call i32 @select(i32 %9, i32* %0, i32* null, i32* null, %struct.timeval* %4)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void log_vformat(int level, const char *fmt, va_list args) {
  vprintf(fmt, args);
}


x86 assembly (clang, -O0):
<log_vformat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <vprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_vformat>:
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define void @log_vformat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @vprintf(i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @log_vformat(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vprintf(i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tempString;

/* Variables and functions */
int setStandardProcedure(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int setMaxSlewRate(int slewRate) {
  char tempString[16];
  if (slewRate < 2 || slewRate > 8)
    return -1;
  snprintf(tempString, sizeof(tempString), "#:Sw%d#", slewRate);
  return (setStandardProcedure(tempString));
}


x86 assembly (clang, -O0):
<setMaxSlewRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     113f <setMaxSlewRate+0x1f>
cmpl   $0x8,-0x8(%rbp)
jle    114b <setMaxSlewRate+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <setMaxSlewRate+0x4f>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x10,%esi
lea    0xea2(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <setStandardProcedure@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setMaxSlewRate>:
mov    %edi,%ecx
lea    -0x9(%rcx),%edx
mov    $0xffffffff,%eax
cmp    $0xfffffff9,%edx
jb     1158 <setMaxSlewRate+0x38>
push   %rbx
sub    $0x10,%rsp
lea    0xec5(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <setStandardProcedure@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"#:Sw%d#\00"
define i32 @setMaxSlewRate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [16 x i8]
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 8
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i32 -1, i32* %2
br label %17
11: ; preds = %7
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%13 = load i32, i32* %3
%14 = call i32 @snprintf(i8* %12, i32 16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%16 = call i32 @setStandardProcedure(i8* %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [8 x i8] c"#:Sw%d#\00"
define i32 @setMaxSlewRate(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = add i32 %0, -9
%5 = icmp ult i32 %4, -7
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @snprintf(i8* %3, i32 16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = call i32 @setStandardProcedure(i8* %3)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int unlink(char const *);
int removePidFile(const char *filename) { return unlink(filename); }


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

x86 assembly (clang, -O2):
<removePidFile>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @removePidFile(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ xorr_sse2(scalar_t__ *, scalar_t__ const *, size_t);
void maddrc2_sse2(uint8_t *region1, const uint8_t *region2, uint8_t constant,
                  size_t length) {
  if (constant != 0)
    xorr_sse2(region1, region2, length);
}


x86 assembly (clang, -O0):
<maddrc2_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1144 <maddrc2_sse2+0x34>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <xorr_sse2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maddrc2_sse2>:
test   %rdx,%rdx
je     111d <maddrc2_sse2+0xd>
mov    %rcx,%rdx
jmp    1030 <xorr_sse2@plt>
ret

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

LLVM IR (-O2):
define void @maddrc2_sse2(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @xorr_sse2(i64* %0, i64* %1, i64 %3)
br label %8
8: ; preds = %6, %4
ret void
}
void RAWToRGB24Row_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @RAWToRGB24Row_SSSE3() {
ret void
}
int fun437() { return 437; }


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

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

LLVM IR (-O0):
define i32 @fun437() {
ret i32 437
}

LLVM IR (-O2):
define i32 @fun437() {
ret i32 437
}
/* Variables and functions */
int /*<<< orphan*/ find(int *, int, int *, int *);
int test_two_elements() {
  int one = 0;
  int two = 0;
  int array[] = {2, 3};
  find(array, 2, &one, &two);
  return 3 == one && 2 == two;
}


x86 assembly (clang, -O0):
<test_two_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x2,%esi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1030 <find@plt>
xor    %eax,%eax
mov    $0x3,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    1168 <test_two_elements+0x58>
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_two_elements>:
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movabs $0x300000002,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    $0x2,%esi
call   1030 <find@plt>
mov    0xc(%rsp),%ecx
xor    $0x3,%ecx
mov    0x8(%rsp),%edx
xor    $0x2,%edx
xor    %eax,%eax
or     %ecx,%edx
sete   %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_two_elements.array = [2 x i32] [i32 2, i32 3]
define i32 @test_two_elements() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i32 @find(i32* %5, i32 2, i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = icmp eq i32 3, %7
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 2, %10
br label %12
12: ; preds = %9, %0
%13 = phi i1 [ false, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_two_elements() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i64* %3 to i8*
store i64 12884901890, i64* %3
%7 = bitcast i64* %3 to i32*
%8 = call i32 @find(i32* %7, i32 2, i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 3
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 2
%13 = select i1 %10, i1 %12, i1 false
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ clock();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basTicks() { pushNumber(clock()); }


x86 assembly (clang, -O0):
<basTicks>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basTicks>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basTicks() {
%1 = call i32 (...) @clock()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basTicks() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int strftime(char *, int, char *, struct tm *);
void get_time(struct tm *tval, char *ret) {
  int index = strftime(ret, 128, "%C%y-%m-%eT%TZ GMT %z", tval);
  ret[index] = '\0';
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x80,%esi
lea    0xecc(%rip),%rdx
call   1030 <strftime@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xee2(%rip),%rdx
mov    %rsi,%rdi
mov    $0x80,%esi
call   1030 <strftime@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [22 x i8] c"%C%y-%m-%eT%TZ GMT %z\00"
define void @get_time(%struct.tm* %0, i8* %1) {
%3 = alloca %struct.tm*
%4 = alloca i8*
%5 = alloca i32
store %struct.tm* %0, %struct.tm** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load %struct.tm*, %struct.tm** %3
%8 = call i32 @strftime(i8* %6, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [22 x i8] c"%C%y-%m-%eT%TZ GMT %z\00"
define void @get_time(%struct.tm* %0, i8* %1) {
%3 = tail call i32 @strftime(i8* %1, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %struct.tm* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int execv(char *, char **);
int main(int argc, char *argv[]) {
  return execv("/usr/lib/vdr/xbmc-vdr-shutdown", argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <execv@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"/usr/lib/vdr/xbmc-vdr-shutdown\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 = load i8**, i8*** %5
%7 = call i32 @execv(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [31 x i8] c"/usr/lib/vdr/xbmc-vdr-shutdown\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @execv(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 %3
}
/* Type definitions */
struct Sysstruct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ retcont(struct Sysstruct *, int /*<<< orphan*/);
void retloop(struct Sysstruct *syss) {
  retcont(syss, 0);
  return;
}


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

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

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

LLVM IR (-O2):
%struct.Sysstruct = type { i32 }
define void @retloop(%struct.Sysstruct* %0) {
%2 = tail call i32 @retcont(%struct.Sysstruct* %0, i32 0)
ret void
}
void null_scene_pause() {}


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

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

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

LLVM IR (-O2):
define void @null_scene_pause() {
ret void
}
void delegate_signal(int sig) { ; }


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

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

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

LLVM IR (-O2):
define void @delegate_signal(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  printf("\tHow are you doing?");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [20 x i8] c"\09How are you doing?\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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"\09How are you doing?\00"
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char tolower(char);
void strtolower(char *ch) {
  for (; *ch; ch++)
    *ch = tolower(*ch);
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strtolower+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strtolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strtolower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strtolower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strtolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int __udivmodsi4(int, int, int /*<<< orphan*/);
signed int __divsi3(signed int num, signed int den) {
  signed int minus = 0;
  signed int v;
  if (num < 0) {
    num = -num;
    minus = 1;
  }
  if (den < 0) {
    den = -den;
    minus ^= 1;
  }
  v = __udivmodsi4(num, den, 0);
  if (minus)
    v = -v;
  return v;
}


x86 assembly (clang, -O0):
<__divsi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113e <__divsi3+0x2e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1159 <__divsi3+0x49>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
xor    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <__udivmodsi4@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     117b <__divsi3+0x6b>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__divsi3>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
neg    %edi
cmovs  %ebx,%edi
mov    %esi,%ebp
neg    %esi
cmovs  %ebp,%esi
xor    %edx,%edx
call   1030 <__udivmodsi4@plt>
mov    %eax,%ecx
neg    %ecx
xor    %ebx,%ebp
cmovs  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__divsi3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %3
%11 = sub nsw i32 0, %10
store i32 %11, i32* %3
store i32 1, i32* %5
br label %12
12: ; preds = %9, %2
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i32, i32* %4
%17 = sub nsw i32 0, %16
store i32 %17, i32* %4
%18 = load i32, i32* %5
%19 = xor i32 %18, 1
store i32 %19, i32* %5
br label %20
20: ; preds = %15, %12
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = call i32 @__udivmodsi4(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %6
%24 = load i32, i32* %5
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %20
%27 = load i32, i32* %6
%28 = sub nsw i32 0, %27
store i32 %28, i32* %6
br label %29
29: ; preds = %26, %20
%30 = load i32, i32* %6
ret i32 %30
}

LLVM IR (-O2):
define i32 @__divsi3(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%5 = xor i32 %1, %0
%6 = tail call i32 @__udivmodsi4(i32 %3, i32 %4, i32 0)
%7 = icmp sgt i32 %5, -1
%8 = sub nsw i32 0, %6
%9 = select i1 %7, i32 %6, i32 %8
ret i32 %9
}
/* Type definitions */
struct boolean_vector {
  int dummy;
};

/* Variables and functions */
int _setstate(struct boolean_vector *, int, int);
bool _set(struct boolean_vector *pi, int vnum) {
  return _setstate(pi, vnum, true);
}


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

x86 assembly (clang, -O2):
<_set>:
mov    $0x1,%edx
jmp    1030 <_setstate@plt>

LLVM IR (-O0):
%struct.boolean_vector = type { i32 }
define i32 @_set(%struct.boolean_vector* %0, i32 %1) {
%3 = alloca %struct.boolean_vector*
%4 = alloca i32
store %struct.boolean_vector* %0, %struct.boolean_vector** %3
store i32 %1, i32* %4
%5 = load %struct.boolean_vector*, %struct.boolean_vector** %3
%6 = load i32, i32* %4
%7 = call i32 @_setstate(%struct.boolean_vector* %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.boolean_vector = type { i32 }
define i32 @_set(%struct.boolean_vector* %0, i32 %1) {
%3 = tail call i32 @_setstate(%struct.boolean_vector* %0, i32 %1, i32 1)
ret i32 %3
}
int vsd_init() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @vsd_init() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ log_write(char *, int /*<<< orphan*/);
int log_info(char *msg) { log_write(msg, 0); }


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

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

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

LLVM IR (-O2):
define i32 @log_info(i8* %0) {
%2 = tail call i32 @log_write(i8* %0, i32 0)
ret i32 undef
}
int ath9k_hw_ar9300_get_eeprom_rev(struct ath_hw *ah) { return 0; }


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

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

LLVM IR (-O0):
%struct.ath_hw = type opaque
define i32 @ath9k_hw_ar9300_get_eeprom_rev(%struct.ath_hw* %0) {
%2 = alloca %struct.ath_hw*
store %struct.ath_hw* %0, %struct.ath_hw** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ath_hw = type opaque
define i32 @ath9k_hw_ar9300_get_eeprom_rev(%struct.ath_hw* nocapture readnone %0) {
ret i32 0
}
int test_imm_1Cint8_reg(signed char val) {
  return ((val) & (0x1C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Cint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x1c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Cint8_reg>:
test   $0x1c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Cint8_reg(i8 signext %0) {
%2 = and i8 %0, 28
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_layout_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_layout_get_type() {
ret void
}
int foo(int a __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 undef
}