#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 */
typedef int int32_t;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ check_string_is_number(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int getopt(int, char **, char *);
int /*<<< orphan*/ mic_call(int);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ print_help(char **, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strrchr(char *, char);
int main(int argc, char **argv) {
  int32_t opt;
  int32_t num_of_measurements = 1;
  while ((opt = getopt(argc, argv, "h?n:")) != -1) {
    switch (opt) {
    case 'n':
      if (!check_string_is_number(optarg)) {
        fprintf(
            stderr, "Error (file: %s, line: %i): %s\n",
            (strrchr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/akiml/ampehre/refs/"
                     "heads/master/misc/tools/mic_reader/mic_reader.c",
                     '/')
                 ? strrchr("/scratch/repos/new/home/jordi_armengol_estape/"
                           "c-scraper/outputs/2022-01-22/02-19-57/repos/akiml/"
                           "ampehre/refs/heads/master/misc/tools/mic_reader/"
                           "mic_reader.c",
                           '/') +
                       1
                 : "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/akiml/ampehre/refs/heads/"
                   "master/misc/tools/mic_reader/mic_reader.c"),
            39, "The argument of option 'n' is not a positive number.");
        print_help(argv, 1);
        return EXIT_FAILURE;
      }
      num_of_measurements = atoi(optarg);
      if (num_of_measurements < 1) {
        fprintf(
            stderr, "Error (file: %s, line: %i): %s\n",
            (strrchr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/akiml/ampehre/refs/"
                     "heads/master/misc/tools/mic_reader/mic_reader.c",
                     '/')
                 ? strrchr("/scratch/repos/new/home/jordi_armengol_estape/"
                           "c-scraper/outputs/2022-01-22/02-19-57/repos/akiml/"
                           "ampehre/refs/heads/master/misc/tools/mic_reader/"
                           "mic_reader.c",
                           '/') +
                       1
                 : "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/akiml/ampehre/refs/heads/"
                   "master/misc/tools/mic_reader/mic_reader.c"),
            45, "The argument of option 'n' must be > 0.");
        print_help(argv, 1);
        return EXIT_FAILURE;
      }
      break;
    case '?':
    case 'h':
    default:
      print_help(argv, 1);
      return EXIT_FAILURE;
    }
  }
  mic_call(num_of_measurements);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe65(%rip),%rdx
call   1070 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1368 <main+0x1f8>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x3f,%eax
je     133f <main+0x1cf>
jmp    11c0 <main+0x50>
mov    -0x1c(%rbp),%eax
sub    $0x68,%eax
je     133f <main+0x1cf>
jmp    11d1 <main+0x61>
mov    -0x1c(%rbp),%eax
sub    $0x6e,%eax
jne    1344 <main+0x1d4>
jmp    11e2 <main+0x72>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
call   1030 <check_string_is_number@plt>
cmp    $0x0,%eax
jne    128c <main+0x11c>
mov    0x2dd8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
lea    0xe19(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
cmp    $0x0,%eax
je     123e <main+0xce>
lea    0xdff(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x28(%rbp)
jmp    124e <main+0xde>
lea    0xde0(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    124e <main+0xde>
mov    -0x20(%rbp),%edi
mov    -0x28(%rbp),%rdx
lea    0xda9(%rip),%rsi
mov    $0x27,%ecx
lea    0xe5a(%rip),%r8
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1090 <print_help@plt>
mov    0x2d4e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    137c <main+0x20c>
mov    0x2d65(%rip),%rax
mov    (%rax),%edi
call   1080 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jge    133a <main+0x1ca>
mov    0x2d2a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
lea    0xd6b(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
cmp    $0x0,%eax
je     12ec <main+0x17c>
lea    0xd51(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x38(%rbp)
jmp    12fc <main+0x18c>
lea    0xd32(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    12fc <main+0x18c>
mov    -0x2c(%rbp),%edi
mov    -0x38(%rbp),%rdx
lea    0xcfb(%rip),%rsi
mov    $0x2d,%ecx
lea    0xde1(%rip),%r8
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1090 <print_help@plt>
mov    0x2ca0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    137c <main+0x20c>
jmp    1363 <main+0x1f3>
jmp    1344 <main+0x1d4>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1090 <print_help@plt>
mov    0x2c77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    137c <main+0x20c>
jmp    118d <main+0x1d>
mov    -0x18(%rbp),%edi
call   1040 <mic_call@plt>
mov    0x2c51(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x1,%ebx
lea    0xe77(%rip),%r15
mov    0x2e68(%rip),%r12
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1070 <getopt@plt>
cmp    $0x6e,%eax
jne    1210 <main+0xa0>
mov    (%r12),%edi
call   1030 <check_string_is_number@plt>
test   %eax,%eax
je     1225 <main+0xb5>
mov    (%r12),%edi
call   1080 <atoi@plt>
mov    %eax,%ebx
test   %eax,%eax
jg     1190 <main+0x20>
mov    0x2e13(%rip),%rax
mov    (%rax),%ebx
lea    0xe57(%rip),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
test   %eax,%eax
je     11f6 <main+0x86>
lea    0xe3f(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
add    $0x1,%eax
movslq %eax,%rbp
lea    0xe08(%rip),%rsi
lea    0xef3(%rip),%r8
mov    %ebx,%edi
mov    %rbp,%rdx
mov    $0x2d,%ecx
jmp    1275 <main+0x105>
cmp    $0xffffffff,%eax
jne    127a <main+0x10a>
mov    %ebx,%edi
call   1040 <mic_call@plt>
mov    0x2da5(%rip),%rax
jmp    128e <main+0x11e>
mov    0x2dac(%rip),%rax
mov    (%rax),%ebx
lea    0xdf0(%rip),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
test   %eax,%eax
je     125d <main+0xed>
lea    0xdd8(%rip),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
add    $0x1,%eax
movslq %eax,%rbp
lea    0xda1(%rip),%rsi
lea    0xe57(%rip),%r8
mov    %ebx,%edi
mov    %rbp,%rdx
mov    $0x27,%ecx
call   1060 <fprintf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1090 <print_help@plt>
mov    0x2d42(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"h?n:\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.1 = [32 x i8] c"Error (file: %s, line: %i): %s\0A\00"
@.str.2 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/akiml/ampehre/refs/heads/master/misc/tools/mic_reader/mic_reader.c\00"
@.str.3 = [53 x i8] c"The argument of option 'n' is not a positive number.\00"
@EXIT_FAILURE = global i32 0
@.str.4 = [40 x i8] c"The argument of option 'n' must be > 0.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
br label %8
8: ; preds = %62, %2
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @getopt(i32 %9, i8** %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %11, i32* %6
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %63
13: ; preds = %8
%14 = load i32, i32* %6
switch i32 %14, label %58 [
i32 110, label %15
i32 63, label %57
i32 104, label %57
]
15: ; preds = %13
%16 = load i32, i32* @optarg
%17 = call i32 @check_string_is_number(i32 %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %35, label %19
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = call i32 @strrchr(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = call i32 @strrchr(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i8*
br label %29
28: ; preds = %19
br label %29
29: ; preds = %28, %23
%30 = phi i8* [ %27, %23 ], [ getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), %28 ]
%31 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %30, i32 39, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%32 = load i8**, i8*** %5
%33 = call i32 @print_help(i8** %32, i32 1)
%34 = load i32, i32* @EXIT_FAILURE
store i32 %34, i32* %3
br label %67
35: ; preds = %15
%36 = load i32, i32* @optarg
%37 = call i32 @atoi(i32 %36)
store i32 %37, i32* %7
%38 = load i32, i32* %7
%39 = icmp slt i32 %38, 1
br i1 %39, label %40, label %56
40: ; preds = %35
%41 = load i32, i32* @stderr
%42 = call i32 @strrchr(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %49
44: ; preds = %40
%45 = call i32 @strrchr(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%46 = add nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = inttoptr i64 %47 to i8*
br label %50
49: ; preds = %40
br label %50
50: ; preds = %49, %44
%51 = phi i8* [ %48, %44 ], [ getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), %49 ]
%52 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %51, i32 45, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%53 = load i8**, i8*** %5
%54 = call i32 @print_help(i8** %53, i32 1)
%55 = load i32, i32* @EXIT_FAILURE
store i32 %55, i32* %3
br label %67
56: ; preds = %35
br label %62
57: ; preds = %13, %13
br label %58
58: ; preds = %13, %57
%59 = load i8**, i8*** %5
%60 = call i32 @print_help(i8** %59, i32 1)
%61 = load i32, i32* @EXIT_FAILURE
store i32 %61, i32* %3
br label %67
62: ; preds = %56
br label %8
63: ; preds = %8
%64 = load i32, i32* %7
%65 = call i32 @mic_call(i32 %64)
%66 = load i32, i32* @EXIT_SUCCESS
store i32 %66, i32* %3
br label %67
67: ; preds = %63, %58, %50, %29
%68 = load i32, i32* %3
ret i32 %68
}

LLVM IR (-O2):
@.str = [5 x i8] c"h?n:\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.1 = [32 x i8] c"Error (file: %s, line: %i): %s\0A\00"
@.str.2 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/akiml/ampehre/refs/heads/master/misc/tools/mic_reader/mic_reader.c\00"
@.str.3 = [53 x i8] c"The argument of option 'n' is not a positive number.\00"
@EXIT_FAILURE = global i32 0
@.str.4 = [40 x i8] c"The argument of option 'n' must be > 0.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %23, %2
%4 = phi i32 [ 1, %2 ], [ %25, %23 ]
%5 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %5, label %40 [
i32 -1, label %42
i32 110, label %6
]
6: ; preds = %3
%7 = load i32, i32* @optarg
%8 = tail call i32 @check_string_is_number(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* @stderr
%12 = tail call i32 @strrchr(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%13 = icmp eq i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %10
%15 = tail call i32 @strrchr(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
br label %19
19: ; preds = %10, %14
%20 = phi i8* [ %18, %14 ], [ getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), %10 ]
%21 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %20, i32 39, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%22 = tail call i32 @print_help(i8** %1, i32 1)
br label %44
23: ; preds = %6
%24 = load i32, i32* @optarg
%25 = tail call i32 @atoi(i32 %24)
%26 = icmp slt i32 %25, 1
br i1 %26, label %27, label %3
27: ; preds = %23
%28 = load i32, i32* @stderr
%29 = tail call i32 @strrchr(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%30 = icmp eq i32 %29, 0
br i1 %30, label %36, label %31
31: ; preds = %27
%32 = tail call i32 @strrchr(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%33 = add nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i8*
br label %36
36: ; preds = %27, %31
%37 = phi i8* [ %35, %31 ], [ getelementptr inbounds ([157 x i8], [157 x i8]* @.str.2, i64 0, i64 0), %27 ]
%38 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %37, i32 45, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%39 = tail call i32 @print_help(i8** %1, i32 1)
br label %44
40: ; preds = %3
%41 = tail call i32 @print_help(i8** %1, i32 1)
br label %44
42: ; preds = %3
%43 = tail call i32 @mic_call(i32 %4)
br label %44
44: ; preds = %42, %40, %36, %19
%45 = phi i32* [ @EXIT_FAILURE, %36 ], [ @EXIT_FAILURE, %19 ], [ @EXIT_FAILURE, %40 ], [ @EXIT_SUCCESS, %42 ]
%46 = load i32, i32* %45
ret i32 %46
}