#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 */

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ run_threads_join_immediate();
int /*<<< orphan*/ run_threads_join_later();
int /*<<< orphan*/ run_threads_join_later_lock();
int main(const int argc, const char **argv) {
  printf("%s\n", "*******************");
  run_threads_join_immediate();
  printf("%s\n", "*******************");
  run_threads_join_later();
  printf("%s\n", "*******************");
  run_threads_join_later_lock();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <run_threads_join_immediate@plt>
lea    0xe79(%rip),%rdi
lea    0xe76(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <run_threads_join_later@plt>
lea    0xe5f(%rip),%rdi
lea    0xe5c(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <run_threads_join_later_lock@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%rbx
lea    0xea2(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <run_threads_join_immediate@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <run_threads_join_later@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <run_threads_join_later_lock@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [20 x i8] c"*******************\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @run_threads_join_immediate()
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @run_threads_join_later()
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (...) @run_threads_join_later_lock()
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [20 x i8] c"*******************\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @run_threads_join_immediate()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @run_threads_join_later()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (...) @run_threads_join_later_lock()
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}