#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 */
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ const member_1;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ abort();
int add_vol(unsigned int, unsigned int, unsigned int);
unsigned int atoi(int /*<<< orphan*/);
unsigned int ceil(double);
int /*<<< orphan*/ check_cs(unsigned int, unsigned int);
int /*<<< orphan*/ check_disk();
int /*<<< orphan*/ display_mbr();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int get_block(unsigned int, unsigned int);
int getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ init_master();
int /*<<< orphan*/ load_mbr();
int /*<<< orphan*/ optarg;
int optind;
int /*<<< orphan*/ print_usage(char **);
int /*<<< orphan*/ printf(char *, ...);
#define required_argument 128
int /*<<< orphan*/ save_mbr();
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  unsigned int size, fc, fs, nsector;
  int option_index;
  int c;
  char ch;
  size = 0;
  fc = 0;
  fs = 0;
  option_index = 0;
  static struct option long_options[4] = {{"fc", required_argument, 0, 'a'},
                                          {"fs", required_argument, 0, 'b'},
                                          {"s", required_argument, 0, 0},
                                          {0, 0, 0, 0}};
  while ((c = getopt_long(argc, argv, "a:b:s:", long_options, &option_index)) !=
         -1) {
    switch (c) {
    case 'a':
      fc = atoi(optarg);
      break;
    case 'b':
      fs = atoi(optarg);
      break;
    case 's':
      size = atoi(optarg);
      break;
    case '?':
      break;
    default:
      abort();
    }
  }
  if (optind < argc) {
    print_usage(argv);
    printf("non-option ARGV-elements: ");
    while (optind < argc)
      printf("%s ", argv[optind++]);
    printf("\n");
    exit(EXIT_FAILURE);
  }
  if (size == 0) {
    print_usage(argv);
    exit(EXIT_FAILURE);
  }
  nsector = ceil((double)size / 512);
  if (!check_cs(fc, fs) || get_block(fc, fs) <= 0 ||
      get_block(fc, fs + nsector) > 1024 * 32) {
    fprintf(stderr, "Vous ne pouvez pas creer "
                    "de partiton a cet emplacement.\n");
    exit(EXIT_FAILURE);
  }
  init_master();
  check_disk();
  load_mbr();
  if (add_vol(fc, fs, size) != -1) {
    printf("Partion creee : \n");
    display_mbr();
    printf("Voulez vous sauvegarder les changements ? [O/n] : ");
    (void)scanf(" %c", &ch);
    if (ch != 'n' && ch != 'N')
      save_mbr();
    else
      printf("Aucun changement effectue.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdbe(%rip),%rdx
lea    0x2e59(%rip),%rcx
lea    -0x24(%rbp),%r8
call   1080 <getopt_long@plt>
mov    %eax,-0x28(%rbp)
cmp    $0xffffffff,%eax
je     1306 <main+0xf6>
mov    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
sub    $0x3f,%eax
je     12f5 <main+0xe5>
jmp    1280 <main+0x70>
mov    -0x30(%rbp),%eax
sub    $0x61,%eax
je     12b3 <main+0xa3>
jmp    1291 <main+0x81>
mov    -0x30(%rbp),%eax
sub    $0x62,%eax
je     12c9 <main+0xb9>
jmp    12a2 <main+0x92>
mov    -0x30(%rbp),%eax
sub    $0x73,%eax
je     12df <main+0xcf>
jmp    12fa <main+0xea>
mov    0x2d3e(%rip),%rax
mov    (%rax),%edi
call   1100 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1301 <main+0xf1>
mov    0x2d28(%rip),%rax
mov    (%rax),%edi
call   1100 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    1301 <main+0xf1>
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
call   1100 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1301 <main+0xf1>
jmp    1301 <main+0xf1>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1242 <main+0x32>
mov    0x2cd3(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1392 <main+0x182>
mov    -0x10(%rbp),%rdi
call   1120 <print_usage@plt>
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    0x2caa(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1376 <main+0x166>
mov    -0x10(%rbp),%rax
mov    0x2c94(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2c86(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    132f <main+0x11f>
lea    0xd00(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    0x2c3d(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
cmpl   $0x0,-0x14(%rbp)
jne    13b3 <main+0x1a3>
mov    -0x10(%rbp),%rdi
call   1120 <print_usage@plt>
mov    0x2c1c(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xc3d(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <ceil@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   10f0 <check_cs@plt>
cmp    $0x0,%eax
je     1410 <main+0x200>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   10c0 <get_block@plt>
cmp    $0x0,%eax
jle    1410 <main+0x200>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
add    -0x20(%rbp),%esi
call   10c0 <get_block@plt>
cmp    $0x8000,%eax
jle    1433 <main+0x223>
mov    0x2bb9(%rip),%rax
mov    (%rax),%edi
lea    0xc14(%rip),%rsi
call   10b0 <fprintf@plt>
mov    0x2b9c(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
mov    $0x0,%al
call   1050 <init_master@plt>
mov    $0x0,%al
call   1070 <check_disk@plt>
mov    $0x0,%al
call   10e0 <load_mbr@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <add_vol@plt>
cmp    $0xffffffff,%eax
je     14cb <main+0x2bb>
lea    0xc07(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0x0,%al
call   1130 <display_mbr@plt>
lea    0xc04(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    0xc29(%rip),%rdi
lea    -0x29(%rbp),%rsi
call   10d0 <scanf@plt>
movsbl -0x29(%rbp),%eax
cmp    $0x6e,%eax
je     14b8 <main+0x2a8>
movsbl -0x29(%rbp),%eax
cmp    $0x4e,%eax
je     14b8 <main+0x2a8>
mov    $0x0,%al
call   10a0 <save_mbr@plt>
jmp    14c6 <main+0x2b6>
lea    0xbf7(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    14cb <main+0x2bb>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0x14(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xdb4(%rip),%r13
lea    0x2e5f(%rip),%r14
lea    0x14(%rsp),%r15
xor    %r12d,%r12d
movl   $0x0,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   10a0 <getopt_long@plt>
cmp    $0x3f,%eax
je     1280 <main+0x50>
cmp    $0x61,%eax
jg     12be <main+0x8e>
cmp    $0xffffffff,%eax
je     12f4 <main+0xc4>
cmp    $0x61,%eax
jne    13f1 <main+0x1c1>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
call   1120 <atoi@plt>
mov    %eax,%r12d
jmp    1280 <main+0x50>
cmp    $0x62,%eax
je     12e0 <main+0xb0>
cmp    $0x73,%eax
jne    13f1 <main+0x1c1>
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
call   1120 <atoi@plt>
mov    %eax,0x10(%rsp)
jmp    1280 <main+0x50>
mov    0x2d11(%rip),%rax
mov    (%rax),%edi
call   1120 <atoi@plt>
mov    %eax,0xc(%rsp)
jmp    1280 <main+0x50>
mov    0x2ce5(%rip),%r15
cmp    %ebp,(%r15)
jl     140f <main+0x1df>
mov    0x10(%rsp),%r14d
test   %r14d,%r14d
je     1469 <main+0x239>
mov    %r14d,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xcde(%rip),%xmm0
call   1080 <ceil@plt>
mov    %eax,%ebx
mov    %r12d,%edi
mov    0xc(%rsp),%ebp
mov    %ebp,%esi
call   1110 <check_cs@plt>
test   %eax,%eax
je     13f8 <main+0x1c8>
mov    %r12d,%edi
mov    %ebp,%esi
call   10e0 <get_block@plt>
test   %eax,%eax
jle    13f8 <main+0x1c8>
add    %ebp,%ebx
mov    %r12d,%edi
mov    %ebx,%esi
call   10e0 <get_block@plt>
cmp    $0x8001,%eax
jge    13f8 <main+0x1c8>
xor    %eax,%eax
call   1060 <init_master@plt>
xor    %eax,%eax
call   1090 <check_disk@plt>
xor    %eax,%eax
call   1100 <load_mbr@plt>
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1050 <add_vol@plt>
cmp    $0xffffffff,%eax
je     13e0 <main+0x1b0>
lea    0xd0e(%rip),%rdi
call   1070 <puts@plt>
xor    %eax,%eax
call   1150 <display_mbr@plt>
lea    0xcc4(%rip),%rdi
xor    %eax,%eax
call   10b0 <printf@plt>
lea    0xce9(%rip),%rdi
lea    0xb(%rsp),%rsi
call   10f0 <scanf@plt>
mov    0xb(%rsp),%al
and    $0xdf,%al
cmp    $0x4e,%al
jne    13d9 <main+0x1a9>
lea    0xce3(%rip),%rdi
call   1070 <puts@plt>
jmp    13e0 <main+0x1b0>
xor    %eax,%eax
call   10c0 <save_mbr@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1040 <abort@plt>
mov    0x2bd1(%rip),%rax
mov    (%rax),%edi
lea    0xc2c(%rip),%rsi
call   10d0 <fprintf@plt>
jmp    1471 <main+0x241>
mov    %rbx,%rdi
call   1140 <print_usage@plt>
lea    0xbf7(%rip),%rdi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    (%r15),%eax
cmp    %ebp,%eax
jge    145d <main+0x22d>
lea    0xbfd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rax),%ecx
mov    %ecx,(%r15)
cltq
mov    (%rbx,%rax,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    (%r15),%eax
cmp    %ebp,%eax
jl     1440 <main+0x210>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1471 <main+0x241>
mov    %rbx,%rdi
call   1140 <print_usage@plt>
mov    0x2b50(%rip),%rax
mov    (%rax),%edi
call   1130 <exit@plt>

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32, i32 }
@main.long_options = internal global [4 x %struct.option] [%struct.option { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8 -128, i32 0, i32 97 }, %struct.option { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8 -128, i32 0, i32 98 }, %struct.option { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8 -128, i32 0, i32 0 }, %struct.option zeroinitializer]
@.str = [3 x i8] c"fc\00"
@.str.1 = [3 x i8] c"fs\00"
@.str.2 = [2 x i8] c"s\00"
@.str.3 = [7 x i8] c"a:b:s:\00"
@optarg = global i32 0
@optind = global i32 0
@.str.4 = [27 x i8] c"non-option ARGV-elements: \00"
@.str.5 = [4 x i8] c"%s \00"
@.str.6 = [2 x i8] c"\0A\00"
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str.7 = [57 x i8] c"Vous ne pouvez pas creer de partiton a cet emplacement.\0A\00"
@.str.8 = [18 x i8] c"Partion creee : \0A\00"
@.str.9 = [51 x i8] c"Voulez vous sauvegarder les changements ? [O/n] : \00"
@.str.10 = [4 x i8] c" %c\00"
@.str.11 = [28 x i8] c"Aucun changement effectue.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %10
br label %13
13: ; preds = %32, %2
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @getopt_long(i32 %14, i8** %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %struct.option* getelementptr inbounds ([4 x %struct.option], [4 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %10)
store i32 %16, i32* %11
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %33
18: ; preds = %13
%19 = load i32, i32* %11
switch i32 %19, label %30 [
i32 97, label %20
i32 98, label %23
i32 115, label %26
i32 63, label %29
]
20: ; preds = %18
%21 = load i32, i32* @optarg
%22 = call i32 @atoi(i32 %21)
store i32 %22, i32* %7
br label %32
23: ; preds = %18
%24 = load i32, i32* @optarg
%25 = call i32 @atoi(i32 %24)
store i32 %25, i32* %8
br label %32
26: ; preds = %18
%27 = load i32, i32* @optarg
%28 = call i32 @atoi(i32 %27)
store i32 %28, i32* %6
br label %32
29: ; preds = %18
br label %32
30: ; preds = %18
%31 = call i32 (...) @abort()
unreachable
32: ; preds = %29, %26, %23, %20
br label %13
33: ; preds = %13
%34 = load i32, i32* @optind
%35 = load i32, i32* %4
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %57
37: ; preds = %33
%38 = load i8**, i8*** %5
%39 = call i32 @print_usage(i8** %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %41
41: ; preds = %45, %37
%42 = load i32, i32* @optind
%43 = load i32, i32* %4
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %53
45: ; preds = %41
%46 = load i8**, i8*** %5
%47 = load i32, i32* @optind
%48 = add nsw i32 %47, 1
store i32 %48, i32* @optind
%49 = sext i32 %47 to i64
%50 = getelementptr inbounds i8*, i8** %46, i64 %49
%51 = load i8*, i8** %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %51)
br label %41
53: ; preds = %41
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%55 = load i32, i32* @EXIT_FAILURE
%56 = call i32 @exit(i32 %55)
unreachable
57: ; preds = %33
%58 = load i32, i32* %6
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %65
60: ; preds = %57
%61 = load i8**, i8*** %5
%62 = call i32 @print_usage(i8** %61)
%63 = load i32, i32* @EXIT_FAILURE
%64 = call i32 @exit(i32 %63)
unreachable
65: ; preds = %57
%66 = load i32, i32* %6
%67 = uitofp i32 %66 to double
%68 = fdiv double %67, 5.120000e+02
%69 = call i32 @ceil(double %68)
store i32 %69, i32* %9
%70 = load i32, i32* %7
%71 = load i32, i32* %8
%72 = call i32 @check_cs(i32 %70, i32 %71)
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %86
74: ; preds = %65
%75 = load i32, i32* %7
%76 = load i32, i32* %8
%77 = call i32 @get_block(i32 %75, i32 %76)
%78 = icmp sle i32 %77, 0
br i1 %78, label %86, label %79
79: ; preds = %74
%80 = load i32, i32* %7
%81 = load i32, i32* %8
%82 = load i32, i32* %9
%83 = add i32 %81, %82
%84 = call i32 @get_block(i32 %80, i32 %83)
%85 = icmp sgt i32 %84, 32768
br i1 %85, label %86, label %91
86: ; preds = %79, %74, %65
%87 = load i32, i32* @stderr
%88 = call i32 @fprintf(i32 %87, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
%89 = load i32, i32* @EXIT_FAILURE
%90 = call i32 @exit(i32 %89)
unreachable
91: ; preds = %79
%92 = call i32 (...) @init_master()
%93 = call i32 (...) @check_disk()
%94 = call i32 (...) @load_mbr()
%95 = load i32, i32* %7
%96 = load i32, i32* %8
%97 = load i32, i32* %6
%98 = call i32 @add_vol(i32 %95, i32 %96, i32 %97)
%99 = icmp ne i32 %98, -1
br i1 %99, label %100, label %117
100: ; preds = %91
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%102 = call i32 (...) @display_mbr()
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0))
%104 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %12)
%105 = load i8, i8* %12
%106 = sext i8 %105 to i32
%107 = icmp ne i32 %106, 110
br i1 %107, label %108, label %114
108: ; preds = %100
%109 = load i8, i8* %12
%110 = sext i8 %109 to i32
%111 = icmp ne i32 %110, 78
br i1 %111, label %112, label %114
112: ; preds = %108
%113 = call i32 (...) @save_mbr()
br label %116
114: ; preds = %108, %100
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
br label %116
116: ; preds = %114, %112
br label %117
117: ; preds = %116, %91
ret i32 0
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32, i32 }
@main.long_options = internal global [4 x %struct.option] [%struct.option { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8 -128, i32 0, i32 97 }, %struct.option { i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8 -128, i32 0, i32 98 }, %struct.option { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8 -128, i32 0, i32 0 }, %struct.option zeroinitializer]
@.str = [3 x i8] c"fc\00"
@.str.1 = [3 x i8] c"fs\00"
@.str.2 = [2 x i8] c"s\00"
@.str.3 = [7 x i8] c"a:b:s:\00"
@optarg = global i32 0
@optind = global i32 0
@.str.4 = [27 x i8] c"non-option ARGV-elements: \00"
@.str.5 = [4 x i8] c"%s \00"
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str.7 = [57 x i8] c"Vous ne pouvez pas creer de partiton a cet emplacement.\0A\00"
@.str.9 = [51 x i8] c"Voulez vous sauvegarder les changements ? [O/n] : \00"
@.str.10 = [4 x i8] c" %c\00"
@str = [17 x i8] c"Partion creee : \00"
@str.12 = [27 x i8] c"Aucun changement effectue.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %6
6: ; preds = %20, %2
%7 = phi i32 [ %22, %20 ], [ 0, %2 ]
%8 = phi i32 [ %11, %20 ], [ 0, %2 ]
%9 = phi i32 [ %14, %20 ], [ 0, %2 ]
br label %10
10: ; preds = %6, %17
%11 = phi i32 [ %8, %6 ], [ %19, %17 ]
%12 = phi i32 [ %9, %6 ], [ %14, %17 ]
br label %13
13: ; preds = %10, %23
%14 = phi i32 [ %12, %10 ], [ %25, %23 ]
br label %15
15: ; preds = %13, %15
%16 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %struct.option* getelementptr inbounds ([4 x %struct.option], [4 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %3)
switch i32 %16, label %26 [
i32 -1, label %28
i32 97, label %17
i32 98, label %20
i32 115, label %23
i32 63, label %15
]
17: ; preds = %15
%18 = load i32, i32* @optarg
%19 = call i32 @atoi(i32 %18)
br label %10
20: ; preds = %15
%21 = load i32, i32* @optarg
%22 = call i32 @atoi(i32 %21)
br label %6
23: ; preds = %15
%24 = load i32, i32* @optarg
%25 = call i32 @atoi(i32 %24)
br label %13
26: ; preds = %15
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %15
%29 = load i32, i32* @optind
%30 = icmp slt i32 %29, %0
br i1 %30, label %31, label %49
31: ; preds = %28
%32 = call i32 @print_usage(i8** %1)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%34 = load i32, i32* @optind
%35 = icmp slt i32 %34, %0
br i1 %35, label %36, label %45
36: ; preds = %31, %36
%37 = phi i32 [ %43, %36 ], [ %34, %31 ]
%38 = add nsw i32 %37, 1
store i32 %38, i32* @optind
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds i8*, i8** %1, i64 %39
%41 = load i8*, i8** %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %41)
%43 = load i32, i32* @optind
%44 = icmp slt i32 %43, %0
br i1 %44, label %36, label %45
45: ; preds = %36, %31
%46 = call i32 @putchar(i32 10)
%47 = load i32, i32* @EXIT_FAILURE
%48 = call i32 @exit(i32 %47)
unreachable
49: ; preds = %28
%50 = icmp eq i32 %14, 0
br i1 %50, label %51, label %55
51: ; preds = %49
%52 = call i32 @print_usage(i8** %1)
%53 = load i32, i32* @EXIT_FAILURE
%54 = call i32 @exit(i32 %53)
unreachable
55: ; preds = %49
%56 = uitofp i32 %14 to double
%57 = fmul double %56, 0x3F60000000000000
%58 = call i32 @ceil(double %57)
%59 = call i32 @check_cs(i32 %11, i32 %7)
%60 = icmp eq i32 %59, 0
br i1 %60, label %68, label %61
61: ; preds = %55
%62 = call i32 @get_block(i32 %11, i32 %7)
%63 = icmp slt i32 %62, 1
br i1 %63, label %68, label %64
64: ; preds = %61
%65 = add i32 %58, %7
%66 = call i32 @get_block(i32 %11, i32 %65)
%67 = icmp sgt i32 %66, 32768
br i1 %67, label %68, label %73
68: ; preds = %64, %61, %55
%69 = load i32, i32* @stderr
%70 = call i32 @fprintf(i32 %69, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
%71 = load i32, i32* @EXIT_FAILURE
%72 = call i32 @exit(i32 %71)
unreachable
73: ; preds = %64
%74 = call i32 (...) @init_master()
%75 = call i32 (...) @check_disk()
%76 = call i32 (...) @load_mbr()
%77 = call i32 @add_vol(i32 %11, i32 %7, i32 %14)
%78 = icmp eq i32 %77, -1
br i1 %78, label %91, label %79
79: ; preds = %73
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%81 = call i32 (...) @display_mbr()
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0))
%83 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %4)
%84 = load i8, i8* %4
%85 = and i8 %84, -33
%86 = icmp eq i8 %85, 78
br i1 %86, label %89, label %87
87: ; preds = %79
%88 = call i32 (...) @save_mbr()
br label %91
89: ; preds = %79
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.12, i64 0, i64 0))
br label %91
91: ; preds = %87, %89, %73
ret i32 0
}