xunge/DecIR huggingface dataset:
/* Type definitions */
struct tlsf_arena {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ block_init_island(void *, size_t);
int /*<<< orphan*/ tlsf_arena_add_block(struct tlsf_arena *, void *);
void tlsf_augment(struct tlsf_arena *r, void *begin, size_t length) {
  if (NULL == r)
    return;
  block_init_island(begin, length);
  tlsf_arena_add_block(r, begin);
}


x86 assembly (clang, -O0):
<tlsf_augment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    1145 <tlsf_augment+0x25>
jmp    115f <tlsf_augment+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <block_init_island@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <tlsf_arena_add_block@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlsf_augment>:
test   %rdi,%rdi
je     114c <tlsf_augment+0x2c>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <block_init_island@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <tlsf_arena_add_block@plt>
ret

LLVM IR (-O0):
%struct.tlsf_arena = type { i32 }
define void @tlsf_augment(%struct.tlsf_arena* %0, i8* %1, i64 %2) {
%4 = alloca %struct.tlsf_arena*
%5 = alloca i8*
%6 = alloca i64
store %struct.tlsf_arena* %0, %struct.tlsf_arena** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.tlsf_arena*, %struct.tlsf_arena** %4
%8 = icmp eq %struct.tlsf_arena* null, %7
br i1 %8, label %9, label %10
9: ; preds = %3
br label %17
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @block_init_island(i8* %11, i64 %12)
%14 = load %struct.tlsf_arena*, %struct.tlsf_arena** %4
%15 = load i8*, i8** %5
%16 = call i32 @tlsf_arena_add_block(%struct.tlsf_arena* %14, i8* %15)
br label %17
17: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
%struct.tlsf_arena = type { i32 }
define void @tlsf_augment(%struct.tlsf_arena* %0, i8* %1, i64 %2) {
%4 = icmp eq %struct.tlsf_arena* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @block_init_island(i8* %1, i64 %2)
%7 = tail call i32 @tlsf_arena_add_block(%struct.tlsf_arena* %0, i8* %1)
br label %8
8: ; preds = %3, %5
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ caddr;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ err(int, char *);
int accept_connection(int sock) {
  struct sockaddr caddr;
  socklen_t caddrlen = sizeof(caddr);
  int client;
  client = accept(sock, &caddr, &caddrlen);
  if (client == -1)
    err(1, "error accepting connection");
  return client;
}


x86 assembly (clang, -O0):
<accept_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1160 <accept_connection+0x40>
mov    $0x1,%edi
lea    0xea5(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_connection>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <accept@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1154 <accept_connection+0x34>
lea    0xeb6(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [27 x i8] c"error accepting connection\00"
define i32 @accept_connection(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%6 = load i32, i32* %2
%7 = call i32 @accept(i32 %6, %struct.sockaddr* %3, i32* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @err(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [27 x i8] c"error accepting connection\00"
define i32 @accept_connection(i32 %0) {
%2 = alloca %struct.sockaddr
%3 = alloca i32
%4 = bitcast %struct.sockaddr* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = call i32 @accept(i32 %0, %struct.sockaddr* %2, i32* %3)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret i32 %6
}
int test_imm_3Dint64_midword_reg(long long val) {
  return ((val >> 16) & (0x3D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Dint64_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, 61
%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_3Dint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3997696
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *realloc(char *, int);
char *resize(char *p, int cap) { return realloc(p, sizeof(char) * (cap + 10)); }


x86 assembly (clang, -O0):
<resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
add    $0xa,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize>:
add    $0xa,%esi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @resize(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 10
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i8* @realloc(i8* %5, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @resize(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 10
%4 = tail call i8* @realloc(i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
char *strrchr(char *, char);
int lastIndexOf(char *string, char searchFor) {
  char *ptr_my;
  ptr_my = strrchr(string, searchFor);
  if (ptr_my == NULL)
    return -1;
  int i = -1;
  i = (ptr_my - string + 1);
  return i;
}


x86 assembly (clang, -O0):
<lastIndexOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114a <lastIndexOf+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <lastIndexOf+0x59>
movl   $0xffffffff,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastIndexOf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strrchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
add    $0x1,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lastIndexOf(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %5
%10 = call i8* @strrchr(i8* %8, i8 signext %9)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
store i32 -1, i32* %7
%15 = load i8*, i8** %6
%16 = load i8*, i8** %4
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
%20 = add nsw i64 %19, 1
%21 = trunc i64 %20 to i32
store i32 %21, i32* %7
%22 = load i32, i32* %7
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @lastIndexOf(i8* %0, i8 signext %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = add i32 %8, 1
%10 = select i1 %4, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ calc_new_num(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ read_input();
int main(void) {
  uint32_t num = 0;
  while (true) {
    uint32_t opcode = read_input();
    num = calc_new_num(num, opcode);
    *(volatile uint32_t *)0x20000000 = num;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <read_input@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <calc_new_num@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x20000000,%eax
mov    %ecx,(%rax)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <read_input@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <calc_new_num@plt>
mov    %eax,%ebx
mov    %eax,0x20000000
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @read_input()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @calc_new_num(i32 %6, i32 %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
store volatile i32 %9, i32* inttoptr (i64 536870912 to i32*)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @read_input()
%4 = tail call i32 @calc_new_num(i32 %2, i32 %3)
store volatile i32 %4, i32* inttoptr (i64 536870912 to i32*)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
struct atm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
void date_never(struct atm *tm, struct atm *now, int *num) {
  time_t n = 0;
  localtime_r(&n, (struct tm *)tm);
}


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

x86 assembly (clang, -O2):
<date_never>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime_r@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.atm = type { i32 }
%struct.tm = type { i32 }
define void @date_never(%struct.atm* %0, %struct.atm* %1, i32* %2) {
%4 = alloca %struct.atm*
%5 = alloca %struct.atm*
%6 = alloca i32*
%7 = alloca i32
store %struct.atm* %0, %struct.atm** %4
store %struct.atm* %1, %struct.atm** %5
store i32* %2, i32** %6
store i32 0, i32* %7
%8 = load %struct.atm*, %struct.atm** %4
%9 = bitcast %struct.atm* %8 to %struct.tm*
%10 = call i32 @localtime_r(i32* %7, %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.atm = type { i32 }
%struct.tm = type { i32 }
define void @date_never(%struct.atm* %0, %struct.atm* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = bitcast %struct.atm* %0 to %struct.tm*
%7 = call i32 @localtime_r(i32* %4, %struct.tm* %6)
ret void
}
void rotr(int *a, int *b, int *c) {
  int rotate;
  rotate = *a;
  *a = *c;
  *c = *b;
  *b = rotate;
}


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

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(int);
int /*<<< orphan*/ debugc(char *);
int /*<<< orphan*/ debugi(char *, int);
int main(void) {
  debug(1);
  debugc("This is a debug test");
  debugi("Test", 233333);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <debug@plt>
lea    0xeb0(%rip),%rdi
call   1040 <debugc@plt>
lea    0xeb9(%rip),%rdi
mov    $0x38f75,%esi
call   1050 <debugi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <debug@plt>
lea    0xebe(%rip),%rdi
call   1040 <debugc@plt>
lea    0xec7(%rip),%rdi
mov    $0x38f75,%esi
call   1050 <debugi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"This is a debug test\00"
@.str.1 = [5 x i8] c"Test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @debug(i32 1)
%3 = call i32 @debugc(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @debugi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 233333)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"This is a debug test\00"
@.str.1 = [5 x i8] c"Test\00"
define i32 @main() {
%1 = tail call i32 @debug(i32 1)
%2 = tail call i32 @debugc(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @debugi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 233333)
ret i32 0
}
/* Variables and functions */
float __builtin_wasm_min_f32(float, float);
scalar_t__ isnan(float);
float fminf(float x, float y) {
  if (isnan(x))
    return y;
  if (isnan(y))
    return x;
  return __builtin_wasm_min_f32(x, y);
}


x86 assembly (clang, -O0):
<fminf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     1155 <fminf+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118c <fminf+0x6c>
movss  -0xc(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     1178 <fminf+0x58>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118c <fminf+0x6c>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <__builtin_wasm_min_f32@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminf>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1040 <isnan@plt>
test   %rax,%rax
je     113d <fminf+0x1d>
movss  (%rsp),%xmm0
pop    %rax
ret
movss  (%rsp),%xmm0
call   1040 <isnan@plt>
test   %rax,%rax
je     1154 <fminf+0x34>
movss  0x4(%rsp),%xmm0
pop    %rax
ret
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
pop    %rax
jmp    1030 <__builtin_wasm_min_f32@plt>

LLVM IR (-O0):
define float @fminf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = call i64 @isnan(float %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %5
store float %10, float* %3
br label %21
11: ; preds = %2
%12 = load float, float* %5
%13 = call i64 @isnan(float %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load float, float* %4
store float %16, float* %3
br label %21
17: ; preds = %11
%18 = load float, float* %4
%19 = load float, float* %5
%20 = call float @__builtin_wasm_min_f32(float %18, float %19)
store float %20, float* %3
br label %21
21: ; preds = %17, %15, %9
%22 = load float, float* %3
ret float %22
}

LLVM IR (-O2):
define float @fminf(float %0, float %1) {
%3 = tail call i64 @isnan(float %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i64 @isnan(float %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call float @__builtin_wasm_min_f32(float %0, float %1)
br label %10
10: ; preds = %5, %2, %8
%11 = phi float [ %9, %8 ], [ %1, %2 ], [ %0, %5 ]
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_ListMaps_f(void *);
void Svcmd_ListMapsWrapper(void) { Cmd_ListMaps_f(((void *)0)); }


x86 assembly (clang, -O0):
<Svcmd_ListMapsWrapper>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <Cmd_ListMaps_f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_ListMapsWrapper>:
xor    %edi,%edi
jmp    1030 <Cmd_ListMaps_f@plt>

LLVM IR (-O0):
define void @Svcmd_ListMapsWrapper() {
%1 = call i32 @Cmd_ListMaps_f(i8* null)
ret void
}

LLVM IR (-O2):
define void @Svcmd_ListMapsWrapper() {
%1 = tail call i32 @Cmd_ListMaps_f(i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void version() {
  write(2,
        "waitmax version 1.1\n"
        "Copyright Mathias Kettner 2008\n"
        "This is free software; see the source for copying conditions.  There "
        "is NO\n"
        "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
        "PURPOSE.\n",
        strlen("waitmax version 1.1\n"
               "Copyright Mathias Kettner 2008\n"
               "This is free software; see the source for copying conditions.  "
               "There is NO\n"
               "warranty; not even for MERCHANTABILITY or FITNESS FOR A "
               "PARTICULAR PURPOSE.\n"));
  ;
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x2,%edi
lea    0xeb2(%rip),%rsi
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [203 x i8] c"waitmax version 1.1\0ACopyright Mathias Kettner 2008\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
define void @version() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([203 x i8], [203 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write(i32 2, i8* getelementptr inbounds ([203 x i8], [203 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [203 x i8] c"waitmax version 1.1\0ACopyright Mathias Kettner 2008\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
define void @version() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([203 x i8], [203 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([203 x i8], [203 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void testaPID(pid_t *pid) {
  if (*pid < 0) {
    printf("Erro ao criar processo\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<testaPID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jge    1150 <testaPID+0x30>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testaPID>:
push   %rax
cmpq   $0x0,(%rdi)
js     1129 <testaPID+0x9>
pop    %rax
ret
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Erro ao criar processo\0A\00"
define void @testaPID(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Erro ao criar processo\00"
define void @testaPID(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_DETACH;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
long ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
            int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int ptrace_detach(pid_t pid) {
  long ret = 0;
  ret = ptrace(PTRACE_DETACH, pid, NULL, NULL);
  if (ret != 0) {
    fprintf(stderr, "ptrace poketext error\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1040 <ptrace@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117b <ptrace_detach+0x5b>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <ptrace_detach+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_detach>:
push   %rbx
mov    %edi,%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <ptrace@plt>
test   %rax,%rax
je     1156 <ptrace_detach+0x36>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PTRACE_DETACH = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"ptrace poketext error\0A\00"
define i32 @ptrace_detach(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 0, i64* %4
%5 = load i32, i32* @PTRACE_DETACH
%6 = load i32, i32* %3
%7 = call i64 @ptrace(i32 %5, i32 %6, i32* null, i32* null)
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@PTRACE_DETACH = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"ptrace poketext error\0A\00"
define i32 @ptrace_detach(i32 %0) {
%2 = load i32, i32* @PTRACE_DETACH
%3 = tail call i64 @ptrace(i32 %2, i32 %0, i32* null, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
struct pgpool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pgp_destroy(struct pgpool *);
void __pgp_destroy_agent(void *alloc) { pgp_destroy((struct pgpool *)alloc); }


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

x86 assembly (clang, -O2):
<__pgp_destroy_agent>:
jmp    1030 <pgp_destroy@plt>

LLVM IR (-O0):
%struct.pgpool = type { i32 }
define void @__pgp_destroy_agent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.pgpool*
%5 = call i32 @pgp_destroy(%struct.pgpool* %4)
ret void
}

LLVM IR (-O2):
%struct.pgpool = type { i32 }
define void @__pgp_destroy_agent(i8* %0) {
%2 = bitcast i8* %0 to %struct.pgpool*
%3 = tail call i32 @pgp_destroy(%struct.pgpool* %2)
ret void
}
/* Variables and functions */
scalar_t__ is_alpha(unsigned char);
scalar_t__ is_digit(unsigned char);
int is_id(unsigned char c) { return is_alpha(c) || is_digit(c) || c == '_'; }


x86 assembly (clang, -O0):
<is_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <is_alpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1171 <is_id+0x51>
movzbl -0x1(%rbp),%edi
call   1030 <is_digit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1171 <is_id+0x51>
movzbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_id>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <is_alpha@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    114b <is_id+0x2b>
movzbl %bpl,%edi
call   1030 <is_digit@plt>
test   %rax,%rax
jne    114b <is_id+0x2b>
xor    %ebx,%ebx
cmp    $0x5f,%bpl
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_id(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_alpha(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_digit(i8 zeroext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 95
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_id(i8 zeroext %0) {
%2 = tail call i64 @is_alpha(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @is_digit(i8 zeroext %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = icmp eq i8 %0, 95
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %4, %1
%11 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %9, %7 ]
ret i32 %11
}
int test_imm_95int32_reg(int val) { return ((val) & (0x95 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_95int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x95,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_95int32_reg(i32 %0) {
%2 = and i32 %0, 149
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ do_stuff(int);
int main() {
  int count_items = 10;
  do_stuff(count_items);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <do_stuff@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <do_stuff@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @do_stuff(i32 10)
ret i32 0
}
int isVisited(int *visited, int vx) { return (visited[vx]); }


x86 assembly (clang, -O0):
<isVisited>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isVisited>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @isVisited(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @isVisited(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int test_imm_89int64_highword_reg(long long val) {
  return ((val >> 32) & (0x89 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_89int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 137
%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_89int64_highword_reg(i64 %0) {
%2 = and i64 %0, 588410519552
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int enable_irq_wake(unsigned int irq) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @enable_irq_wake(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: repcharcount [file|-]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: repcharcount [file|-]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [30 x i8] c"Usage: repcharcount [file|-]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ addEnv(char *, char *);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void addEnvInt(char *k, int v) {
  char *toStr = malloc(21);
  sprintf(toStr, "%d", v);
  addEnv(k, toStr);
}


x86 assembly (clang, -O0):
<addEnvInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x15,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xea5(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <addEnv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addEnvInt>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0x15,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xeb3(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <addEnv@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @addEnvInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i8* @malloc(i32 21)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %5
%12 = call i32 @addEnv(i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @addEnvInt(i8* %0, i32 %1) {
%3 = tail call dereferenceable_or_null(21) i8* @malloc(i32 21)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = tail call i32 @addEnv(i8* %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int);
void mergeSort(int vec[], int vetsize) {
  int md;
  if (vetsize > 1) {
    md = vetsize / 2;
    mergeSort(vec, md);
    mergeSort(vec + md, vetsize - md);
    merge(vec, vetsize);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1179 <mergeSort+0x59>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    $0x1,%esi
jle    1154 <mergeSort+0x34>
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
mov    %ebx,%esi
call   1030 <mergeSort@plt>
lea    (%r14,%rbx,4),%rdi
mov    %ebp,%esi
sub    %ebx,%esi
call   1030 <mergeSort@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @mergeSort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %23
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 2
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sub nsw i32 %17, %18
%20 = load i32*, i32** %3
%21 = load i32, i32* %4
%22 = call i32 @merge(i32* %20, i32 %21)
br label %23
23: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i32 %1, 1
tail call void @mergeSort(i32* %0, i32 %6)
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = sub nsw i32 %1, %6
tail call void @mergeSort(i32* %8, i32 %9)
%10 = tail call i32 @merge(i32* %0, i32 %1)
br label %4
}
/* Variables and functions */
int is_peripheral_secure(unsigned int);
unsigned int sys_mask_to_per_id(unsigned int);
int is_sys_clk_secure(unsigned int sys_mask) {
  unsigned int periph_id = sys_mask_to_per_id(sys_mask);
  return is_peripheral_secure(periph_id);
}


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

x86 assembly (clang, -O2):
<is_sys_clk_secure>:
push   %rax
call   1040 <sys_mask_to_per_id@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <is_peripheral_secure@plt>

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

LLVM IR (-O2):
define i32 @is_sys_clk_secure(i32 %0) {
%2 = tail call i32 @sys_mask_to_per_id(i32 %0)
%3 = tail call i32 @is_peripheral_secure(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ recv_ec_data();
int /*<<< orphan*/ send_ec_command(int);
int /*<<< orphan*/ send_ec_data(int);
uint8_t ec_ext_read(uint16_t addr) {
  send_ec_command(0x81);
  send_ec_data(0x02);
  send_ec_data(addr & 0xff);
  send_ec_command(0xf0);
  send_ec_data(addr >> 8);
  return recv_ec_data();
}


x86 assembly (clang, -O0):
<ec_ext_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x81,%edi
call   1030 <send_ec_command@plt>
mov    $0x2,%edi
call   1050 <send_ec_data@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1050 <send_ec_data@plt>
mov    $0xf0,%edi
call   1030 <send_ec_command@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
call   1050 <send_ec_data@plt>
mov    $0x0,%al
call   1040 <recv_ec_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_ext_read>:
push   %rbx
mov    %edi,%ebx
mov    $0x81,%edi
call   1030 <send_ec_command@plt>
mov    $0x2,%edi
call   1050 <send_ec_data@plt>
movzbl %bl,%edi
call   1050 <send_ec_data@plt>
mov    $0xf0,%edi
call   1030 <send_ec_command@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
call   1050 <send_ec_data@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <recv_ec_data@plt>

LLVM IR (-O0):
define i32 @ec_ext_read(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @send_ec_command(i32 129)
%4 = call i32 @send_ec_data(i32 2)
%5 = load i32, i32* %2
%6 = and i32 %5, 255
%7 = call i32 @send_ec_data(i32 %6)
%8 = call i32 @send_ec_command(i32 240)
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = call i32 @send_ec_data(i32 %10)
%12 = call i32 (...) @recv_ec_data()
ret i32 %12
}

LLVM IR (-O2):
define i32 @ec_ext_read(i32 %0) {
%2 = tail call i32 @send_ec_command(i32 129)
%3 = tail call i32 @send_ec_data(i32 2)
%4 = and i32 %0, 255
%5 = tail call i32 @send_ec_data(i32 %4)
%6 = tail call i32 @send_ec_command(i32 240)
%7 = ashr i32 %0, 8
%8 = tail call i32 @send_ec_data(i32 %7)
%9 = tail call i32 (...) @recv_ec_data()
ret i32 %9
}
int Byte2Percentile(int vByte) { return (vByte * 100) / 255; }


x86 assembly (clang, -O0):
<Byte2Percentile>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x64,-0x4(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Byte2Percentile>:
imul   $0x64,%edi,%eax
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x7,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Byte2Percentile(i32 %0) {
%2 = mul nsw i32 %0, 100
%3 = sdiv i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ do_it();
scalar_t__ last();
__attribute__((no, noclone)) void f4(void) {
  while (1)
    if (last())
      break;
    else
      do_it();
  do_it();
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <f4+0x9>
mov    $0x0,%al
call   1030 <last@plt>
cmp    $0x0,%rax
je     113f <f4+0x1f>
jmp    114b <f4+0x2b>
mov    $0x0,%al
call   1040 <do_it@plt>
jmp    1129 <f4+0x9>
mov    $0x0,%al
call   1040 <do_it@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <last@plt>
test   %rax,%rax
jne    1145 <f4+0x25>
xor    %eax,%eax
call   1040 <do_it@plt>
jmp    1130 <f4+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1040 <do_it@plt>

LLVM IR (-O0):
define void @f4() {
br label %1
1: ; preds = %0, %7
%2 = call i64 (...) @last()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %8
5: ; preds = %1
%6 = call i32 (...) @do_it()
br label %7
7: ; preds = %5
br label %1
8: ; preds = %4
%9 = call i32 (...) @do_it()
ret void
}

LLVM IR (-O2):
define void @f4() {
%1 = tail call i64 (...) @last()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @do_it()
%5 = tail call i64 (...) @last()
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
%8 = tail call i32 (...) @do_it()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xerror;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xerror_type(void *_p) {
  return (int)((XEvent *)_p)->xerror.type;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xerror_type>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XEvent_xerror_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ send(int, void *, size_t, int /*<<< orphan*/);
ssize_t mywrite_swift_balancer(int fd, void *buf, size_t len) {
  return send(fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<mywrite_swift_balancer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mywrite_swift_balancer>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

LLVM IR (-O0):
define i32 @mywrite_swift_balancer(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 i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @send(i32 %7, i8* %8, i64 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mywrite_swift_balancer(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  for (; n >= 0;) {
    printf("Eu adoro programar\n");
    --n;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     1163 <main+0x43>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
js     1167 <main+0x47>
lea    0xebf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [20 x i8] c"Eu adoro programar\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [19 x i8] c"Eu adoro programar\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp sgt i32 %8, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hel");
  return 0;
}


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

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

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

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