xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ handle_aux_carry_flag_add(int const, int const);
int /*<<< orphan*/ handle_carry_flag_add(int const, int const);
int /*<<< orphan*/ handle_parity_flag(int const);
int /*<<< orphan*/ handle_sign_flag(int const);
int /*<<< orphan*/ handle_zero_flag(int const);
void handle_flags_add(const int final_value, const int value1,
                      const int value2) {
  handle_zero_flag(final_value);
  handle_sign_flag(final_value);
  handle_carry_flag_add(value1, value2);
  handle_aux_carry_flag_add(value1, value2);
  handle_parity_flag(final_value);
}


x86 assembly (clang, -O0):
<handle_flags_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <handle_zero_flag@plt>
mov    -0x4(%rbp),%edi
call   1060 <handle_sign_flag@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <handle_carry_flag_add@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <handle_aux_carry_flag_add@plt>
mov    -0x4(%rbp),%edi
call   1050 <handle_parity_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_flags_add>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <handle_zero_flag@plt>
mov    %ebx,%edi
call   1060 <handle_sign_flag@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <handle_carry_flag_add@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1070 <handle_aux_carry_flag_add@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <handle_parity_flag@plt>

LLVM IR (-O0):
define void @handle_flags_add(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @handle_zero_flag(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @handle_sign_flag(i32 %9)
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @handle_carry_flag_add(i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @handle_aux_carry_flag_add(i32 %14, i32 %15)
%17 = load i32, i32* %4
%18 = call i32 @handle_parity_flag(i32 %17)
ret void
}

LLVM IR (-O2):
define void @handle_flags_add(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @handle_zero_flag(i32 %0)
%5 = tail call i32 @handle_sign_flag(i32 %0)
%6 = tail call i32 @handle_carry_flag_add(i32 %1, i32 %2)
%7 = tail call i32 @handle_aux_carry_flag_add(i32 %1, i32 %2)
%8 = tail call i32 @handle_parity_flag(i32 %0)
ret void
}
/* Variables and functions */
int read(int, char *, int);
int read_(int *fd, char buf[], int *n) { return (read(*fd, buf, *n)); }


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

x86 assembly (clang, -O2):
<read_>:
mov    (%rdi),%edi
mov    (%rdx),%edx
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @read_(i32* nocapture %0, i8* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
%6 = tail call i32 @read(i32 %4, i8* %1, i32 %5)
ret i32 %6
}
unsigned clearBit_fun_uint(unsigned x, unsigned i) { return x & ~(1 << i); }


x86 assembly (clang, -O0):
<clearBit_fun_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clearBit_fun_uint(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 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @clearBit_fun_uint(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
const char *__attribute__((no)) get_hello_world(void) { return "hello world"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i8* @get_hello_world() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i8* @get_hello_world() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World!\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, 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 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
int A7_command_writeportln(unsigned char *buff) {
  int buff_len;
  buff_len = A7_command_writeport(buff);
  A7_command_writeport("\n");
  return buff_len + 1;
}


x86 assembly (clang, -O0):
<A7_command_writeportln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <A7_command_writeport@plt>
mov    %eax,-0xc(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <A7_command_writeport@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<A7_command_writeportln>:
push   %rbx
xor    %eax,%eax
call   1030 <A7_command_writeport@plt>
mov    %eax,%ebx
lea    0xedf(%rip),%rdi
xor    %eax,%eax
call   1030 <A7_command_writeport@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @A7_command_writeportln(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @A7_command_writeport to i32 (i8*, ...)*)(i8* %4)
store i32 %5, i32* %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @A7_command_writeport to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @A7_command_writeportln(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @A7_command_writeport to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @A7_command_writeport to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %2, 1
ret i32 %4
}
void UARTFIFOLevelGet(unsigned long ulBase, unsigned long *pulTxLevel,
                      unsigned long *pulRxLevel) {
  unsigned long ulTemp;
  ;
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000034)));
  *pulTxLevel = ulTemp & 0x00000007;
  *pulRxLevel = ulTemp & 0x00000038;
}


x86 assembly (clang, -O0):
<UARTFIFOLevelGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
and    $0x7,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
and    $0x38,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOLevelGet>:
mov    0x34(%rdi),%rax
mov    %eax,%ecx
and    $0x7,%ecx
mov    %rcx,(%rsi)
and    $0x38,%eax
mov    %rax,(%rdx)
ret

LLVM IR (-O0):
define void @UARTFIFOLevelGet(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64
store i64 %0, i64* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%8 = load i64, i64* %4
%9 = add i64 %8, 52
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = and i64 %12, 7
%14 = load i64*, i64** %5
store i64 %13, i64* %14
%15 = load i64, i64* %7
%16 = and i64 %15, 56
%17 = load i64*, i64** %6
store i64 %16, i64* %17
ret void
}

LLVM IR (-O2):
define void @UARTFIFOLevelGet(i64 %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2) {
%4 = add i64 %0, 52
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 7
store i64 %7, i64* %1
%8 = and i64 %6, 56
store i64 %8, i64* %2
ret void
}
regx0adrreg1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[x0]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<regx0adrreg1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movss  0x10f444(%rax),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adrreg1_set>:
movss  0x10f444(%rcx),%xmm0
movslq %edi,%rax
movss  %xmm0,(%rdx,%rax,4)
ret

LLVM IR (-O0):
define i32 @regx0adrreg1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %13
%17 = getelementptr inbounds float, float* %16, i64 277777
%18 = load float, float* %17
%19 = load float*, float** %12
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds float, float* %19, i64 %21
store float %18, float* %22
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @regx0adrreg1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture %5) {
%7 = getelementptr inbounds float, float* %5, i64 277777
%8 = load float, float* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds float, float* %4, i64 %9
store float %8, float* %10
ret i32 undef
}
/* Variables and functions */
int isPrime(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int limit = 10001;
  unsigned int count = 1, num = 1;
  while (count < 10001) {
    num += 2;
    if (isPrime(num) == 1)
      count++;
  }
  printf("%d\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2711,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x2711,-0xc(%rbp)
jae    1179 <main+0x59>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x1,%eax
jne    1174 <main+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x24>
mov    -0x10(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x1,%ebp
nopl   (%rax)
add    $0x2,%ebx
mov    %ebx,%edi
call   1040 <isPrime@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebp
cmp    $0x2711,%ebp
jb     1130 <main+0x10>
lea    0xead(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = phi i32 [ 1, %0 ], [ %8, %1 ]
%4 = add i32 %2, 2
%5 = tail call i32 @isPrime(i32 %4)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %3, %7
%9 = icmp ult i32 %8, 10001
br i1 %9, label %1, label %10
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
struct bpf_prog {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bpf_prog_free(struct bpf_prog *);
int /*<<< orphan*/ bpf_release_orig_filter(struct bpf_prog *);
void __bpf_prog_release(struct bpf_prog *prog) {
  bpf_release_orig_filter(prog);
  bpf_prog_free(prog);
}


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

x86 assembly (clang, -O2):
<__bpf_prog_release>:
push   %rbx
mov    %rdi,%rbx
call   1040 <bpf_release_orig_filter@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <bpf_prog_free@plt>

LLVM IR (-O0):
%struct.bpf_prog = type { i32 }
define void @__bpf_prog_release(%struct.bpf_prog* %0) {
%2 = alloca %struct.bpf_prog*
store %struct.bpf_prog* %0, %struct.bpf_prog** %2
%3 = load %struct.bpf_prog*, %struct.bpf_prog** %2
%4 = call i32 @bpf_release_orig_filter(%struct.bpf_prog* %3)
%5 = load %struct.bpf_prog*, %struct.bpf_prog** %2
%6 = call i32 @bpf_prog_free(%struct.bpf_prog* %5)
ret void
}

LLVM IR (-O2):
%struct.bpf_prog = type { i32 }
define void @__bpf_prog_release(%struct.bpf_prog* %0) {
%2 = tail call i32 @bpf_release_orig_filter(%struct.bpf_prog* %0)
%3 = tail call i32 @bpf_prog_free(%struct.bpf_prog* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void main() {
  for (int i = 0; i < 10; ++i) {
    if (i > 5) {
      putchar('A' + i);
    } else {
      putchar('0' + i);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1161 <main+0x51>
cmpl   $0x5,-0x4(%rbp)
jle    1143 <main+0x33>
mov    -0x4(%rbp),%edi
add    $0x41,%edi
call   1030 <putchar@plt>
jmp    114e <main+0x3e>
mov    -0x4(%rbp),%edi
add    $0x30,%edi
call   1030 <putchar@plt>
jmp    1153 <main+0x43>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    $0x33,%edi
call   1030 <putchar@plt>
mov    $0x34,%edi
call   1030 <putchar@plt>
mov    $0x35,%edi
call   1030 <putchar@plt>
mov    $0x47,%edi
call   1030 <putchar@plt>
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x49,%edi
call   1030 <putchar@plt>
mov    $0x4a,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %17, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %20
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 5
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 65, %9
%11 = call i32 @putchar(i32 %10)
br label %16
12: ; preds = %5
%13 = load i32, i32* %1
%14 = add nsw i32 48, %13
%15 = call i32 @putchar(i32 %14)
br label %16
16: ; preds = %12, %8
br label %17
17: ; preds = %16
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %2
20: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @putchar(i32 48)
%2 = tail call i32 @putchar(i32 49)
%3 = tail call i32 @putchar(i32 50)
%4 = tail call i32 @putchar(i32 51)
%5 = tail call i32 @putchar(i32 52)
%6 = tail call i32 @putchar(i32 53)
%7 = tail call i32 @putchar(i32 71)
%8 = tail call i32 @putchar(i32 72)
%9 = tail call i32 @putchar(i32 73)
%10 = tail call i32 @putchar(i32 74)
ret void
}
int test_imm_CFuint16_mem(unsigned short *val) {
  return ((*val) & (-0xCF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CFuint16_mem>:
movzwl (%rdi),%eax
test   $0xff31,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CFuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -207
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t is_leap_year(uint8_t y) {
  if (y & 0x03 && y != 100 || y != 200) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1120 <is_leap_year+0x20>
cmpl   $0x64,-0x8(%rbp)
jne    112d <is_leap_year+0x2d>
cmpl   $0xc8,-0x8(%rbp)
je     1139 <is_leap_year+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1140 <is_leap_year+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
cmp    $0xc8,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = icmp ne i32 %0, 200
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_smidrange(int, float *, int);
int main() {
  float x[] = {1.0, -2.0, -3.0, 4.0, -5.0, -6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_smidrange(N, x, stride);
  printf("mid-range: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_smidrange@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_smidrange@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [15 x i8] c"mid-range: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_smidrange(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [15 x i8] c"mid-range: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_smidrange(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ expected_pkey_fault(int);
int read_ptr(void *);
int /*<<< orphan*/ sigsafe_printf(char *, void *, int, int);
void expect_fault_on_read_execonly_key(void *p1, int pkey) {
  int ptr_contents;
  ptr_contents = read_ptr(p1);
  do {
    if (2 <= 0)
      sigsafe_printf("ptr (%p) contents@%d: %x\n", p1, 172, ptr_contents);
  } while (0);
  expected_pkey_fault(pkey);
}


x86 assembly (clang, -O0):
<expect_fault_on_read_execonly_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_ptr@plt>
mov    %eax,-0x10(%rbp)
jmp    1140 <expect_fault_on_read_execonly_key+0x20>
mov    -0xc(%rbp),%edi
call   1040 <expected_pkey_fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_fault_on_read_execonly_key>:
push   %rbx
mov    %esi,%ebx
call   1030 <read_ptr@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <expected_pkey_fault@plt>

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

LLVM IR (-O2):
define void @expect_fault_on_read_execonly_key(i8* %0, i32 %1) {
%3 = tail call i32 @read_ptr(i8* %0)
%4 = tail call i32 @expected_pkey_fault(i32 %1)
ret void
}
/* Variables and functions */
char *ft_strcpy(char *, char *);
scalar_t__ malloc(int);
char *ft_strdup(char *src) {
  char *dest;
  int len;
  len = 0;
  while (src[len])
    len++;
  dest = (char *)malloc(sizeof(*dest) * (len + 1));
  return (ft_strcpy(dest, src));
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1153 <ft_strdup+0x33>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <ft_strdup+0x13>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ft_strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rbx,%rdi,1)
lea    0x1(%rdi),%rdi
jne    1130 <ft_strdup+0x10>
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <ft_strcpy@plt>

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

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nuw nsw i32 %9, 1
%11 = tail call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
%13 = tail call i8* @ft_strcpy(i8* %12, i8* %0)
ret i8* %13
}
/* Variables and functions */
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    ;
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <xmalloc+0x29>
jmp    1139 <xmalloc+0x29>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int close(int);
int my_close(int I_iFd) {
  int iRet;
  iRet = close(I_iFd);
  return iRet;
}


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

x86 assembly (clang, -O2):
<my_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @my_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
struct WebPPicture {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ErrorGIFNotAvailable();
void GIFCopyPixels(const struct WebPPicture *const src,
                   struct WebPPicture *const dst) {
  (void)src;
  (void)dst;
  ErrorGIFNotAvailable();
}


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

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

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

LLVM IR (-O2):
%struct.WebPPicture = type { i32 }
define void @GIFCopyPixels(%struct.WebPPicture* nocapture readnone %0, %struct.WebPPicture* nocapture readnone %1) {
%3 = tail call i32 (...) @ErrorGIFNotAvailable()
ret void
}
int is_valid_item(int option, int num_items, int min_items) {
  int valid = 0;
  if ((option >= min_items) && (option <= num_items)) {
    valid = 1;
  }
  return valid;
}


x86 assembly (clang, -O0):
<is_valid_item>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1133 <is_valid_item+0x33>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1133 <is_valid_item+0x33>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_item>:
cmp    %edx,%edi
setge  %al
cmp    %esi,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_item(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
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %7
br label %16
16: ; preds = %15, %11, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_valid_item(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %2
%5 = icmp sle i32 %0, %1
%6 = and i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ e_notr(int);
int /*<<< orphan*/ e_xxxri(int, int, int, int);
void e_xorri(int r, int i) {
  if (i == 0)
    return;
  else if (i == ~0)
    e_notr(r);
  else
    e_xxxri(r, i, 6, 0x35);
}


x86 assembly (clang, -O0):
<e_xorri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113d <e_xorri+0x1d>
jmp    116e <e_xorri+0x4e>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1154 <e_xorri+0x34>
mov    -0x4(%rbp),%edi
call   1030 <e_notr@plt>
jmp    1169 <e_xorri+0x49>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x6,%edx
mov    $0x35,%ecx
call   1040 <e_xxxri@plt>
jmp    116e <e_xorri+0x4e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_xorri>:
test   %esi,%esi
je     112e <e_xorri+0xe>
cmp    $0xffffffff,%esi
jne    112f <e_xorri+0xf>
jmp    1030 <e_notr@plt>
ret
mov    $0x6,%edx
mov    $0x35,%ecx
jmp    1040 <e_xxxri@plt>

LLVM IR (-O0):
define void @e_xorri(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %19
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %3
%13 = call i32 @e_notr(i32 %12)
br label %18
14: ; preds = %8
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 @e_xxxri(i32 %15, i32 %16, i32 6, i32 53)
br label %18
18: ; preds = %14, %11
br label %19
19: ; preds = %7, %18
ret void
}

LLVM IR (-O2):
define void @e_xorri(i32 %0, i32 %1) {
switch i32 %1, label %5 [
i32 0, label %7
i32 -1, label %3
]
3: ; preds = %2
%4 = tail call i32 @e_notr(i32 %0)
br label %7
5: ; preds = %2
%6 = tail call i32 @e_xxxri(i32 %0, i32 %1, i32 6, i32 53)
br label %7
7: ; preds = %2, %3, %5
ret void
}
/* Variables and functions */
int execve(char const *, char **, char **);
int execle(const char *path, const char *arg0, ...) {
  char **env = (char **)&arg0;
  while (!*env)
    env++;
  return execve(path, (char **)&arg0, env);
}


x86 assembly (clang, -O0):
<execle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1142 <execle+0x32>
jmp    1153 <execle+0x43>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <execle+0x18>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x10(%rbp),%rsi
call   1030 <execve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execle>:
push   %rax
mov    %rsi,(%rsp)
test   %rsi,%rsi
je     111f <execle+0xf>
mov    %rsp,%rdx
jmp    113e <execle+0x2e>
mov    %rsp,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x8(%rax),%rdx
cmpq   $0x0,0x8(%rax)
mov    %rdx,%rax
je     1130 <execle+0x20>
mov    %rsp,%rsi
call   1030 <execve@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8** %4, i8*** %5
br label %6
6: ; preds = %11, %2
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
%10 = xor i1 %9, true
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %5
br label %6
14: ; preds = %6
%15 = load i8*, i8** %3
%16 = load i8**, i8*** %5
%17 = call i32 @execve(i8* %15, i8** %4, i8** %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = icmp eq i8* %1, null
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i8** [ %7, %5 ], [ %3, %2 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %5, label %10
10: ; preds = %5, %2
%11 = phi i8** [ %3, %2 ], [ %7, %5 ]
%12 = call i32 @execve(i8* %0, i8** %3, i8** %11)
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void fprint_dec_Rn(FILE *stream, unsigned char n) {
  fprintf(stream, "DEC   R%X                        ", n);
}


x86 assembly (clang, -O0):
<fprint_dec_Rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_dec_Rn>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"DEC R%X \00"
define void @fprint_dec_Rn(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = load i8, i8* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"DEC R%X \00"
define void @fprint_dec_Rn(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t fmt_u64_dec(char *, int /*<<< orphan*/);
int /*<<< orphan*/ print(char *, size_t);
void print_u64_dec(uint64_t val) {
  char buf[18];
  size_t len = fmt_u64_dec(buf, val);
  print(buf, len);
}


x86 assembly (clang, -O0):
<print_u64_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <fmt_u64_dec@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_u64_dec>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%esi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <fmt_u64_dec@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <print@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @print_u64_dec(i32 %0) {
%2 = alloca i32
%3 = alloca [18 x i8]
%4 = alloca i64
store i32 %0, i32* %2
%5 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i64 @fmt_u64_dec(i8* %5, i32 %6)
store i64 %7, i64* %4
%8 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%9 = load i64, i64* %4
%10 = call i32 @print(i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @print_u64_dec(i32 %0) {
%2 = alloca [18 x i8]
%3 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%4 = call i64 @fmt_u64_dec(i8* %3, i32 %0)
%5 = call i32 @print(i8* %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void saidaErro(char msg[100]) {
  fprintf(stderr, "%s: %s\r\n", "Fernando & Audemar WebServer", msg);
  exit(EXIT_FAILURE);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"%s: %s\0D\0A\00"
@.str.1 = [29 x i8] c"Fernando & Audemar WebServer\00"
@EXIT_FAILURE = global i32 0
define void @saidaErro(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int foo(int);
int bar(int c) { return foo(c) + foo(c - 2); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <foo@plt>
mov    %eax,%ebp
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1030 <foo@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo(i32 %3)
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 2
%7 = call i32 @foo(i32 %6)
%8 = add nsw i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
%3 = add nsw i32 %0, -2
%4 = tail call i32 @foo(i32 %3)
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char *, int);
void gator_annotate_marker_color(int color) {
  long long marker_annotation =
      (0x021c | ((long long)color << 16)) & 0x0000ffffffffffffLL;
  kannotate_write((char *)&marker_annotation, 7);
}


x86 assembly (clang, -O0):
<gator_annotate_marker_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x10,%rax
or     $0x21c,%rax
movabs $0xffffffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1030 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_marker_color>:
push   %rax
mov    %edi,%eax
shl    $0x10,%rax
or     $0x21c,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <kannotate_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @gator_annotate_marker_color(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = shl i64 %5, 16
%7 = or i64 540, %6
%8 = and i64 %7, 281474976710655
store i64 %8, i64* %3
%9 = bitcast i64* %3 to i8*
%10 = call i32 @kannotate_write(i8* %9, i32 7)
ret void
}

LLVM IR (-O2):
define void @gator_annotate_marker_color(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = sext i32 %0 to i64
%5 = shl nsw i64 %4, 16
%6 = and i64 %5, 281474976645120
%7 = or i64 %6, 540
store i64 %7, i64* %2
%8 = call i32 @kannotate_write(i8* %3, i32 7)
ret void
}
/* Variables and functions */
unsigned long long __blcfill_u64(unsigned long long);
unsigned long long func_blcfill64(unsigned long long X) {
  return __blcfill_u64(X);
}


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

x86 assembly (clang, -O2):
<func_blcfill64>:
jmp    1030 <__blcfill_u64@plt>

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

LLVM IR (-O2):
define i64 @func_blcfill64(i64 %0) {
%2 = tail call i64 @__blcfill_u64(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int setjmp(int /*<<< orphan*/);
int main() {
  int val;
  jmp_buf env_buffer;
  val = setjmp(env_buffer);
  if (val != 0) {
    printf("出现异常，错误为 %d\n", val);
    exit(0);
  }
  printf("函数调用\n");
  longjmp(env_buffer, 998);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <setjmp@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117c <main+0x3c>
mov    -0x8(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
mov    $0x3e6,%esi
call   1050 <longjmp@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1050 <setjmp@plt>
test   %eax,%eax
jne    1170 <main+0x20>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3e6,%esi
call   1060 <longjmp@plt>
mov    %eax,%esi
lea    0xe87(%rip),%rdi
xor    %ebx,%ebx
mov    %ebx,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\E5\87\BA\E7\8E\B0\E5\BC\82\E5\B8\B8\EF\BC\8C\E9\94\99\E8\AF\AF\E4\B8\BA %d\0A\00"
@.str.1 = [14 x i8] c"\E5\87\BD\E6\95\B0\E8\B0\83\E7\94\A8\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %3
%5 = call i32 @setjmp(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = call i32 @longjmp(i32 %14, i32 998)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"\E5\87\BA\E7\8E\B0\E5\BC\82\E5\B8\B8\EF\BC\8C\E9\94\99\E8\AF\AF\E4\B8\BA %d\0A\00"
@str = [13 x i8] c"\E5\87\BD\E6\95\B0\E8\B0\83\E7\94\A8\00"
define i32 @main() {
%1 = call i32 @setjmp(i32 undef)
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%8 = call i32 @longjmp(i32 undef, i32 998)
unreachable
}
__attribute__((hotpatch(0))) int main(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int show_menu() {
  printf("******************** Menu ***************************\n");
  printf("*  ps   chname kmode switch wait  exit   fork  exec *\n");
  printf("*  pipe pfd    read  write  close show_p debug      *\n");
  printf("*****************************************************\n");
}


x86 assembly (clang, -O0):
<show_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf37(%rip),%rdi
call   1030 <printf@plt>
lea    0xf62(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_menu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf12(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf66(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"******************** Menu ***************************\0A\00"
@.str.1 = [55 x i8] c"* ps chname kmode switch wait exit fork exec *\0A\00"
@.str.2 = [55 x i8] c"* pipe pfd read write close show_p debug *\0A\00"
@.str.3 = [55 x i8] c"*****************************************************\0A\00"
define i32 @show_menu() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@str = [54 x i8] c"******************** Menu ***************************\00"
@str.4 = [54 x i8] c"* ps chname kmode switch wait exit fork exec *\00"
@str.5 = [54 x i8] c"* pipe pfd read write close show_p debug *\00"
@str.6 = [54 x i8] c"*****************************************************\00"
define i32 @show_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.6, i64 0, i64 0))
ret i32 undef
}