#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_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test_add_char();
int /*<<< orphan*/ test_all_whitespace();
int /*<<< orphan*/ test_split();
int /*<<< orphan*/ test_sprintf();
int /*<<< orphan*/ test_sscanf();
int /*<<< orphan*/ test_trim();
int main(int argc, char *argv[]) {
  if (argc != 1) {
    int i;
    printf("Unused arguments: %s", argv[1]);
    for (i = 2; i < argc; i++) {
      printf(", %s", argv[i]);
    }
    printf("\n");
    exit(EXIT_FAILURE);
  }
  test_sscanf();
  test_add_char();
  test_sprintf();
  test_all_whitespace();
  test_split();
  test_trim();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     120d <main+0x8d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f1 <main+0x71>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bd <main+0x3d>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2dda(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    $0x0,%al
call   1050 <test_sscanf@plt>
mov    $0x0,%al
call   1080 <test_add_char@plt>
mov    $0x0,%al
call   1090 <test_sprintf@plt>
mov    $0x0,%al
call   1030 <test_all_whitespace@plt>
mov    $0x0,%al
call   1070 <test_split@plt>
mov    $0x0,%al
call   1060 <test_trim@plt>
mov    0x2d9a(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    11da <main+0x4a>
xor    %eax,%eax
call   1060 <test_sscanf@plt>
xor    %eax,%eax
call   1090 <test_add_char@plt>
xor    %eax,%eax
call   10a0 <test_sprintf@plt>
xor    %eax,%eax
call   1040 <test_all_whitespace@plt>
xor    %eax,%eax
call   1080 <test_split@plt>
xor    %eax,%eax
call   1070 <test_trim@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rsi
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x3,%ebp
jl     1227 <main+0x97>
mov    %ebp,%r15d
mov    $0x2,%ebp
lea    0xe10(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%rbp,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1210 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Unused arguments: %s\00"
@.str.1 = [5 x i8] c", %s\00"
@.str.2 = [2 x i8] c"\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %32
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 2, i32* %6
br label %14
14: ; preds = %25, %9
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i8**, i8*** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %18
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %14
28: ; preds = %14
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %2
%33 = call i32 (...) @test_sscanf()
%34 = call i32 (...) @test_add_char()
%35 = call i32 (...) @test_sprintf()
%36 = call i32 (...) @test_all_whitespace()
%37 = call i32 (...) @test_split()
%38 = call i32 (...) @test_trim()
%39 = load i32, i32* @EXIT_SUCCESS
ret i32 %39
}

LLVM IR (-O2):
@.str = [21 x i8] c"Unused arguments: %s\00"
@.str.1 = [5 x i8] c", %s\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %22, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = icmp sgt i32 %0, 2
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 2, %9 ], [ %16, %11 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = add nuw nsw i64 %12, 1
%17 = icmp eq i64 %16, %10
br i1 %17, label %18, label %11
18: ; preds = %11, %4
%19 = tail call i32 @putchar(i32 10)
%20 = load i32, i32* @EXIT_FAILURE
%21 = tail call i32 @exit(i32 %20)
unreachable
22: ; preds = %2
%23 = tail call i32 (...) @test_sscanf()
%24 = tail call i32 (...) @test_add_char()
%25 = tail call i32 (...) @test_sprintf()
%26 = tail call i32 (...) @test_all_whitespace()
%27 = tail call i32 (...) @test_split()
%28 = tail call i32 (...) @test_trim()
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}