#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*/ assert(int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ test_break_continue_thread();
int /*<<< orphan*/ test_syscall_thread();
int main(int argc, char **argv) {
  assert(argc >= 2);
  if (strcmp(argv[1], "break_continue_thread") == 0) {
    test_break_continue_thread();
    return 0;
  }
  if (strcmp(argv[1], "syscall_thread") == 0) {
    test_syscall_thread();
    return 0;
  }
  return 1;
}


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)
cmpl   $0x2,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1198 <main+0x58>
mov    $0x0,%al
call   1060 <test_break_continue_thread@plt>
movl   $0x0,-0x4(%rbp)
jmp    11d0 <main+0x90>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11c9 <main+0x89>
mov    $0x0,%al
call   1050 <test_syscall_thread@plt>
movl   $0x0,-0x4(%rbp)
jmp    11d0 <main+0x90>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x2,%edi
setge  %al
mov    %eax,%edi
call   1040 <assert@plt>
mov    0x8(%rbx),%rdi
lea    0xea2(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     118d <main+0x4d>
mov    0x8(%rbx),%rdi
lea    0xea3(%rip),%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1196 <main+0x56>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <test_syscall_thread@plt>
jmp    1196 <main+0x56>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <test_break_continue_thread@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"break_continue_thread\00"
@.str.1 = [15 x i8] c"syscall_thread\00"
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 = load i32, i32* %4
%7 = icmp sge i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @test_break_continue_thread()
store i32 0, i32* %3
br label %26
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = call i32 (...) @test_syscall_thread()
store i32 0, i32* %3
br label %26
25: ; preds = %17
store i32 1, i32* %3
br label %26
26: ; preds = %25, %23, %15
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [22 x i8] c"break_continue_thread\00"
@.str.1 = [15 x i8] c"syscall_thread\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @test_break_continue_thread()
br label %18
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call i32 (...) @test_syscall_thread()
br label %18
18: ; preds = %12, %16, %10
%19 = phi i32 [ 0, %10 ], [ 0, %16 ], [ 1, %12 ]
ret i32 %19
}