#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 /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int sscanf(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
uint get_number_arg(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr,
            "[wait_nfo] wrong command line\n ** 1 argument expected.\n");
    exit(1);
  }
  uint result;
  if (sscanf(argv[1], "%u", &result) != 1) {
    fprintf(stderr, "[wait_nfo] wrong argument: %s\n", argv[1]);
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<get_number_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     116a <get_number_arg+0x3a>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xebf(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11b4 <get_number_arg+0x84>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number_arg>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jne    1161 <get_number_arg+0x31>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xef0(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    1182 <get_number_arg+0x52>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xea5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"[wait_nfo] wrong command line\0A ** 1 argument expected.\0A\00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [31 x i8] c"[wait_nfo] wrong argument: %s\0A\00"
define i32 @get_number_arg(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%17 = icmp ne i32 %16, 1
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = load i32, i32* @stderr
%20 = load i8**, i8*** %4
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %12
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"[wait_nfo] wrong command line\0A ** 1 argument expected.\0A\00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [31 x i8] c"[wait_nfo] wrong argument: %s\0A\00"
define i32 @get_number_arg(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp eq i32 %0, 2
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = bitcast i32* %3 to i8*
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%14 = icmp eq i32 %13, 1
br i1 %14, label %20, label %15
15: ; preds = %9
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %11
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %9
%21 = load i32, i32* %3
ret i32 %21
}