#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 run_smp4_tests(int, char const **);
int smp4_main(int, char const **);
int /*<<< orphan*/ strcmp(char const *, char *);
int main(int argc, const char **argv) {
  if (argc > 1 && !strcmp(argv[1], "-test")) {
    return run_smp4_tests(argc - 1, argv + 1);
  } else {
    return smp4_main(argc, argv);
  }
}


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   $0x1,-0x8(%rbp)
jle    1188 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1188 <main+0x58>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <run_smp4_tests@plt>
mov    %eax,-0x4(%rbp)
jmp    1197 <main+0x67>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <smp4_main@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
jl     1151 <main+0x21>
mov    0x8(%rbx),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1161 <main+0x31>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <smp4_main@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <run_smp4_tests@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"-test\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 sgt i32 %6, 1
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %8
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = call i32 @run_smp4_tests(i32 %16, i8** %18)
store i32 %19, i32* %3
br label %24
20: ; preds = %8, %2
%21 = load i32, i32* %4
%22 = load i8**, i8*** %5
%23 = call i32 @smp4_main(i32 %21, i8** %22)
store i32 %23, i32* %3
br label %24
24: ; preds = %20, %14
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [6 x i8] c"-test\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = add nsw i32 %0, -1
%11 = tail call i32 @run_smp4_tests(i32 %10, i8** %5)
br label %14
12: ; preds = %4, %2
%13 = tail call i32 @smp4_main(i32 %0, i8** %1)
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %13, %12 ], [ %11, %9 ]
ret i32 %15
}