xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help(void) {
  printf(
      "Usage: "
      "app"
      " [OPTIONS]\n"
      "app"
      " is just a template for a Linux console application in C with Auttotools"
      "and does actually nothing usefull.\n"
      "  -n, --number A sample integer value passed by the command line "
      "(default: 5, minimum: 0, maximum: 10).\n"
      "  -t, --text   A sample text passed by the command line. (default: "
      "\"Carsten\" )\n"
      "  -h, --help   Show this help and exit.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [355 x i8] c"Usage: app [OPTIONS]\0Aapp is just a template for a Linux console application in C with Auttotoolsand does actually nothing usefull.\0A -n, --number A sample integer value passed by the command line (default: 5, minimum: 0, maximum: 10).\0A -t, --text A sample text passed by the command line. (default: \22Carsten\22 )\0A -h, --help Show this help and exit.\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([355 x i8], [355 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [354 x i8] c"Usage: app [OPTIONS]\0Aapp is just a template for a Linux console application in C with Auttotoolsand does actually nothing usefull.\0A -n, --number A sample integer value passed by the command line (default: 5, minimum: 0, maximum: 10).\0A -t, --text A sample text passed by the command line. (default: \22Carsten\22 )\0A -h, --help Show this help and exit.\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([354 x i8], [354 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _flashoverride(void *, int, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_flashoverride(void *flashinfo, int get, int bank) {
  int ret;
  monLock();
  ret = _flashoverride(flashinfo, get, bank);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_flashoverride>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <_flashoverride@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_flashoverride>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <_flashoverride@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @mon_flashoverride(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @monLock()
%5 = tail call i32 @_flashoverride(i8* %0, i32 %1, i32 %2)
%6 = tail call i32 (...) @monUnlock()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void second(void) {
  int a;
  printf("a is %d\n", a);
  return;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"a is %d\0A\00"
define void @second() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 undef)
ret void
}
/* Variables and functions */
int munmap(void *, size_t);
int release_vm(void *start_addr, size_t length) {
  return munmap(start_addr, length);
}


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

x86 assembly (clang, -O2):
<release_vm>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @release_vm(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int assertion_cmp_cstr(const char *lhs, const char *rhs) {
  return strcmp(lhs, rhs);
}


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

x86 assembly (clang, -O2):
<assertion_cmp_cstr>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @assertion_cmp_cstr(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 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @assertion_cmp_cstr(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ ft_strcmp(char const *, char const *);
int ft_strequ(char const *s1, char const *s2) {
  if (!s1 || !s2)
    return (0);
  return (ft_strcmp(s1, s2) ? 0 : 1);
}


x86 assembly (clang, -O0):
<ft_strequ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <ft_strequ+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <ft_strequ+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1163 <ft_strequ+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ft_strcmp@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strequ>:
xor    %eax,%eax
test   %rdi,%rdi
je     1131 <ft_strequ+0x21>
test   %rsi,%rsi
je     1131 <ft_strequ+0x21>
push   %rax
call   1030 <ft_strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @ft_strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ range;

/* Variables and functions */
long *malloc(long);
int /*<<< orphan*/ printf(char *);
long int *create_matrix(long int range) {
  long int *matrix = malloc((range + 1) * sizeof(range));
  if (matrix == NULL) {
    printf("Blad przydzialu pamieci.");
    return NULL;
  }
  return matrix;
}


x86 assembly (clang, -O0):
<create_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <create_matrix+0x45>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    116d <create_matrix+0x4d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_matrix>:
push   %rbx
lea    0x8(,%rdi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <create_matrix+0x22>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Blad przydzialu pamieci.\00"
define i64* @create_matrix(i64 %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add nsw i64 %5, 1
%7 = mul i64 %6, 8
%8 = call i64* @malloc(i64 %7)
store i64* %8, i64** %4
%9 = load i64*, i64** %4
%10 = icmp eq i64* %9, null
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i64* null, i64** %2
br label %15
13: ; preds = %1
%14 = load i64*, i64** %4
store i64* %14, i64** %2
br label %15
15: ; preds = %13, %11
%16 = load i64*, i64** %2
ret i64* %16
}

LLVM IR (-O2):
@.str = [25 x i8] c"Blad przydzialu pamieci.\00"
define noalias i64* @create_matrix(i64 %0) {
%2 = shl i64 %0, 3
%3 = add i64 %2, 8
%4 = tail call i64* @malloc(i64 %3)
%5 = icmp eq i64* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %6
ret i64* %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ subwindow;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
unsigned long get_XPointerMovedEvent_subwindow(void *_p) {
  return (unsigned long)((XPointerMovedEvent *)_p)->subwindow;
}


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

x86 assembly (clang, -O2):
<get_XPointerMovedEvent_subwindow>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XPointerMovedEvent_subwindow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XPointerMovedEvent_subwindow(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ pc_stop();
void pcm_trace_prop(void) { pc_stop(); }


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

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

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

LLVM IR (-O2):
define void @pcm_trace_prop() {
%1 = tail call i32 (...) @pc_stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CyEEPROM_Start();
void EEPROM_Real_Enable(void) { CyEEPROM_Start(); }


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

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

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

LLVM IR (-O2):
define void @EEPROM_Real_Enable() {
%1 = tail call i32 (...) @CyEEPROM_Start()
ret void
}
int ld_bgt_mr2(long double *a1, long double a2) {
  return !(__builtin_isgreater(*a1, a2));
}


x86 assembly (clang, -O0):
<ld_bgt_mr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bgt_mr2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_bgt_mr2(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp ogt x86_fp80 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_bgt_mr2(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp ule x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int isPrime(int number) {
  int i;
  if (number != 2) {
    if (number % 2 == 0) {
      return 0;
    }
    for (i = 3; (i * i) <= number; i += 2) {
      if (number % i == 0) {
        return 0;
      }
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     117c <isPrime+0x7c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1131 <isPrime+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1183 <isPrime+0x83>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1177 <isPrime+0x77>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1164 <isPrime+0x64>
movl   $0x0,-0x4(%rbp)
jmp    1183 <isPrime+0x83>
jmp    1169 <isPrime+0x69>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <isPrime+0x38>
jmp    117c <isPrime+0x7c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%ecx
cmp    $0x2,%edi
je     1135 <isPrime+0x35>
test   $0x1,%dil
jne    1114 <isPrime+0x14>
xor    %ecx,%ecx
jmp    1135 <isPrime+0x35>
cmp    $0x9,%edi
jl     1135 <isPrime+0x35>
mov    $0x3,%esi
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1110 <isPrime+0x10>
add    $0x2,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1120 <isPrime+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp eq i32 %0, 2
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3
%7 = icmp slt i32 %0, 9
br i1 %7, label %16, label %11
8: ; preds = %11
%9 = mul nsw i32 %15, %15
%10 = icmp sgt i32 %9, %0
br i1 %10, label %16, label %11
11: ; preds = %6, %8
%12 = phi i32 [ %15, %8 ], [ 3, %6 ]
%13 = srem i32 %0, %12
%14 = icmp eq i32 %13, 0
%15 = add nuw nsw i32 %12, 2
br i1 %14, label %16, label %8
16: ; preds = %11, %8, %6, %1, %3
%17 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %6 ], [ 0, %11 ], [ 1, %8 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int *puntero = NULL;
  puntero = (int *)malloc(100 * sizeof(int));
  if (puntero == NULL) {
    printf("NO hay suficiente espacio en memoria");
    return -1;
  } else
    printf("Se asigno memoria  ");
  free(puntero);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x190,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1178 <main+0x48>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1194 <main+0x64>
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x190,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     115b <main+0x2b>
mov    %rax,%rbx
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"NO hay suficiente espacio en memoria\00"
@.str.1 = [20 x i8] c"Se asigno memoria \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = call i64 @malloc(i32 400)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %14
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9
%12 = load i32*, i32** %2
%13 = call i32 @free(i32* %12)
store i32 0, i32* %1
br label %14
14: ; preds = %11, %7
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [37 x i8] c"NO hay suficiente espacio en memoria\00"
@.str.1 = [20 x i8] c"Se asigno memoria \00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 400)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = inttoptr i64 %1 to i32*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @free(i32* %6)
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ -1, %3 ], [ 0, %5 ]
ret i32 %10
}
unsigned char low_byte(int word) { return (word & 0xff); }


x86 assembly (clang, -O0):
<low_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @low_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @low_byte(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
unsigned int hash(void *key) {
  int *p = key;
  return *p % 10;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
movslq (%rdi),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = srem i32 %7, 10
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = srem i32 %3, 10
ret i32 %4
}
float catmullrom_w2(float x) { return x * (0.5f + x * (2.0f - 1.5f * x)); }


x86 assembly (clang, -O0):
<catmullrom_w2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  0xee4(%rip),%xmm3
mulss  %xmm3,%xmm2
movss  0xedc(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xec4(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<catmullrom_w2>:
movss  0xef8(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xef0(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xee8(%rip),%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @catmullrom_w2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float -1.500000e+00, float %5, float 2.000000e+00)
%7 = call float @llvm.fmuladd.f32(float %4, float %6, float 5.000000e-01)
%8 = fmul float %3, %7
ret float %8
}

LLVM IR (-O2):
define float @catmullrom_w2(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float -1.500000e+00, float 2.000000e+00)
%3 = tail call float @llvm.fmuladd.f32(float %0, float %2, float 5.000000e-01)
%4 = fmul float %3, %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ free(void *);
void mb_free(void *p) {
  do {
    ((void)(p));
    assert(p);
  } while (0);
  free(p);
}


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

x86 assembly (clang, -O2):
<mb_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mb_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @assert(i8* %5)
br label %7
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @mb_free(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getRootWindowSize(unsigned int *, unsigned int *);
int get_screen_size_x() {
  unsigned int w, h;
  getRootWindowSize(&w, &h);
  return w;
}


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

x86 assembly (clang, -O2):
<get_screen_size_x>:
push   %rax
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1030 <getRootWindowSize@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_screen_size_x() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @getRootWindowSize(i32* %1, i32* %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_screen_size_x() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @getRootWindowSize(i32* %1, i32* %2)
%6 = load i32, i32* %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int x;
  int y;
  printf("Enter a six digit integer: ");
  scanf("%2d%d", &x, &y);
  printf("The integers input were %d and %d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter a six digit integer: \00"
@.str.1 = [6 x i8] c"%2d%d\00"
@.str.2 = [35 x i8] c"The integers input were %d and %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter a six digit integer: \00"
@.str.1 = [6 x i8] c"%2d%d\00"
@.str.2 = [35 x i8] c"The integers input were %d and %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int ceil(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float c;
  int result;
  printf("Enter a number: ");
  scanf("%f", &c);
  result = ceil(c);
  printf("Ceiling integer of %.2f=%d", c, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0xc(%rbp),%esi
lea    0xe97(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1030 <ceil@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea8(%rip),%rdi
mov    %eax,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [27 x i8] c"Ceiling integer of %.2f=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = call i32 @ceil(float %6)
store i32 %7, i32* %3
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [27 x i8] c"Ceiling integer of %.2f=%d\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call i32 @ceil(float %5)
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %8, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clog_set_buffer_len(int *);
void CLOG_SET_BUFFER_LEN(int *w) { clog_set_buffer_len(w); }


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

x86 assembly (clang, -O2):
<CLOG_SET_BUFFER_LEN>:
jmp    1030 <clog_set_buffer_len@plt>

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

LLVM IR (-O2):
define void @CLOG_SET_BUFFER_LEN(i32* %0) {
%2 = tail call i32 @clog_set_buffer_len(i32* %0)
ret void
}
unsigned long get_fs() {
  unsigned short _v;
  __asm__("mov %%fs,%%ax" : "=a"(_v) :);
  return _v;
}


x86 assembly (clang, -O0):
<get_fs>:
push   %rbp
mov    %rsp,%rbp
mov    %fs,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fs>:
mov    %fs,%ax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i64 @get_fs() {
%1 = alloca i16
%2 = call i16 asm "mov %fs,%ax", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = zext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_fs() {
%1 = tail call i16 asm "mov %fs,%ax", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = zext i16 %1 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ UART_1_UartInit();
void UART_1_Init(void) { UART_1_UartInit(); }


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

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

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

LLVM IR (-O2):
define void @UART_1_Init() {
%1 = tail call i32 (...) @UART_1_UartInit()
ret void
}
void *int_dup(const void *o) { return (void *)o; }


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

x86 assembly (clang, -O2):
<int_dup>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @int_dup(i8* readnone returned %0) {
ret i8* %0
}
int num_points(int size) { return size * size; }


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

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

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

LLVM IR (-O2):
define i32 @num_points(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int fun261() { return 261; }


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

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

LLVM IR (-O0):
define i32 @fun261() {
ret i32 261
}

LLVM IR (-O2):
define i32 @fun261() {
ret i32 261
}
int TZX_GetBlockHeaderSize(unsigned char ID) {
  switch (ID) {
  case 0x010:
    return 4 + 1;
  case 0x011:
    return 18 + 1;
  case 0x020:
    return 2 + 1;
  case 0x014:
    return 0x0a + 1;
  case 0x015:
    return 0x08 + 1;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<TZX_GetBlockHeaderSize>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
add    $0xfffffff0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x10,%eax
ja     1170 <TZX_GetBlockHeaderSize+0x70>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x5,-0x4(%rbp)
jmp    117c <TZX_GetBlockHeaderSize+0x7c>
movl   $0x13,-0x4(%rbp)
jmp    117c <TZX_GetBlockHeaderSize+0x7c>
movl   $0x3,-0x4(%rbp)
jmp    117c <TZX_GetBlockHeaderSize+0x7c>
movl   $0xb,-0x4(%rbp)
jmp    117c <TZX_GetBlockHeaderSize+0x7c>
movl   $0x9,-0x4(%rbp)
jmp    117c <TZX_GetBlockHeaderSize+0x7c>
jmp    1175 <TZX_GetBlockHeaderSize+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TZX_GetBlockHeaderSize>:
add    $0xf0,%dil
cmp    $0x10,%dil
ja     1129 <TZX_GetBlockHeaderSize+0x29>
mov    $0x5,%eax
movzbl %dil,%ecx
lea    0xee6(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x13,%eax
ret
xor    %eax,%eax
ret
mov    $0xb,%eax
ret
mov    $0x9,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @TZX_GetBlockHeaderSize(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %11 [
i32 16, label %6
i32 17, label %7
i32 32, label %8
i32 20, label %9
i32 21, label %10
]
6: ; preds = %1
store i32 5, i32* %2
br label %13
7: ; preds = %1
store i32 19, i32* %2
br label %13
8: ; preds = %1
store i32 3, i32* %2
br label %13
9: ; preds = %1
store i32 11, i32* %2
br label %13
10: ; preds = %1
store i32 9, i32* %2
br label %13
11: ; preds = %1
br label %12
12: ; preds = %11
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10, %9, %8, %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @TZX_GetBlockHeaderSize(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 16, label %7
i8 17, label %2
i8 32, label %3
i8 20, label %4
i8 21, label %5
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3, %2
%8 = phi i32 [ 0, %6 ], [ 9, %5 ], [ 11, %4 ], [ 3, %3 ], [ 19, %2 ], [ 5, %1 ]
ret i32 %8
}
void initialise() {}


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

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

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

LLVM IR (-O2):
define void @initialise() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t retx_get_num(const uint8_t *p_retx) {
  return ((uint16_t)p_retx[6] << 8) | p_retx[7];
}


x86 assembly (clang, -O0):
<retx_get_num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x1c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<retx_get_num>:
mov    0x18(%rdi),%eax
shl    $0x8,%eax
or     0x1c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @retx_get_num(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 7
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @retx_get_num(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 7
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
int fun219() { return 219; }


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

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

LLVM IR (-O0):
define i32 @fun219() {
ret i32 219
}

LLVM IR (-O2):
define i32 @fun219() {
ret i32 219
}
int git__prefixcmp(const char *str, const char *prefix) {
  for (;;) {
    char p = *(prefix++), s;
    if (!p)
      return 0;
    if ((s = *(str++)) != p)
      return s - p;
  }
}


x86 assembly (clang, -O0):
<git__prefixcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
cmpb   $0x0,-0x19(%rbp)
jne    1136 <git__prefixcmp+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1170 <git__prefixcmp+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl %al,%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
je     116b <git__prefixcmp+0x6b>
movsbl -0x1a(%rbp),%eax
movsbl -0x19(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <git__prefixcmp+0x70>
jmp    110c <git__prefixcmp+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<git__prefixcmp>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rsi,%rcx,1),%edx
test   %edx,%edx
je     112c <git__prefixcmp+0x2c>
movsbl (%rdi,%rcx,1),%r8d
add    $0x1,%rcx
cmp    %dl,%r8b
je     1110 <git__prefixcmp+0x10>
sub    %edx,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @git__prefixcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %1, %2 ], [ %9, %8 ]
%5 = phi i8* [ %0, %2 ], [ %10, %8 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %5
%12 = icmp eq i8 %11, %6
br i1 %12, label %3, label %13
13: ; preds = %8
%14 = sext i8 %6 to i32
%15 = sext i8 %11 to i32
%16 = sub nsw i32 %15, %14
br label %17
17: ; preds = %3, %13
%18 = phi i32 [ %16, %13 ], [ 0, %3 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_castsi128_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cmpeq_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_setzero_si128();
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_epi32(int /*<<< orphan*/, int);
__m128 sse_mathfun_one_ps() {
  __m128i zeros = _mm_setzero_si128();
  __m128i ones = _mm_cmpeq_epi32(zeros, zeros);
  __m128i a = _mm_slli_epi32(_mm_srli_epi32(ones, 25), 23);
  return _mm_castsi128_ps(a);
}


x86 assembly (clang, -O0):
<sse_mathfun_one_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_mm_setzero_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <_mm_cmpeq_epi32@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x19,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %eax,%edi
mov    $0x17,%esi
call   1050 <_mm_slli_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <_mm_castsi128_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sse_mathfun_one_ps>:
push   %rax
xor    %eax,%eax
call   1030 <_mm_setzero_si128@plt>
mov    %eax,%edi
mov    %eax,%esi
call   1060 <_mm_cmpeq_epi32@plt>
mov    %eax,%edi
mov    $0x19,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %eax,%edi
mov    $0x17,%esi
call   1050 <_mm_slli_epi32@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <_mm_castsi128_ps@plt>

LLVM IR (-O0):
define i32 @sse_mathfun_one_ps() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @_mm_setzero_si128()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @_mm_cmpeq_epi32(i32 %5, i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @_mm_srli_epi32(i32 %8, i32 25)
%10 = call i32 @_mm_slli_epi32(i32 %9, i32 23)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @_mm_castsi128_ps(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @sse_mathfun_one_ps() {
%1 = tail call i32 (...) @_mm_setzero_si128()
%2 = tail call i32 @_mm_cmpeq_epi32(i32 %1, i32 %1)
%3 = tail call i32 @_mm_srli_epi32(i32 %2, i32 25)
%4 = tail call i32 @_mm_slli_epi32(i32 %3, i32 23)
%5 = tail call i32 @_mm_castsi128_ps(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ killLink(char *);
void doReset(void) {
  killLink("/var/db/xcode_select_link");
  killLink("/usr/share/xcode-select/xcode_dir_link");
  killLink("/usr/share/xcode-select/xcode_dir_path");
}


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

x86 assembly (clang, -O2):
<doReset>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <killLink@plt>
lea    0xef6(%rip),%rdi
call   1030 <killLink@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <killLink@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"/var/db/xcode_select_link\00"
@.str.1 = [39 x i8] c"/usr/share/xcode-select/xcode_dir_link\00"
@.str.2 = [39 x i8] c"/usr/share/xcode-select/xcode_dir_path\00"
define void @doReset() {
%1 = call i32 @killLink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @killLink(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @killLink(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"/var/db/xcode_select_link\00"
@.str.1 = [39 x i8] c"/usr/share/xcode-select/xcode_dir_link\00"
@.str.2 = [39 x i8] c"/usr/share/xcode-select/xcode_dir_path\00"
define void @doReset() {
%1 = tail call i32 @killLink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @killLink(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @killLink(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
ret void
}
unsigned char has_wildcards_p(const char *s) {
  for (; *s; s++)
    if (*s == '*' || *s == '?' || *s == '[' || *s == ']')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<has_wildcards_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1174 <has_wildcards_p+0x74>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
je     1155 <has_wildcards_p+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
je     1155 <has_wildcards_p+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
je     1155 <has_wildcards_p+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5d,%eax
jne    115e <has_wildcards_p+0x5e>
movb   $0x1,-0x1(%rbp)
jmp    1178 <has_wildcards_p+0x78>
jmp    1163 <has_wildcards_p+0x63>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <has_wildcards_p+0x8>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_wildcards_p>:
movabs $0xa000000200001,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
lea    -0x2a(%rcx),%edx
cmp    $0x33,%dl
ja     1124 <has_wildcards_p+0x24>
movzbl %dl,%edx
bt     %rdx,%rax
jb     112e <has_wildcards_p+0x2e>
test   %cl,%cl
je     1131 <has_wildcards_p+0x31>
add    $0x1,%rdi
jmp    1110 <has_wildcards_p+0x10>
mov    $0x1,%al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @has_wildcards_p(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 42, label %7
i8 63, label %7
i8 91, label %7
i8 93, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
br label %8
8: ; preds = %2, %7
%9 = phi i8 [ 1, %7 ], [ 0, %2 ]
ret i8 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int read(int, int /*<<< orphan*/ *, int);
int pci_config_read_dword(int fd, int reg, uint32_t *val) {
  int ret;
  lseek(fd, reg << 2, SEEK_SET);
  ret = read(fd, val, sizeof(*val));
  return ret;
}


x86 assembly (clang, -O0):
<pci_config_read_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x2,%esi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_config_read_dword>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
shl    $0x2,%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <read@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @pci_config_read_dword(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = shl i32 %9, 2
%11 = load i32, i32* @SEEK_SET
%12 = call i32 @lseek(i32 %8, i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = load i32*, i32** %6
%15 = call i32 @read(i32 %13, i32* %14, i32 4)
store i32 %15, i32* %7
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @pci_config_read_dword(i32 %0, i32 %1, i32* nocapture %2) {
%4 = shl i32 %1, 2
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @lseek(i32 %0, i32 %4, i32 %5)
%7 = tail call i32 @read(i32 %0, i32* %2, i32 4)
ret i32 %7
}