#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*/ display_loading();
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ printf(char *, char *);
int sscanf(char *, char *, unsigned int *);
int main(int argc, char **argv) {
  unsigned int seconds_to_wait;
  if (argc < 2) {
    print_usage();
    return 0;
  }
  if (sscanf(argv[1], "%d", &seconds_to_wait) != 1) {
    printf("Bad argument: %s\n", argv[1]);
    print_usage();
    return -1;
  }
  display_loading();
  return 0;
}


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   $0x2,-0x8(%rbp)
jge    1173 <main+0x33>
mov    $0x0,%al
call   1060 <print_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <main+0x89>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7e(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11bb <main+0x7b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <print_usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c9 <main+0x89>
mov    $0x0,%al
call   1050 <display_loading@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x1,%edi
jg     1155 <main+0x15>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <print_usage@plt>
jmp    1199 <main+0x59>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe9d(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    117d <main+0x3d>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <display_loading@plt>
jmp    1199 <main+0x59>
mov    0x8(%rbx),%rsi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <print_usage@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [18 x i8] c"Bad argument: %s\0A\00"
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 slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @print_usage()
store i32 0, i32* %3
br label %25
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%16 = icmp ne i32 %15, 1
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = call i32 (...) @print_usage()
store i32 -1, i32* %3
br label %25
23: ; preds = %11
%24 = call i32 (...) @display_loading()
store i32 0, i32* %3
br label %25
25: ; preds = %23, %17, %9
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [18 x i8] c"Bad argument: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @print_usage()
br label %19
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = icmp eq i32 %11, 1
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = load i8*, i8** %9
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = call i32 (...) @print_usage()
br label %19
17: ; preds = %8
%18 = call i32 (...) @display_loading()
br label %19
19: ; preds = %17, %13, %6
%20 = phi i32 [ 0, %6 ], [ -1, %13 ], [ 0, %17 ]
ret i32 %20
}