xunge/DecIR huggingface dataset:
/* Variables and functions */
int atoi(char const *);
int getNumArg(const char *s) {
  for (; *s != '\0'; s++)
    if (('0' <= (*s) && (*s) <= '9'))
      return atoi(s);
  return 0;
}


x86 assembly (clang, -O0):
<getNumArg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1177 <getNumArg+0x67>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1161 <getNumArg+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1161 <getNumArg+0x51>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    117e <getNumArg+0x6e>
jmp    1166 <getNumArg+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <getNumArg+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumArg>:
mov    (%rdi),%al
test   %al,%al
je     1132 <getNumArg+0x22>
cs nopw 0x0(%rax,%rax,1)
add    $0xd0,%al
cmp    $0x9,%al
jbe    1135 <getNumArg+0x25>
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1120 <getNumArg+0x10>
xor    %eax,%eax
ret
jmp    1030 <atoi@plt>

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

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

/* Variables and functions */
int setrlimit(int, struct rlimit const *);
__attribute__((__weak__, __always___)) int
softboundcets_setrlimit(int resource, const struct rlimit *rlim) {
  return setrlimit(resource, rlim);
}


x86 assembly (clang, -O0):
<softboundcets_setrlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <setrlimit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_setrlimit>:
jmp    1030 <setrlimit@plt>

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

LLVM IR (-O2):
%struct.rlimit = type { i32 }
define weak i32 @softboundcets_setrlimit(i32 %0, %struct.rlimit* %1) {
%3 = tail call i32 @setrlimit(i32 %0, %struct.rlimit* %1)
ret i32 %3
}
void ASN1_STRING_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_free() {
ret void
}
int isspace(int c) {
  return c == ' ' || c == '\n' || c == '\t' || c == '\f' || c == '\r' ||
         c == '\v';
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 10
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 9
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 12
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 13
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 11
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int);
void obex_Sleep(unsigned int seconds) {
  sleep(seconds);
  return;
}


x86 assembly (clang, -O0):
<obex_Sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obex_Sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @obex_Sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isdigit(int);
void t_isdigit_0x37() {
  Assert_real((isdigit(55)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              280, ("isdigit should be 1 for 7"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x37>:
push   %rbp
mov    %rsp,%rbp
mov    $0x37,%edi
call   1030 <isdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x118,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x37>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x118,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 7\00"
define void @t_isdigit_0x37() {
%1 = call i32 @isdigit(i32 55)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 7\00"
define void @t_isdigit_0x37() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 2;
  switch (i) {
  case 2:
    printf("2\n");
    break;
  case 3:
    printf("3\n");
    break;
  case 4:
    printf("4\n");
    break;
  case 5:
    printf("5\n");
    break;
  case 10:
    printf("10\n");
    break;
  default:
    printf("default\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x8,%eax
ja     11a4 <main+0x94>
mov    -0x10(%rbp),%rax
lea    0xeba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0xa0>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0xa0>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0xa0>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0xa0>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0xa0>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [2 x i8] c"2\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_65uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x65 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_65uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x65,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_65uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 101
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_42uint8_mem(unsigned char *val) {
  return ((*val) & (-0x42 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_42uint8_mem>:
testb  $0xbe,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_42uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -66
%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_42uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -66
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *reallocatePages(int, int);
void *allocatePages(int cantPages) { return reallocatePages(-1, cantPages); }


x86 assembly (clang, -O0):
<allocatePages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xffffffff,%edi
call   1030 <reallocatePages@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocatePages>:
mov    %edi,%esi
mov    $0xffffffff,%edi
jmp    1030 <reallocatePages@plt>

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

LLVM IR (-O2):
define i8* @allocatePages(i32 %0) {
%2 = tail call i8* @reallocatePages(i32 -1, i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ CheckTxFifoStable();
int /*<<< orphan*/ DisableInterrupts();
int /*<<< orphan*/ EnableInterrupts();
int /*<<< orphan*/ EnableTMDS();
int /*<<< orphan*/ TxPowerStateD0();
void HotPlugService(void) {
  DisableInterrupts();
  EnableTMDS();
  TxPowerStateD0();
  EnableInterrupts();
  CheckTxFifoStable();
}


x86 assembly (clang, -O0):
<HotPlugService>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <DisableInterrupts@plt>
mov    $0x0,%al
call   1030 <EnableTMDS@plt>
mov    $0x0,%al
call   1060 <TxPowerStateD0@plt>
mov    $0x0,%al
call   1050 <EnableInterrupts@plt>
mov    $0x0,%al
call   1070 <CheckTxFifoStable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HotPlugService>:
push   %rax
xor    %eax,%eax
call   1040 <DisableInterrupts@plt>
xor    %eax,%eax
call   1030 <EnableTMDS@plt>
xor    %eax,%eax
call   1060 <TxPowerStateD0@plt>
xor    %eax,%eax
call   1050 <EnableInterrupts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <CheckTxFifoStable@plt>

LLVM IR (-O0):
define void @HotPlugService() {
%1 = call i32 (...) @DisableInterrupts()
%2 = call i32 (...) @EnableTMDS()
%3 = call i32 (...) @TxPowerStateD0()
%4 = call i32 (...) @EnableInterrupts()
%5 = call i32 (...) @CheckTxFifoStable()
ret void
}

LLVM IR (-O2):
define void @HotPlugService() {
%1 = tail call i32 (...) @DisableInterrupts()
%2 = tail call i32 (...) @EnableTMDS()
%3 = tail call i32 (...) @TxPowerStateD0()
%4 = tail call i32 (...) @EnableInterrupts()
%5 = tail call i32 (...) @CheckTxFifoStable()
ret void
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_give_tuner_device_status(const struct cec_msg *msg,
                                      __u8 *status_req) {
  *status_req = msg->msg[2];
}


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

x86 assembly (clang, -O2):
<cec_ops_give_tuner_device_status>:
mov    (%rdi),%rax
mov    0x8(%rax),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_give_tuner_device_status(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_give_tuner_device_status(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int str_match(char *, char *);
char *strupper(int /*<<< orphan*/);
int /*<<< orphan*/ xfree(char *);
int /*<<< orphan*/ xstrdup(char const *);
int case_ignore_str_match(const char *str, const char *match) {
  char *s1, *s2;
  int res;
  s1 = strupper(xstrdup(str));
  s2 = strupper(xstrdup(match));
  res = str_match(s1, s2);
  xfree(s1);
  xfree(s2);
  return res;
}


x86 assembly (clang, -O0):
<case_ignore_str_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xstrdup@plt>
mov    %eax,%edi
call   1050 <strupper@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <xstrdup@plt>
mov    %eax,%edi
call   1050 <strupper@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <str_match@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <xfree@plt>
mov    -0x20(%rbp),%rdi
call   1030 <xfree@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<case_ignore_str_match>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <xstrdup@plt>
mov    %eax,%edi
call   1050 <strupper@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <xstrdup@plt>
mov    %eax,%edi
call   1050 <strupper@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1060 <str_match@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <xfree@plt>
mov    %rbx,%rdi
call   1030 <xfree@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @case_ignore_str_match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @xstrdup(i8* %8)
%10 = call i8* @strupper(i32 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %4
%12 = call i32 @xstrdup(i8* %11)
%13 = call i8* @strupper(i32 %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = call i32 @str_match(i8* %14, i8* %15)
store i32 %16, i32* %7
%17 = load i8*, i8** %5
%18 = call i32 @xfree(i8* %17)
%19 = load i8*, i8** %6
%20 = call i32 @xfree(i8* %19)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @case_ignore_str_match(i8* %0, i8* %1) {
%3 = tail call i32 @xstrdup(i8* %0)
%4 = tail call i8* @strupper(i32 %3)
%5 = tail call i32 @xstrdup(i8* %1)
%6 = tail call i8* @strupper(i32 %5)
%7 = tail call i32 @str_match(i8* %4, i8* %6)
%8 = tail call i32 @xfree(i8* %4)
%9 = tail call i32 @xfree(i8* %6)
ret i32 %7
}
void foo012(int p) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void int_print(int64_t val) { printf("%ld", val); }


x86 assembly (clang, -O0):
<int_print>:
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):
<int_print>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @int_print(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int isprint(int c) { return (c >= 32 && c <= 126); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Howdy, git!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Howdy, git!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Howdy, git!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void mdp4_dtv_overlay_blt_start(struct msm_fb_data_type *mfd) { return; }


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
define void @mdp4_dtv_overlay_blt_start(%struct.msm_fb_data_type* nocapture %0) {
ret void
}
/* Type definitions */
struct XMLDBbuffer {
  int dummy;
};

/* Variables and functions */
int XMLDBAddBuffer(struct XMLDBbuffer *, char *, int);
int EntityBuffer(char *buf, int sze, void *data) {
  struct XMLDBbuffer *dst = NULL;
  dst = (struct XMLDBbuffer *)data;
  if (dst == NULL)
    return -1;
  return XMLDBAddBuffer(dst, buf, sze);
}


x86 assembly (clang, -O0):
<EntityBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    114a <EntityBuffer+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <EntityBuffer+0x4d>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <XMLDBAddBuffer@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EntityBuffer>:
test   %rdx,%rdx
je     1124 <EntityBuffer+0x14>
mov    %esi,%eax
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    %eax,%edx
jmp    1030 <XMLDBAddBuffer@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.XMLDBbuffer = type { i32 }
define i32 @EntityBuffer(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.XMLDBbuffer*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store %struct.XMLDBbuffer* null, %struct.XMLDBbuffer** %8
%9 = load i8*, i8** %7
%10 = bitcast i8* %9 to %struct.XMLDBbuffer*
store %struct.XMLDBbuffer* %10, %struct.XMLDBbuffer** %8
%11 = load %struct.XMLDBbuffer*, %struct.XMLDBbuffer** %8
%12 = icmp eq %struct.XMLDBbuffer* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 -1, i32* %4
br label %19
14: ; preds = %3
%15 = load %struct.XMLDBbuffer*, %struct.XMLDBbuffer** %8
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = call i32 @XMLDBAddBuffer(%struct.XMLDBbuffer* %15, i8* %16, i32 %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.XMLDBbuffer = type { i32 }
define i32 @EntityBuffer(i8* %0, i32 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = bitcast i8* %2 to %struct.XMLDBbuffer*
%7 = tail call i32 @XMLDBAddBuffer(%struct.XMLDBbuffer* %6, i8* %0, i32 %1)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ -1, %3 ]
ret i32 %9
}
char *strchrR(char *s, int c) {
  char *fs;
  for (fs = 0;; ++s) {
    if (*s == c)
      fs = s;
    if (!*s)
      return fs;
  }
}


x86 assembly (clang, -O0):
<strchrR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    112b <strchrR+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113e <strchrR+0x3e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret
jmp    1143 <strchrR+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strchrR+0x13>

x86 assembly (clang, -O2):
<strchrR>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <strchrR+0x10>
ret

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

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

/* Variables and functions */
float conv_f32(unsigned long x) {
  union {
    uint32_t i;
    float f;
  } conv;
  conv.i = x;
  return conv.f;
}


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

x86 assembly (clang, -O2):
<conv_f32>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define float @conv_f32(i64 %0) {
%2 = alloca i64
%3 = alloca %union.anon
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = bitcast %union.anon* %3 to i64*
store i64 %4, i64* %5
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @conv_f32(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = bitcast i32 %2 to float
ret float %3
}
/* Variables and functions */
char *sn_nsdl_get_version(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @sn_nsdl_get_version() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sn_nsdl_get_version() {
ret i8* null
}
unsigned long CheckButton(void) { return (0); }


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

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

LLVM IR (-O0):
define i64 @CheckButton() {
ret i64 0
}

LLVM IR (-O2):
define i64 @CheckButton() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ ioclose(int /*<<< orphan*/, void *);
void *stderr;
void *stdin;
void *stdout;
void iodestroy(void *f) {
  if (f != stdin && f != stdout && f != stderr)
    ioclose(0, f);
}


x86 assembly (clang, -O0):
<iodestroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ec1(%rip),%rcx
cmp    (%rcx),%rax
je     1163 <iodestroy+0x53>
mov    -0x8(%rbp),%rax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%rax
je     1163 <iodestroy+0x53>
mov    -0x8(%rbp),%rax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
je     1163 <iodestroy+0x53>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <ioclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iodestroy>:
mov    0x2ed1(%rip),%rax
cmp    %rdi,(%rax)
je     113e <iodestroy+0x2e>
mov    %rdi,%rsi
mov    0x2eaa(%rip),%rax
cmp    %rdi,(%rax)
je     113e <iodestroy+0x2e>
mov    0x2ea6(%rip),%rax
cmp    %rsi,(%rax)
je     113e <iodestroy+0x2e>
xor    %edi,%edi
jmp    1030 <ioclose@plt>
ret

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

LLVM IR (-O2):
@stdin = global i8* null
@stdout = global i8* null
@stderr = global i8* null
define void @iodestroy(i8* %0) {
%2 = load i8*, i8** @stdin
%3 = icmp eq i8* %2, %0
%4 = load i8*, i8** @stdout
%5 = icmp eq i8* %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = load i8*, i8** @stderr
%8 = icmp eq i8* %7, %0
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = tail call i32 @ioclose(i32 0, i8* %0)
br label %12
12: ; preds = %10, %1
ret void
}
/* Variables and functions */
int _netdb(char *);
int main(int argc, char *argv[]) {
  int ret = 0;
  (void)argc;
  ret |= _netdb(argv[0]);
  return (ret == 0) ? 0 : 2;
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <_netdb@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1030 <_netdb@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @_netdb(i8* %10)
%12 = load i32, i32* %6
%13 = or i32 %12, %11
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 2
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @_netdb(i8* %3)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 0, i32 2
ret i32 %6
}
void AD_PowerUp() {}


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

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

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

LLVM IR (-O2):
define void @AD_PowerUp() {
ret void
}
/* Variables and functions */
int cvmx_helper_get_ipd_port(int, int /*<<< orphan*/);
int cvmx_helper_get_first_ipd_port(int interface) {
  return cvmx_helper_get_ipd_port(interface, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @cvmx_helper_get_first_ipd_port(i32 %0) {
%2 = tail call i32 @cvmx_helper_get_ipd_port(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mprintf(char *);
void m_term_clear() { mprintf("\033[2J\033[1;1H"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @m_term_clear() {
%1 = call i32 @mprintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @m_term_clear() {
%1 = tail call i32 @mprintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pmd_part {
  int dummy;
};
struct fmdriver_work {
  int dummy;
};
struct driver_pmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pmd_part_cmdload(struct driver_pmd *, struct pmd_part *);
void pmd_cmd_null_1(struct fmdriver_work *work, struct driver_pmd *pmd,
                    struct pmd_part *part) {
  (void)work;
  pmd_part_cmdload(pmd, part);
}


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

x86 assembly (clang, -O2):
<pmd_cmd_null_1>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <pmd_part_cmdload@plt>

LLVM IR (-O0):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmd_null_1(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = alloca %struct.fmdriver_work*
%5 = alloca %struct.driver_pmd*
%6 = alloca %struct.pmd_part*
store %struct.fmdriver_work* %0, %struct.fmdriver_work** %4
store %struct.driver_pmd* %1, %struct.driver_pmd** %5
store %struct.pmd_part* %2, %struct.pmd_part** %6
%7 = load %struct.fmdriver_work*, %struct.fmdriver_work** %4
%8 = load %struct.driver_pmd*, %struct.driver_pmd** %5
%9 = load %struct.pmd_part*, %struct.pmd_part** %6
%10 = call i32 @pmd_part_cmdload(%struct.driver_pmd* %8, %struct.pmd_part* %9)
ret void
}

LLVM IR (-O2):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmd_null_1(%struct.fmdriver_work* nocapture readnone %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = tail call i32 @pmd_part_cmdload(%struct.driver_pmd* %1, %struct.pmd_part* %2)
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t eq_int8_t(int8_t a, int8_t b) { return a == b; }


x86 assembly (clang, -O0):
<eq_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_int8_t>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @eq_int8_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @eq_int8_t(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float ceil(float);
float floor(float);
__attribute__((always_)) __attribute__((const)) float roundf(float x) {
  return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5);
}


x86 assembly (clang, -O0):
<roundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1166 <roundf+0x46>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <floor@plt>
movss  %xmm0,-0x8(%rbp)
jmp    1189 <roundf+0x69>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe89(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <ceil@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundf>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1135 <roundf+0x15>
addss  0xed4(%rip),%xmm0
jmp    1030 <floorf@plt>
addss  0xec3(%rip),%xmm0
jmp    1040 <ceilf@plt>

LLVM IR (-O0):
define float @roundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fadd double %7, 5.000000e-01
%9 = fptrunc double %8 to float
%10 = call float @floor(float %9)
br label %17
11: ; preds = %1
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fsub double %13, 5.000000e-01
%15 = fptrunc double %14 to float
%16 = call float @ceil(float %15)
br label %17
17: ; preds = %11, %5
%18 = phi float [ %10, %5 ], [ %16, %11 ]
ret float %18
}

LLVM IR (-O2):
define float @roundf(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd float %0, 5.000000e-01
%5 = tail call float @llvm.floor.f32(float %4)
br label %9
6: ; preds = %1
%7 = fadd float %0, -5.000000e-01
%8 = tail call float @llvm.ceil.f32(float %7)
br label %9
9: ; preds = %6, %3
%10 = phi float [ %5, %3 ], [ %8, %6 ]
ret float %10
}
void func8(s) int s;
{}


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

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

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

LLVM IR (-O2):
define void @func8(i32 %0) {
ret void
}
const char *worker_device_string(int device_type) {
  static const char *strings[] = {"CUBIEBOARD", "SAMA5D3"};
  return strings[device_type];
}


x86 assembly (clang, -O0):
<worker_device_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f1e(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker_device_string>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@worker_device_string.strings = internal global [2 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)]
@.str = [11 x i8] c"CUBIEBOARD\00"
@.str.1 = [8 x i8] c"SAMA5D3\00"
define i8* @worker_device_string(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* @worker_device_string.strings, i64 0, i64 %4
%6 = load i8*, i8** %5
ret i8* %6
}

LLVM IR (-O2):
@reltable.worker_device_string = internal unnamed_addr constant [2 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str to i64), i64 ptrtoint ([2 x i32]* @reltable.worker_device_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([2 x i32]* @reltable.worker_device_string to i64)) to i32)]
@.str = [11 x i8] c"CUBIEBOARD\00"
@.str.1 = [8 x i8] c"SAMA5D3\00"
define i8* @worker_device_string(i32 %0) {
%2 = sext i32 %0 to i64
%3 = shl i64 %2, 2
%4 = call i8* @llvm.load.relative.i64(i8* bitcast ([2 x i32]* @reltable.worker_device_string to i8*), i64 %3)
ret i8* %4
}
void av_get_sample_fmt() {}


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

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

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

LLVM IR (-O2):
define void @av_get_sample_fmt() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void ll_puts(int8_t *s) { puts((char *)s); }


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

x86 assembly (clang, -O2):
<ll_puts>:
jmp    1030 <puts@plt>

LLVM IR (-O0):
define void @ll_puts(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
define void @ll_puts(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
int __bsd_iconvctl(int /*<<< orphan*/, int, void *);
int iconvctl_compat(iconv_t a, int b, void *c) {
  return __bsd_iconvctl(a, b, c);
}


x86 assembly (clang, -O0):
<iconvctl_compat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <__bsd_iconvctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iconvctl_compat>:
jmp    1030 <__bsd_iconvctl@plt>

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

LLVM IR (-O2):
define i32 @iconvctl_compat(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @__bsd_iconvctl(i32 %0, i32 %1, i8* %2)
ret i32 %4
}
_Bool Int__LT_(int x, int y) { return x < y; }


x86 assembly (clang, -O0):
<Int__LT_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int__LT_>:
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define zeroext i1 @Int__LT_(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @Int__LT_(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
ret i1 %3
}
/* Variables and functions */
float saturate(float);
float CalcWaterFogAlpha(const float flWaterZ, const float flEyePosZ,
                        const float flWorldPosZ, const float flProjPosZ,
                        const float flFogOORange) {
  float flDepthFromWater = flWaterZ - flWorldPosZ;
  float flDepthFromEye = flEyePosZ - flWorldPosZ;
  float f = (flDepthFromWater / flDepthFromEye) * flProjPosZ;
  return saturate(f * flFogOORange);
}


x86 assembly (clang, -O0):
<CalcWaterFogAlpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
divss  -0x1c(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
call   1030 <saturate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcWaterFogAlpha>:
subss  %xmm2,%xmm0
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
mulss  %xmm3,%xmm0
mulss  %xmm4,%xmm0
jmp    1030 <saturate@plt>

LLVM IR (-O0):
define float @CalcWaterFogAlpha(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%14 = load float, float* %6
%15 = load float, float* %8
%16 = fsub float %14, %15
store float %16, float* %11
%17 = load float, float* %7
%18 = load float, float* %8
%19 = fsub float %17, %18
store float %19, float* %12
%20 = load float, float* %11
%21 = load float, float* %12
%22 = fdiv float %20, %21
%23 = load float, float* %9
%24 = fmul float %22, %23
store float %24, float* %13
%25 = load float, float* %13
%26 = load float, float* %10
%27 = fmul float %25, %26
%28 = call float @saturate(float %27)
ret float %28
}

LLVM IR (-O2):
define float @CalcWaterFogAlpha(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %0, %2
%7 = fsub float %1, %2
%8 = fdiv float %6, %7
%9 = fmul float %8, %3
%10 = fmul float %9, %4
%11 = tail call float @saturate(float %10)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ f();
main() {
  int x;
  1;
  f();
  5 - 2;
  x;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}