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

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ logError(char *, char const *);
int checkEOF(FILE *fp, const char *dbgText) {
  if (feof(fp)) {
    logError("[IDTF] Unexpected end of file (%s)", dbgText);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkEOF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%rax
je     115f <checkEOF+0x3f>
mov    -0x18(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <logError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <checkEOF+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkEOF>:
push   %rbx
mov    %rsi,%rbx
call   1040 <feof@plt>
test   %rax,%rax
je     1144 <checkEOF+0x24>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <logError@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"[IDTF] Unexpected end of file (%s)\00"
define i32 @checkEOF(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%6 = load i32*, i32** %4
%7 = call i64 @feof(i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = call i32 @logError(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [35 x i8] c"[IDTF] Unexpected end of file (%s)\00"
define i32 @checkEOF(i32* nocapture %0, i8* %1) {
%3 = tail call i64 @feof(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @logError(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ compass_assert_(char *, char *, int);
void _compass_dlclose(void *h) {
  ((void)((h != h) ||
          (compass_assert_(
               "h != h",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/bcamath-ds/compass/refs/"
               "heads/master/src/env/dlsup.c",
               156),
           1)));
  return;
}


x86 assembly (clang, -O0):
<_compass_dlclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmp    -0x8(%rbp),%rcx
mov    %al,-0x9(%rbp)
jne    114c <_compass_dlclose+0x3c>
lea    0xeca(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x9c,%edx
call   1030 <compass_assert_@plt>
mov    $0x1,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_compass_dlclose>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x9c,%edx
jmp    1030 <compass_assert_@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"h != h\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bcamath-ds/compass/refs/heads/master/src/env/dlsup.c\00"
define void @_compass_dlclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %3, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @compass_assert_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 156)
br label %8
8: ; preds = %6, %1
%9 = phi i1 [ true, %1 ], [ true, %6 ]
%10 = zext i1 %9 to i32
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"h != h\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bcamath-ds/compass/refs/heads/master/src/env/dlsup.c\00"
define void @_compass_dlclose(i8* nocapture readnone %0) {
%2 = tail call i32 @compass_assert_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 156)
ret void
}
void os_arg_fixup(int *argcp, char ***argvp) { return; }


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

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

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

LLVM IR (-O2):
define void @os_arg_fixup(i32* nocapture %0, i8*** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts(argv[0]);
  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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @puts(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
int pre(int x) { return (x - 1); }


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

x86 assembly (clang, -O2):
<pre>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @pre(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ __stdfix_sat_ur(scalar_t__);
uint32_t __stdfix_ssub_ur(uint32_t x, uint32_t y) {
  return (__stdfix_sat_ur((uint32_t)x - (uint32_t)y));
}


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

x86 assembly (clang, -O2):
<__stdfix_ssub_ur>:
sub    %rsi,%rdi
jmp    1030 <__stdfix_sat_ur@plt>

LLVM IR (-O0):
define i64 @__stdfix_ssub_ur(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = call i64 @__stdfix_sat_ur(i64 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @__stdfix_ssub_ur(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = tail call i64 @__stdfix_sat_ur(i64 %3)
ret i64 %4
}
long shortestCuboidPathSq(long c, long b, long a) {
  return (a + b) * (a + b) + c * c;
}


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

x86 assembly (clang, -O2):
<shortestCuboidPathSq>:
lea    (%rsi,%rdx,1),%rax
imul   %rax,%rax
imul   %rdi,%rdi
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @shortestCuboidPathSq(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %5
%9 = add nsw i64 %7, %8
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = add nsw i64 %10, %11
%13 = mul nsw i64 %9, %12
%14 = load i64, i64* %4
%15 = load i64, i64* %4
%16 = mul nsw i64 %14, %15
%17 = add nsw i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @shortestCuboidPathSq(i64 %0, i64 %1, i64 %2) {
%4 = add nsw i64 %2, %1
%5 = mul nsw i64 %4, %4
%6 = mul nsw i64 %0, %0
%7 = add nuw nsw i64 %5, %6
ret i64 %7
}
int do_813() { return 813; }


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

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

LLVM IR (-O0):
define i32 @do_813() {
ret i32 813
}

LLVM IR (-O2):
define i32 @do_813() {
ret i32 813
}
/* Type definitions */
typedef size_t uint8_t;
typedef size_t uint32_t;

/* Variables and functions */
uint32_t schema_rt_search8(const uint8_t *tab, uint32_t k, size_t n) {
  uint32_t i = 0;
  while (i != n - 1 && tab[i] != k)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<schema_rt_search8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x21(%rbp)
je     1148 <schema_rt_search8+0x48>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x10(%rbp),%rax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1158 <schema_rt_search8+0x58>
jmp    1169 <schema_rt_search8+0x69>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <schema_rt_search8+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<schema_rt_search8>:
xor    %eax,%eax
add    $0xffffffffffffffff,%rdx
je     1122 <schema_rt_search8+0x22>
nopl   0x0(%rax,%rax,1)
cmp    %rsi,(%rdi,%rax,8)
je     1122 <schema_rt_search8+0x22>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <schema_rt_search8+0x10>
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @schema_rt_search8(i64* nocapture %0, i64 %1, i64 %2) {
%4 = add i64 %2, -1
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %11
%7 = phi i64 [ %12, %11 ], [ 0, %3 ]
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, %1
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw i64 %7, 1
%13 = icmp eq i64 %12, %4
br i1 %13, label %14, label %6
14: ; preds = %6, %11, %3
%15 = phi i64 [ 0, %3 ], [ %4, %11 ], [ %7, %6 ]
ret i64 %15
}
unsigned short _farpeekw(unsigned short selector, unsigned long offset) {
  unsigned short result;
  __asm__ __volatile__("movw %w1, %%fs \n"
                       "	.byte 0x64 \n"
                       "	movw (%k2),%w0 \n"
                       : "=r"(result)
                       : "rm"(selector), "r"(offset));
  return result;
}


x86 assembly (clang, -O0):
<_farpeekw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,-0x14(%rbp)
mov    -0x14(%rbp),%fs
mov    %fs:(%eax),%ax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_farpeekw>:
mov    %di,-0x2(%rsp)
mov    -0x2(%rsp),%fs
mov    %fs:(%esi),%ax
ret

LLVM IR (-O0):
define zeroext i16 @_farpeekw(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
%5 = alloca i16
store i16 %0, i16* %3
store i64 %1, i64* %4
%6 = load i16, i16* %3
%7 = load i64, i64* %4
%8 = call i16 asm sideeffect "movw ${1:w}, %fs \0A\09.byte 0x64 \0A\09movw (${2:k}),${0:w} \0A", "=r,rm,r,~{dirflag},~{fpsr},~{flags}"(i16 %6, i64 %7)
store i16 %8, i16* %5
%9 = load i16, i16* %5
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @_farpeekw(i16 zeroext %0, i64 %1) {
%3 = tail call i16 asm sideeffect "movw ${1:w}, %fs \0A\09.byte 0x64 \0A\09movw (${2:k}),${0:w} \0A", "=r,rm,r,~{dirflag},~{fpsr},~{flags}"(i16 %0, i64 %1)
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *mkdtemp(int /*<<< orphan*/);
int /*<<< orphan*/ strdup(char *);
const char *tmp_create() {
  char *path = mkdtemp(strdup("/tmp/orbs-XXXXXX"));
  assert(path);
  return path;
}


x86 assembly (clang, -O0):
<tmp_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1040 <mkdtemp@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmp_create>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1040 <mkdtemp@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"/tmp/orbs-XXXXXX\00"
define i8* @tmp_create() {
%1 = alloca i8*
%2 = call i32 @strdup(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i8* @mkdtemp(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @assert(i8* %4)
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"/tmp/orbs-XXXXXX\00"
define i8* @tmp_create() {
%1 = tail call i32 @strdup(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @mkdtemp(i32 %1)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main() {
#pragma omp parallel
  {
#pragma omp critical
    { printf("hello from thread %d\n", omp_get_thread_num()); }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"hello from thread %d\0A\00"
define i32 @main() {
%1 = call i32 (...) @omp_get_thread_num()
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"hello from thread %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int kill(int, int);
int /*<<< orphan*/ printf(char *, int);
void send_sig(int sig, int pid) {
  int r;
  printf("PARENT: sendign %d\n", sig);
  r = kill(pid, sig);
  if (r < 0)
    printf("sys_kill err: %d\n", r);
}


x86 assembly (clang, -O0):
<send_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <kill@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1164 <send_sig+0x44>
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_sig>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <kill@plt>
test   %eax,%eax
js     1149 <send_sig+0x29>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xec4(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"PARENT: sendign %d\0A\00"
@.str.1 = [18 x i8] c"sys_kill err: %d\0A\00"
define void @send_sig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @kill(i32 %8, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"PARENT: sendign %d\0A\00"
@.str.1 = [18 x i8] c"sys_kill err: %d\0A\00"
define void @send_sig(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @kill(i32 %1, i32 %0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
float mp_bswap_float(float);
float mp_decode_float(const char **data) {
  unsigned char c = (unsigned char)**data;
  assert(c == 0xca);
  (void)c;
  *data += 1;
  float val = mp_bswap_float(*(float *)*data);
  *data += sizeof(float);
  return val;
}


x86 assembly (clang, -O0):
<mp_decode_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0xca,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movss  (%rax),%xmm0
call   1030 <mp_bswap_float@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_decode_float>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
xor    %edi,%edi
cmpb   $0xca,(%rax)
sete   %dil
call   1040 <assert@plt>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movss  0x1(%rax),%xmm0
call   1030 <mp_bswap_float@plt>
addq   $0x4,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define float @mp_decode_float(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
%4 = alloca float
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 202
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8, i8* %3
%14 = load i8**, i8*** %2
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %14
%17 = load i8**, i8*** %2
%18 = load i8*, i8** %17
%19 = bitcast i8* %18 to float*
%20 = load float, float* %19
%21 = call float @mp_bswap_float(float %20)
store float %21, float* %4
%22 = load i8**, i8*** %2
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 4
store i8* %24, i8** %22
%25 = load float, float* %4
ret float %25
}

LLVM IR (-O2):
define float @mp_decode_float(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, -54
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = tail call float @mp_bswap_float(float %10)
%12 = load i8*, i8** %0
%13 = getelementptr inbounds i8, i8* %12, i64 4
store i8* %13, i8** %0
ret float %11
}
/* Variables and functions */
int glutGetWindow();
int /*<<< orphan*/ printf(char *, int, int);
void SampleEntry(int state) {
  int window = glutGetWindow();
  printf("Window %d Entry Callback: %d\n", window, state);
}


x86 assembly (clang, -O0):
<SampleEntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <glutGetWindow@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SampleEntry>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <glutGetWindow@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Window %d Entry Callback: %d\0A\00"
define void @SampleEntry(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @glutGetWindow()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Window %d Entry Callback: %d\0A\00"
define void @SampleEntry(i32 %0) {
%2 = tail call i32 (...) @glutGetWindow()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
ret void
}
/* Variables and functions */
float atan(float);
float _atan(float s) { return atan(s); }


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

x86 assembly (clang, -O2):
<_atan>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define float @_atan(float %0) {
%2 = tail call float @atan(float %0)
ret float %2
}
int test_imm_4Eint64_highword_reg(long long val) {
  return ((val >> 32) & (0x4E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Eint64_highword_reg>:
movabs $0x4e00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Eint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 78
%6 = icmp ne i64 %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_4Eint64_highword_reg(i64 %0) {
%2 = and i64 %0, 335007449088
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
bool ref_eq(const void *litem, const void *ritem) { return litem == ritem; }


x86 assembly (clang, -O0):
<ref_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_eq>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ref_eq(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct mm_array {
  int dummy;
};

/* Variables and functions */
struct mm_array *mm_array_new3(size_t, int /*<<< orphan*/,
                               int /*<<< orphan*/ *);
struct mm_array *mm_array_new(size_t element_size) {
  return mm_array_new3(element_size, 0, NULL);
}


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

x86 assembly (clang, -O2):
<mm_array_new>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <mm_array_new3@plt>

LLVM IR (-O0):
%struct.mm_array = type { i32 }
define %struct.mm_array* @mm_array_new(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call %struct.mm_array* @mm_array_new3(i64 %3, i32 0, i32* null)
ret %struct.mm_array* %4
}

LLVM IR (-O2):
%struct.mm_array = type { i32 }
define %struct.mm_array* @mm_array_new(i64 %0) {
%2 = tail call %struct.mm_array* @mm_array_new3(i64 %0, i32 0, i32* null)
ret %struct.mm_array* %2
}
/* Variables and functions */
int execv(char const *, char const **);
int execl(const char *path, const char *arg1, ...) {
  return execv(path, &arg1);
}


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

x86 assembly (clang, -O2):
<execl>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
call   1030 <execv@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execl(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @execv(i8* %5, i8** %4)
ret i32 %6
}

LLVM IR (-O2):
define i32 @execl(i8* %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 @execv(i8* %0, i8** %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int anexa(char *str, char c) {
  char tmp[2] = {c, '\0'};
  strcat(str, tmp);
  return 1;
}


x86 assembly (clang, -O0):
<anexa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1030 <strcat@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anexa>:
push   %rax
mov    %sil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rsi
call   1030 <strcat@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @anexa(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca [2 x i8]
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%7 = load i8, i8* %4
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = call i32 @strcat(i8* %9, i8* %10)
ret i32 1
}

LLVM IR (-O2):
define i32 @anexa(i8* %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %5
%6 = call i32 @strcat(i8* %0, i8* %4)
ret i32 1
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *dupstr(const char *s) {
  char *p = malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <dupstr+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <dupstr+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dupstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @dupstr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmapping_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xmapping.window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xmapping_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmapping_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
char getchar();
char ConsoleGetChar(void) { return getchar(); }


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

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

LLVM IR (-O0):
define signext i8 @ConsoleGetChar() {
%1 = call signext i8 (...) @getchar()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @ConsoleGetChar() {
%1 = tail call signext i8 (...) @getchar()
ret i8 %1
}
void ex3(void) {
  long __res, arg1 = 2, arg2 = 22, arg3 = 222, arg4 = 233;
  __asm__ __volatile__("int $0x80"
                       : "=a"(__res)
                       : "0"(11), "b"(arg1), "c"(arg2), "d"(arg3), "S"(arg4));
}


x86 assembly (clang, -O0):
<ex3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movq   $0x2,-0x18(%rbp)
movq   $0x16,-0x20(%rbp)
movq   $0xde,-0x28(%rbp)
movq   $0xe9,-0x30(%rbp)
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rsi
mov    $0xb,%eax
int    $0x80
mov    %rax,-0x10(%rbp)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex3>:
push   %rbx
mov    $0x2,%ebx
mov    $0x16,%ecx
mov    $0xde,%edx
mov    $0xe9,%esi
mov    $0xb,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define void @ex3() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 2, i64* %2
store i64 22, i64* %3
store i64 222, i64* %4
store i64 233, i64* %5
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i64 11, i64 %6, i64 %7, i64 %8, i64 %9)
store i64 %10, i64* %1
ret void
}

LLVM IR (-O2):
define void @ex3() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i64 11, i64 2, i64 22, i64 222, i64 233)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void QCC_freeSimpleValue(void *value) { free(value); }


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

x86 assembly (clang, -O2):
<QCC_freeSimpleValue>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @QCC_freeSimpleValue(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void QEIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT((ui32Base == 0x4002C000) || (ui32Base == 0x4002D000));
  (*((volatile uint32_t *)(ui32Base + 0x00000020))) &= ~(ui32IntFlags);
}


x86 assembly (clang, -O0):
<QEIIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x4002c000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113d <QEIIntDisable+0x2d>
cmpl   $0x4002d000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntDisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x4002c000,%eax
sete   %dil
call   1030 <ASSERT@plt>
not    %ebx
movslq %ebp,%rax
and    %ebx,0x20(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @QEIIntDisable(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 = icmp eq i32 %5, 1073922048
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073926144
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = xor i32 %14, -1
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 32
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = and i32 %20, %15
store volatile i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @QEIIntDisable(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073922048
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = xor i32 %1, -1
%8 = add nsw i32 %0, 32
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, %7
store volatile i32 %12, i32* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void howto(void) {
  printf("Uso:\n");
  printf("noDriver -a <gpio_phisycal_address> -o <max-offset>\n");
  printf("-a <gpio_phisycal_address>: indirizzo fisico del device GPIO\n");
  printf("\t-o <max-offset>: offsett dell'ultimo registro letto\n");
}


x86 assembly (clang, -O0):
<howto>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3a(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<howto>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Uso:\0A\00"
@.str.1 = [53 x i8] c"noDriver -a <gpio_phisycal_address> -o <max-offset>\0A\00"
@.str.2 = [62 x i8] c"-a <gpio_phisycal_address>: indirizzo fisico del device GPIO\0A\00"
@.str.3 = [54 x i8] c"\09-o <max-offset>: offsett dell'ultimo registro letto\0A\00"
define void @howto() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"Uso:\00"
@str.4 = [52 x i8] c"noDriver -a <gpio_phisycal_address> -o <max-offset>\00"
@str.5 = [61 x i8] c"-a <gpio_phisycal_address>: indirizzo fisico del device GPIO\00"
@str.6 = [53 x i8] c"\09-o <max-offset>: offsett dell'ultimo registro letto\00"
define void @howto() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.6, i64 0, i64 0))
ret void
}
extern void __outbc(unsigned char value, unsigned short port) {
  __asm__ __volatile__("out"
                       "b"
                       " %"
                       "b"
                       "0,%"
                       ""
                       "1"
                       :
                       : "a"(value), "id"(port));
}


x86 assembly (clang, -O0):
<__outbc>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outbc>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @__outbc(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outbc(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},$1", "{ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
ret void
}
int test_imm_6Eint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x6E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Eint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 110
%7 = icmp ne i64 %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_6Eint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 472446402560
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ff_hevc_put_hevc_uni_epel_h4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h4_12_sse4() {
ret void
}
int encryption_cleanup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @encryption_cleanup() {
ret i32 0
}
void pd_set_vconn(int port, int polarity, int enable) {}


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

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

LLVM IR (-O0):
define void @pd_set_vconn(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @pd_set_vconn(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
size_t cfw_strnlen(char const *, size_t);
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *cfw_strndup(const char *s, size_t max) {
  char *copy;
  size_t len;
  len = cfw_strnlen(s, max);
  if ((copy = malloc(len + 1)) == NULL)
    return NULL;
  memcpy(copy, s, len);
  copy[len] = 0;
  return copy;
}


x86 assembly (clang, -O0):
<cfw_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <cfw_strnlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1179 <cfw_strndup+0x49>
movq   $0x0,-0x8(%rbp)
jmp    119e <cfw_strndup+0x6e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfw_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <cfw_strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <cfw_strndup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @cfw_strndup(i8* %0, i64 %1) {
%3 = tail call i64 @cfw_strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %9
br label %10
10: ; preds = %2, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void PWMGenIntUnregister(unsigned long ulBase, unsigned long ulGen) {
  unsigned long ulInt;
  ;
  ;
  if (ulGen == 0x00000100) {
    ulInt = 61;
  } else {
    ulInt = 26 + (ulGen >> 6) - 1;
  }
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<PWMGenIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x100,-0x10(%rbp)
jne    114b <PWMGenIntUnregister+0x2b>
movq   $0x3d,-0x18(%rbp)
jmp    115f <PWMGenIntUnregister+0x3f>
mov    -0x10(%rbp),%rax
shr    $0x6,%rax
add    $0x1a,%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x18(%rbp),%rdi
call   1040 <IntUnregister@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenIntUnregister>:
push   %rbx
mov    %rsi,%rax
shr    $0x6,%rax
add    $0x19,%rax
cmp    $0x100,%rsi
mov    $0x3d,%ebx
cmovne %rax,%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @PWMGenIntUnregister(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 256
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 61, i64* %5
br label %14
9: ; preds = %2
%10 = load i64, i64* %4
%11 = lshr i64 %10, 6
%12 = add i64 26, %11
%13 = sub i64 %12, 1
store i64 %13, i64* %5
br label %14
14: ; preds = %9, %8
%15 = load i64, i64* %5
%16 = call i32 @IntDisable(i64 %15)
%17 = load i64, i64* %5
%18 = call i32 @IntUnregister(i64 %17)
ret void
}

LLVM IR (-O2):
define void @PWMGenIntUnregister(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 256
%4 = lshr i64 %1, 6
%5 = add nuw nsw i64 %4, 25
%6 = select i1 %3, i64 61, i64 %5
%7 = tail call i32 @IntDisable(i64 %6)
%8 = tail call i32 @IntUnregister(i64 %6)
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
int randomInteger(int begin, int end) {
  int random = begin + (int)((end - begin + 1.0) * (rand() / (RAND_MAX + 1.0)));
  return random;
}


x86 assembly (clang, -O0):
<randomInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x1c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xea7(%rip),%xmm2
mov    0x2e88(%rip),%rcx
addsd  (%rcx),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomInteger>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
sub    %edi,%esi
cvtsi2sd %esi,%xmm0
addsd  0xedb(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eaf(%rip),%rax
movsd  0xebf(%rip),%xmm1
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%eax
add    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @randomInteger(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 1.000000e+00
%12 = call double (...) @rand()
%13 = load double, double* @RAND_MAX
%14 = fadd double %13, 1.000000e+00
%15 = fdiv double %12, %14
%16 = fmul double %11, %15
%17 = fptosi double %16 to i32
%18 = add nsw i32 %6, %17
store i32 %18, i32* %5
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @randomInteger(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = tail call double (...) @rand()
%7 = load double, double* @RAND_MAX
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %6, %8
%10 = fmul double %5, %9
%11 = fptosi double %10 to i32
%12 = add nsw i32 %11, %0
ret i32 %12
}