#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*/ atoi(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int getopt(int, char **, char *);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ usage(char *);
int write_sh_tests(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int opt;
  while ((opt = getopt(argc, argv, "s:")) != -1) {
    switch (opt) {
    case 's':
      return (write_sh_tests(argv[0], atoi(optarg)));
    default:
      usage(argv[0]);
      exit(1);
    }
  }
  usage(argv[0]);
  exit(1);
}


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe8c(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     11d6 <main+0x86>
mov    -0x14(%rbp),%eax
sub    $0x73,%eax
jne    11c0 <main+0x70>
jmp    1196 <main+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1060 <atoi@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <write_sh_tests@plt>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
lea    0xea5(%rip),%rdx
call   1050 <getopt@plt>
cmp    $0x73,%eax
jne    1181 <main+0x31>
mov    (%rbx),%rbx
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1060 <atoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <write_sh_tests@plt>
cmp    $0xffffffff,%eax
mov    (%rbx),%rdi
call   1040 <usage@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"s:\00"
@optarg = 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
br label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @getopt(i32 %8, i8** %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %6
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %27
12: ; preds = %7
%13 = load i32, i32* %6
switch i32 %13, label %21 [
i32 115, label %14
]
14: ; preds = %12
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = load i32, i32* @optarg
%19 = call i32 @atoi(i32 %18)
%20 = call i32 @write_sh_tests(i8* %17, i32 %19)
ret i32 %20
21: ; preds = %12
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @usage(i8* %24)
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %7
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 0
%30 = load i8*, i8** %29
%31 = call i32 @usage(i8* %30)
%32 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"s:\00"
@optarg = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
switch i32 %3, label %9 [
i32 -1, label %13
i32 115, label %4
]
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = load i32, i32* @optarg
%7 = tail call i32 @atoi(i32 %6)
%8 = tail call i32 @write_sh_tests(i8* %5, i32 %7)
ret i32 %8
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 @usage(i8* %10)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %1
%15 = tail call i32 @usage(i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
}