#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ explode_mem();
int /*<<< orphan*/ kill_process(int);
int /*<<< orphan*/ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/, int);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void start() {
  kill_process(false);
  pthread_t pth_mem;
  pthread_t pth_process;
  int i = 0;
  pthread_create(&pth_mem, NULL, explode_mem(), NULL);
  pthread_create(&pth_process, NULL, kill_process(true), true);
  pthread_join(pth_mem, NULL);
  pthread_join(pth_process, NULL);
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <kill_process@plt>
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <explode_mem@plt>
mov    %eax,%edx
lea    -0x4(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1050 <pthread_create@plt>
mov    $0x1,%edi
call   1030 <kill_process@plt>
mov    %eax,%edx
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%ecx
call   1050 <pthread_create@plt>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <pthread_join@plt>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <pthread_join@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rax
xor    %edi,%edi
call   1030 <kill_process@plt>
xor    %eax,%eax
call   1040 <explode_mem@plt>
lea    0x4(%rsp),%rdi
xor    %esi,%esi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <pthread_create@plt>
mov    $0x1,%edi
call   1030 <kill_process@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    %eax,%edx
mov    $0x1,%ecx
call   1050 <pthread_create@plt>
mov    0x4(%rsp),%edi
xor    %esi,%esi
call   1060 <pthread_join@plt>
mov    (%rsp),%edi
xor    %esi,%esi
call   1060 <pthread_join@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @start() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @kill_process(i32 0)
store i32 0, i32* %3
%5 = call i32 (...) @explode_mem()
%6 = call i32 @pthread_create(i32* %1, i32* null, i32 %5, i32 0)
%7 = call i32 @kill_process(i32 1)
%8 = call i32 @pthread_create(i32* %2, i32* null, i32 %7, i32 1)
%9 = load i32, i32* %1
%10 = call i32 @pthread_join(i32 %9, i32* null)
%11 = load i32, i32* %2
%12 = call i32 @pthread_join(i32 %11, i32* null)
ret void
}

LLVM IR (-O2):
define void @start() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @kill_process(i32 0)
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 (...) @explode_mem()
%7 = call i32 @pthread_create(i32* %1, i32* null, i32 %6, i32 0)
%8 = call i32 @kill_process(i32 1)
%9 = call i32 @pthread_create(i32* %2, i32* null, i32 %8, i32 1)
%10 = load i32, i32* %1
%11 = call i32 @pthread_join(i32 %10, i32* null)
%12 = load i32, i32* %2
%13 = call i32 @pthread_join(i32 %12, i32* null)
ret void
}