#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 atoi(char *);
scalar_t__ create_Data_file();
scalar_t__ create_Result_file();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc > 1) {
    switch (atoi(argv[1])) {
    case 1:
      if (create_Data_file() == 0)
        printf("Data file created\n");
      else
        printf("problem during %s data file creation\n", argv[0]);
      break;
    case 2:
      if (create_Result_file() == 0)
        printf("Result file created\n");
      else
        printf("problem during %s result file creation\n", argv[0]);
      break;
    default:
      printf("Bad arglist code for: '%s'\n", argv[0]);
      return -1;
      break;
    }
  } else {
    if (create_Data_file() != 0)
      printf("problem during %s data file creation\n", argv[0]);
    if (create_Result_file() != 0)
      printf("problem during %s result file creation\n", argv[0]);
  }
  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   $0x1,-0x8(%rbp)
jle    1233 <main+0xf3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
sub    $0x1,%eax
je     1191 <main+0x51>
jmp    1180 <main+0x40>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     11cf <main+0x8f>
jmp    120d <main+0xcd>
mov    $0x0,%al
call   1030 <create_Data_file@plt>
cmp    $0x0,%rax
jne    11b5 <main+0x75>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11ca <main+0x8a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    122e <main+0xee>
mov    $0x0,%al
call   1040 <create_Result_file@plt>
cmp    $0x0,%rax
jne    11f3 <main+0xb3>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1208 <main+0xc8>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    122e <main+0xee>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    128b <main+0x14b>
jmp    1284 <main+0x144>
mov    $0x0,%al
call   1030 <create_Data_file@plt>
cmp    $0x0,%rax
je     1259 <main+0x119>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <create_Result_file@plt>
cmp    $0x0,%rax
je     127f <main+0x13f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1284 <main+0x144>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     1188 <main+0x38>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
cmp    $0x2,%eax
je     11c1 <main+0x71>
cmp    $0x1,%eax
jne    11e2 <main+0x92>
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <create_Data_file@plt>
test   %rax,%rax
je     11fa <main+0xaa>
mov    (%rbx),%rsi
lea    0xe7a(%rip),%rdi
jmp    11d9 <main+0x89>
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <create_Data_file@plt>
test   %rax,%rax
je     11a7 <main+0x57>
mov    (%rbx),%rsi
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1040 <create_Result_file@plt>
test   %rax,%rax
je     120f <main+0xbf>
mov    (%rbx),%rsi
lea    0xe69(%rip),%rdi
xor    %ebp,%ebp
jmp    11d9 <main+0x89>
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <create_Result_file@plt>
test   %rax,%rax
je     1203 <main+0xb3>
mov    (%rbx),%rsi
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    120f <main+0xbf>
mov    (%rbx),%rsi
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xffffffff,%ebp
jmp    120f <main+0xbf>
lea    0xe7d(%rip),%rdi
jmp    120a <main+0xba>
lea    0xe60(%rip),%rdi
call   1050 <puts@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Data file created\0A\00"
@.str.1 = [38 x i8] c"problem during %s data file creation\0A\00"
@.str.2 = [21 x i8] c"Result file created\0A\00"
@.str.3 = [40 x i8] c"problem during %s result file creation\0A\00"
@.str.4 = [28 x i8] c"Bad arglist code for: '%s'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %41
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
switch i32 %12, label %35 [
i32 1, label %13
i32 2, label %24
]
13: ; preds = %8
%14 = call i64 (...) @create_Data_file()
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %23
18: ; preds = %13
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %18, %16
br label %40
24: ; preds = %8
%25 = call i64 (...) @create_Result_file()
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %34
29: ; preds = %24
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %29, %27
br label %40
35: ; preds = %8
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %38)
store i32 -1, i32* %3
br label %59
40: ; preds = %34, %23
br label %58
41: ; preds = %2
%42 = call i64 (...) @create_Data_file()
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 0
%47 = load i8*, i8** %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %44, %41
%50 = call i64 (...) @create_Result_file()
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 0
%55 = load i8*, i8** %54
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %55)
br label %57
57: ; preds = %52, %49
br label %58
58: ; preds = %57, %40
store i32 0, i32* %3
br label %59
59: ; preds = %58, %35
%60 = load i32, i32* %3
ret i32 %60
}

LLVM IR (-O2):
@.str.1 = [38 x i8] c"problem during %s data file creation\0A\00"
@.str.3 = [40 x i8] c"problem during %s result file creation\0A\00"
@.str.4 = [28 x i8] c"Bad arglist code for: '%s'\0A\00"
@str = [20 x i8] c"Result file created\00"
@str.5 = [18 x i8] c"Data file created\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %27
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
switch i32 %7, label %24 [
i32 1, label %8
i32 2, label %16
]
8: ; preds = %4
%9 = tail call i64 (...) @create_Data_file()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
br label %39
13: ; preds = %8
%14 = load i8*, i8** %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %39
16: ; preds = %4
%17 = tail call i64 (...) @create_Result_file()
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %39
21: ; preds = %16
%22 = load i8*, i8** %1
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %22)
br label %39
24: ; preds = %4
%25 = load i8*, i8** %1
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %25)
br label %39
27: ; preds = %2
%28 = tail call i64 (...) @create_Data_file()
%29 = icmp eq i64 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %27
%31 = load i8*, i8** %1
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %31)
br label %33
33: ; preds = %30, %27
%34 = tail call i64 (...) @create_Result_file()
%35 = icmp eq i64 %34, 0
br i1 %35, label %39, label %36
36: ; preds = %33
%37 = load i8*, i8** %1
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %19, %21, %11, %13, %36, %33, %24
%40 = phi i32 [ -1, %24 ], [ 0, %33 ], [ 0, %36 ], [ 0, %13 ], [ 0, %11 ], [ 0, %21 ], [ 0, %19 ]
ret i32 %40
}