#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*/ FormatDisk();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
char toupper(char);
main(int ac, char *av[]) {
  char arg1[100];
  if (ac == 2 && !strcmp(av[1], "-f"))
    exit(FormatDisk());
  printf("All data will be deleted!\nARE YOU SURE (N/Y) ?");
  scanf("%s", arg1);
  if (toupper(*arg1) == 'Y')
    FormatDisk();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11ae <main+0x4e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11ae <main+0x4e>
mov    $0x0,%al
call   1070 <FormatDisk@plt>
mov    %eax,%edi
call   1080 <exit@plt>
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe6d(%rip),%rdi
call   1060 <scanf@plt>
movsbl -0x80(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
cmp    $0x59,%eax
jne    11e6 <main+0x86>
mov    $0x0,%al
call   1070 <FormatDisk@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
cmp    $0x2,%edi
jne    117d <main+0x1d>
mov    0x8(%rsi),%rdi
lea    0xe8c(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11b3 <main+0x53>
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsbl (%rsp),%edi
call   1030 <toupper@plt>
cmp    $0x59,%al
jne    11ac <main+0x4c>
xor    %eax,%eax
call   1070 <FormatDisk@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret
xor    %eax,%eax
call   1070 <FormatDisk@plt>
mov    %eax,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-f\00"
@.str.1 = [47 x i8] c"All data will be deleted!\0AARE YOU SURE (N/Y) ?\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %9
%16 = call i32 (...) @FormatDisk()
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %9, %2
%19 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%23 = load i8, i8* %22
%24 = call signext i8 @toupper(i8 signext %23)
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 89
br i1 %26, label %27, label %29
27: ; preds = %18
%28 = call i32 (...) @FormatDisk()
br label %29
29: ; preds = %27, %18
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [3 x i8] c"-f\00"
@.str.1 = [47 x i8] c"All data will be deleted!\0AARE YOU SURE (N/Y) ?\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = tail call i32 (...) @FormatDisk()
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %6, %2
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%17 = load i8, i8* %4
%18 = call signext i8 @toupper(i8 signext %17)
%19 = icmp eq i8 %18, 89
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = call i32 (...) @FormatDisk()
br label %22
22: ; preds = %20, %14
ret i32 0
}