xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _io_out8(int, int);
int /*<<< orphan*/ wait_KBC_sendready();
void init_keyboard(void) {
  wait_KBC_sendready();
  _io_out8(0x0064, 0x60);
  wait_KBC_sendready();
  _io_out8(0x0060, 0x47);
  return;
}


x86 assembly (clang, -O0):
<init_keyboard>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wait_KBC_sendready@plt>
mov    $0x64,%edi
mov    $0x60,%esi
call   1040 <_io_out8@plt>
mov    $0x0,%al
call   1030 <wait_KBC_sendready@plt>
mov    $0x60,%edi
mov    $0x47,%esi
call   1040 <_io_out8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_keyboard>:
push   %rax
xor    %eax,%eax
call   1030 <wait_KBC_sendready@plt>
mov    $0x64,%edi
mov    $0x60,%esi
call   1040 <_io_out8@plt>
xor    %eax,%eax
call   1030 <wait_KBC_sendready@plt>
mov    $0x60,%edi
mov    $0x47,%esi
pop    %rax
jmp    1040 <_io_out8@plt>

LLVM IR (-O0):
define void @init_keyboard() {
%1 = call i32 (...) @wait_KBC_sendready()
%2 = call i32 @_io_out8(i32 100, i32 96)
%3 = call i32 (...) @wait_KBC_sendready()
%4 = call i32 @_io_out8(i32 96, i32 71)
ret void
}

LLVM IR (-O2):
define void @init_keyboard() {
%1 = tail call i32 (...) @wait_KBC_sendready()
%2 = tail call i32 @_io_out8(i32 100, i32 96)
%3 = tail call i32 (...) @wait_KBC_sendready()
%4 = tail call i32 @_io_out8(i32 96, i32 71)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ pthread_mutex_unlock(int /*<<< orphan*/ *);
void std_pthread_mutex_unlock(pthread_mutex_t *mutex) {
  if (pthread_mutex_unlock(mutex) != 0) {
    perror("pthread_mutex_unlock");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_pthread_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
cmp    $0x0,%rax
je     1165 <std_pthread_mutex_unlock+0x35>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_pthread_mutex_unlock>:
push   %rax
call   1030 <pthread_mutex_unlock@plt>
test   %rax,%rax
jne    113d <std_pthread_mutex_unlock+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"pthread_mutex_unlock\00"
define void @std_pthread_mutex_unlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_mutex_unlock(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"pthread_mutex_unlock\00"
define void @std_pthread_mutex_unlock(i32* %0) {
%2 = tail call i64 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
char UART0_GetChar() {
  while (((*((volatile unsigned long *)0x7F005018)) & 0x7f) == 0)
    ;
  return (*((volatile unsigned char *)0x7F005024));
}


x86 assembly (clang, -O0):
<UART0_GetChar>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UART0_GetChar+0x9>
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x7f,%rax
cmp    $0x0,%rax
jne    1124 <UART0_GetChar+0x24>
jmp    1109 <UART0_GetChar+0x9>
mov    $0x7f005024,%eax
mov    (%rax),%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART0_GetChar>:
testq  $0x7f,0x7f005018
je     1100 <UART0_GetChar>
mov    0x7f005024,%al
ret

LLVM IR (-O0):
define signext i8 @UART0_GetChar() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%3 = and i64 %2, 127
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @UART0_GetChar() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%3 = and i64 %2, 127
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
ret i8 %6
}
int xtables_lock(int wait, struct timeval *wait_interval) { return 0; }


x86 assembly (clang, -O0):
<xtables_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type opaque
define i32 @xtables_lock(i32 %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval*
store i32 %0, i32* %3
store %struct.timeval* %1, %struct.timeval** %4
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @xtables_lock(i32 %0, %struct.timeval* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void *evaluator_derivative(void *, char *);
void *evaluator_derivative_y(void *evaluator) {
  return evaluator_derivative(evaluator, "y");
}


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

x86 assembly (clang, -O2):
<evaluator_derivative_y>:
lea    0xee9(%rip),%rsi
jmp    1030 <evaluator_derivative@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"y\00"
define i8* @evaluator_derivative_y(i8* %0) {
%2 = tail call i8* @evaluator_derivative(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wait_nonblock(struct __test_metadata *);
void wrapper_wait_nonblock(struct __test_metadata *_metadata,
                           struct __fixture_variant_metadata *variant) {
  wait_nonblock(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_wait_nonblock>:
jmp    1030 <wait_nonblock@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_wait_nonblock(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @wait_nonblock(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_wait_nonblock(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @wait_nonblock(%struct.__test_metadata* %0)
ret void
}
int is_space(char c) { return c == ' ' || c == '\n' || c == '\t'; }


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_space+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_space+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
mov    $0x1,%eax
cmp    $0xa,%dil
je     1111 <is_space+0x11>
cmp    $0x20,%dil
jne    1112 <is_space+0x12>
ret
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
void ge_helper_print_vdo_view(void *view) { (void)(view); }


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

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

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

LLVM IR (-O2):
define void @ge_helper_print_vdo_view(i8* nocapture %0) {
ret void
}
__attribute__((always_)) void outsw(int port, const void *addr,
                                    unsigned long count) {
  __asm__ __volatile__("rep; outs"
                       "w"
                       : "+S"(addr), "+c"(count)
                       : "d"(port));
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsw(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call { i8*, i64 } asm sideeffect "rep; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsw(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t rol16(uint16_t x, int r) { return (x << r) | (x >> (16 - r)); }


x86 assembly (clang, -O0):
<rol16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol16>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x10,%dl
sub    %cl,%dl
mov    %edx,%ecx
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 16, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol16(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 16, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
double pair_tailcorr_cut_eislater1s1scorr(void *pair_data, long center_index,
                                          long other_index, double rcut) {
  double t1 = 0;
  return t1;
}


x86 assembly (clang, -O0):
<pair_tailcorr_cut_eislater1s1scorr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_tailcorr_cut_eislater1s1scorr>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pair_tailcorr_cut_eislater1s1scorr(i8* %0, i64 %1, i64 %2, double %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca double
%9 = alloca double
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store double %3, double* %8
store double 0.000000e+00, double* %9
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @pair_tailcorr_cut_eislater1s1scorr(i8* nocapture readnone %0, i64 %1, i64 %2, double %3) {
ret double 0.000000e+00
}
void PrintObjectGetVarJN2(void *theEnv, const char *logicalName,
                          void *theValue) {}


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

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

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

LLVM IR (-O2):
define void @PrintObjectGetVarJN2(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M2M_ScalerForVideo_Disable();
void uninit_viqe() { M2M_ScalerForVideo_Disable(); }


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

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

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

LLVM IR (-O2):
define void @uninit_viqe() {
%1 = tail call i32 (...) @M2M_ScalerForVideo_Disable()
ret void
}
char *ft_strrchr(const char *s, int c) {
  char *d;
  d = (char *)s;
  while (*d)
    d++;
  while (*d) {
    if (*d == c)
      return (d);
    d--;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1131 <ft_strrchr+0x31>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <ft_strrchr+0x13>
jmp    1136 <ft_strrchr+0x36>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1171 <ft_strrchr+0x71>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1160 <ft_strrchr+0x60>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <ft_strrchr+0x79>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1136 <ft_strrchr+0x36>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @ft_strrchr(i8* %0, i32 %1) {
ret i8* null
}
void raptor_sax2_finish(void) {}


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

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

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

LLVM IR (-O2):
define void @raptor_sax2_finish() {
ret void
}
/* Variables and functions */
scalar_t__ is_passwd_default_enable();
scalar_t__ is_passwd_env_enable();
int is_passwd_enable(void) {
  return is_passwd_default_enable() || is_passwd_env_enable();
}


x86 assembly (clang, -O0):
<is_passwd_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <is_passwd_default_enable@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1152 <is_passwd_enable+0x32>
mov    $0x0,%al
call   1040 <is_passwd_env_enable@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_passwd_enable>:
push   %rax
xor    %eax,%eax
call   1030 <is_passwd_default_enable@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_passwd_enable+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <is_passwd_env_enable@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_passwd_enable() {
%1 = call i64 (...) @is_passwd_default_enable()
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @is_passwd_env_enable()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_passwd_enable() {
%1 = tail call i64 (...) @is_passwd_default_enable()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @is_passwd_env_enable()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
float act_pct(float x) { return x; }


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

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

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

LLVM IR (-O2):
define float @act_pct(float returned %0) {
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hola mundo!!!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hola mundo!!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
const char *what_is_my_name(void) { return __func__; }


x86 assembly (clang, -O0):
<what_is_my_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<what_is_my_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@__func__.what_is_my_name = [16 x i8] c"what_is_my_name\00"
define i8* @what_is_my_name() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.what_is_my_name, i64 0, i64 0)
}

LLVM IR (-O2):
@__func__.what_is_my_name = [16 x i8] c"what_is_my_name\00"
define i8* @what_is_my_name() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.what_is_my_name, i64 0, i64 0)
}
/* Variables and functions */
int read(int /*<<< orphan*/, int *, int);
getchar() {
  int c;
  c = 0;
  if (read(0, &c, 1) != 1)
    return (0);
  return (c);
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     1144 <getchar+0x34>
movl   $0x0,-0x4(%rbp)
jmp    114a <getchar+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
xor    %ebx,%ebx
lea    0xc(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jne    1139 <getchar+0x29>
mov    0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getchar() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 @read(i32 0, i32* %2, i32 1)
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @getchar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @read(i32 0, i32* %1, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i32, i32* %1
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}
/* Variables and functions */
scalar_t__ Mem_Alloc(int);
int /*<<< orphan*/ Mem_Dump();
scalar_t__ Mem_Init(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  assert(Mem_Init(4096) == 0);
  int *ptr = (int *)Mem_Alloc(sizeof(int));
  assert(ptr != NULL);
  *ptr = 42;
  assert(*ptr == 42);
  Mem_Dump();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x4,%edi
call   1060 <Mem_Alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x2a,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1040 <Mem_Dump@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
mov    $0x4,%edi
call   1060 <Mem_Alloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
movl   $0x2a,(%rbx)
mov    $0x1,%edi
call   1050 <assert@plt>
xor    %eax,%eax
call   1040 <Mem_Dump@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @Mem_Init(i32 4096)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i64 @Mem_Alloc(i32 4)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %2
store i32 42, i32* %13
%14 = load i32*, i32** %2
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 42
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = call i32 (...) @Mem_Dump()
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @Mem_Init(i32 4096)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @Mem_Alloc(i32 4)
%6 = inttoptr i64 %5 to i32*
%7 = icmp ne i64 %5, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
store i32 42, i32* %6
%10 = tail call i32 @assert(i32 1)
%11 = tail call i32 (...) @Mem_Dump()
%12 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int fileExists(const char *filename) {
  struct stat buffer;
  return (stat(filename, &buffer) == 0);
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *memchr(char *, char, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void nullpointerMemchr1(char *p, char *s) { p = memchr(s, 'p', strlen(s)); }


x86 assembly (clang, -O0):
<nullpointerMemchr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    $0x70,%esi
call   1040 <memchr@plt>
mov    %rax,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullpointerMemchr1>:
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x70,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <memchr@plt>

LLVM IR (-O0):
define void @nullpointerMemchr1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = call i8* @memchr(i8* %5, i8 signext 112, i32 %7)
store i8* %8, i8** %3
ret void
}

LLVM IR (-O2):
define void @nullpointerMemchr1(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @memchr(i8* %1, i8 signext 112, i32 %3)
ret void
}
int hash(char *key) {
  register char *cp;
  register int k;
  cp = key;
  k = 0;
  while (*cp)
    k = ((k << 1) ^ (*cp++)) & 0x3fff;
  return (k % 1009);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <hash+0x4b>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
and    $0x3fff,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <hash+0x17>
mov    -0x14(%rbp),%eax
mov    $0x3f1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     114a <hash+0x4a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    %eax,%eax
movsbl %cl,%ecx
xor    %ecx,%eax
and    $0x3fff,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
imul   $0x3cf,%eax,%ecx
shr    $0x10,%ecx
mov    %eax,%edx
sub    %ecx,%edx
movzwl %dx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x9,%edx
imul   $0x3f1,%edx,%ecx
sub    %ecx,%eax
movzwl %ax,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl nuw nsw i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = xor i32 %8, %10
%12 = and i32 %11, 16383
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = trunc i32 %12 to i16
%17 = urem i16 %16, 1009
%18 = zext i16 %17 to i32
br label %19
19: ; preds = %15, %1
%20 = phi i32 [ 0, %1 ], [ %18, %15 ]
ret i32 %20
}
int test_imm_7Bint64_midword_reg(long long val) {
  return ((val >> 16) & (0x7B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Bint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 123
%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_7Bint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8060928
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int process_ue_selector(const char *line) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @process_ue_selector(i8* nocapture readnone %0) {
ret i32 -1
}
void fa123(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        p024A:
          goto p024A;
          goto a;
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    a:
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa123>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa123+0x4>

x86 assembly (clang, -O2):
<fa123>:
jmp    1100 <fa123>

LLVM IR (-O0):
define void @fa123() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa123() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct bst_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
struct bst_node *pgen_alloc_bst_delete(struct bst_node *, void *);
void pgen_free(struct bst_node **bst, void *ptr) {
  free(ptr);
  *bst = pgen_alloc_bst_delete(*bst, ptr);
}


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

x86 assembly (clang, -O2):
<pgen_free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <free@plt>
mov    (%r14),%rdi
mov    %rbx,%rsi
call   1040 <pgen_alloc_bst_delete@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.bst_node = type { i32 }
define void @pgen_free(%struct.bst_node** %0, i8* %1) {
%3 = alloca %struct.bst_node**
%4 = alloca i8*
store %struct.bst_node** %0, %struct.bst_node*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
%7 = load %struct.bst_node**, %struct.bst_node*** %3
%8 = load %struct.bst_node*, %struct.bst_node** %7
%9 = load i8*, i8** %4
%10 = call %struct.bst_node* @pgen_alloc_bst_delete(%struct.bst_node* %8, i8* %9)
%11 = load %struct.bst_node**, %struct.bst_node*** %3
store %struct.bst_node* %10, %struct.bst_node** %11
ret void
}

LLVM IR (-O2):
%struct.bst_node = type { i32 }
define void @pgen_free(%struct.bst_node** nocapture %0, i8* %1) {
%3 = tail call i32 @free(i8* %1)
%4 = load %struct.bst_node*, %struct.bst_node** %0
%5 = tail call %struct.bst_node* @pgen_alloc_bst_delete(%struct.bst_node* %4, i8* %1)
store %struct.bst_node* %5, %struct.bst_node** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void assertOnPosixError(int value) {
  if (-1 == value) {
    perror("ERROR");
  }
}


x86 assembly (clang, -O0):
<assertOnPosixError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%eax
cmp    -0x4(%rbp),%eax
jne    1135 <assertOnPosixError+0x25>
lea    0xed0(%rip),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertOnPosixError>:
cmp    $0xffffffff,%edi
je     1116 <assertOnPosixError+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <perror@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ERROR\00"
define void @assertOnPosixError(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 -1, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
define void @assertOnPosixError(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
int highestBin(int *binrep, int n) {
  if (*(binrep + sizeof(int) * n) == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<highestBin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    112d <highestBin+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <highestBin+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<highestBin>:
movslq %esi,%rcx
shl    $0x4,%rcx
xor    %eax,%eax
cmpl   $0x1,(%rdi,%rcx,1)
sete   %al
ret

LLVM IR (-O0):
define i32 @highestBin(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = mul i64 4, %8
%10 = getelementptr inbounds i32, i32* %6, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @highestBin(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = shl nsw i64 %3, 2
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int ENOSYS;
int hwconfig_sub_f(const char *opt, const char *subopt, char *buf) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<hwconfig_sub_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hwconfig_sub_f>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @hwconfig_sub_f(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @ENOSYS
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @hwconfig_sub_f(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int *allocInt(int);
int /*<<< orphan*/ fillRandomly(int *, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  int *p = allocInt(100);
  fillRandomly(p, 100);
  print(p, 100);
  free(p);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x64,%edi
call   1070 <allocInt@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x64,%esi
call   1040 <fillRandomly@plt>
mov    -0x10(%rbp),%rdi
mov    $0x64,%esi
call   1050 <print@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x64,%edi
call   1070 <allocInt@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x64,%esi
call   1040 <fillRandomly@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <print@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32* @allocInt(i32 100)
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @fillRandomly(i32* %6, i32 100)
%8 = load i32*, i32** %2
%9 = call i32 @print(i32* %8, i32 100)
%10 = load i32*, i32** %2
%11 = call i32 @free(i32* %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32* @allocInt(i32 100)
%4 = tail call i32 @fillRandomly(i32* %3, i32 100)
%5 = tail call i32 @print(i32* %3, i32 100)
%6 = tail call i32 @free(i32* %3)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Enter a number:");
  scanf("%d", &a);
  printf("%d\n", (a));
  printf("%lld\n", fact(a));
  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   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,%esi
lea    0xe98(%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    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
call   1040 <fact@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 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), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @fact(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @fact(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
char *get_aux_buffer();
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *subcadena(const char *s, int desde, int cuantos) {
  char *buf = get_aux_buffer();
  strncpy(buf, s + desde, cuantos);
  buf[cuantos] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<subcadena>:
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 <get_aux_buffer@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subcadena>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <get_aux_buffer@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @subcadena(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i8* (...) @get_aux_buffer()
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i32, i32* %6
%15 = call i32 @strncpy(i8* %9, i8* %13, i32 %14)
%16 = load i8*, i8** %7
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %7
ret i8* %20
}

LLVM IR (-O2):
define i8* @subcadena(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* (...) @get_aux_buffer()
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @strncpy(i8* %4, i8* %6, i32 %2)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 0, i8* %9
ret i8* %4
}
int lastIndexOf(char c, char *str) {
  int r = -1;
  int i = 0;
  for (r = -1, i = 0; str[i] != '\0'; i++) {
    if (str[i] == c)
      r = i;
  }
  return r;
}


x86 assembly (clang, -O0):
<lastIndexOf>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1170 <lastIndexOf+0x70>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    115d <lastIndexOf+0x5d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <lastIndexOf+0x62>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <lastIndexOf+0x2a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastIndexOf>:
mov    (%rsi),%cl
mov    $0xffffffff,%eax
test   %cl,%cl
je     1123 <lastIndexOf+0x23>
xor    %edx,%edx
nopl   (%rax)
cmp    %dil,%cl
cmove  %edx,%eax
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <lastIndexOf+0x10>
ret

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

LLVM IR (-O2):
define i32 @lastIndexOf(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ -1, %2 ]
%9 = icmp eq i8 %7, %0
%10 = trunc i64 %6 to i32
%11 = select i1 %9, i32 %10, i32 %8
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ -1, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello world!"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}