#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*/ exit(int);
int /*<<< orphan*/ print_help_cds();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
void print_error_cds(char *msg, char *file) {
  printf("\n");
  if (!strcmp(msg, "cmd")) {
    printf("ERROR: no value for %s.\n\n", file);
    print_help_cds();
  } else if (!strcmp(msg, "option")) {
    printf("ERROR: the following option is mandatory: %s.\n\n", file);
    print_help_cds();
  } else if (!strcmp(msg, "missing")) {
    printf("ERROR: one of the following options is not positive: -m, -r.\n\n");
    print_help_cds();
  } else if (!strcmp(msg, "basic")) {
    printf("ERROR: the command is not written correctly.\n\n");
    print_help_cds();
  } else if (!strcmp(msg, "specific")) {
    printf("ERROR: %s.\n\n", file);
    print_help_cds();
  } else {
    printf("ERROR: Internal error.\n");
  }
  printf("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_error_cds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xf43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1195 <print_error_cds+0x55>
mov    -0x10(%rbp),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <print_help_cds@plt>
jmp    128b <print_error_cds+0x14b>
mov    -0x8(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11cc <print_error_cds+0x8c>
mov    -0x10(%rbp),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <print_help_cds@plt>
jmp    1286 <print_error_cds+0x146>
mov    -0x8(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11ff <print_error_cds+0xbf>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <print_help_cds@plt>
jmp    1281 <print_error_cds+0x141>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1232 <print_error_cds+0xf2>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <print_help_cds@plt>
jmp    127c <print_error_cds+0x13c>
mov    -0x8(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1269 <print_error_cds+0x129>
mov    -0x10(%rbp),%rsi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <print_help_cds@plt>
jmp    1277 <print_error_cds+0x137>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <print_error_cds+0x13c>
jmp    1281 <print_error_cds+0x141>
jmp    1286 <print_error_cds+0x146>
jmp    128b <print_error_cds+0x14b>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<print_error_cds>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe85(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1190 <print_error_cds+0x30>
lea    0xe76(%rip),%rdi
jmp    11aa <print_error_cds+0x4a>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    11cf <print_error_cds+0x6f>
lea    0xe7b(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <print_help_cds@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    11eb <print_error_cds+0x8b>
lea    0xe90(%rip),%rdi
jmp    1205 <print_error_cds+0xa5>
lea    0xe6b(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    120c <print_error_cds+0xac>
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
jmp    11b4 <print_error_cds+0x54>
lea    0xe50(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1228 <print_error_cds+0xc8>
lea    0xe46(%rip),%rdi
jmp    11aa <print_error_cds+0x4a>
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
jmp    11bb <print_error_cds+0x5b>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [4 x i8] c"cmd\00"
@.str.2 = [26 x i8] c"ERROR: no value for %s.\0A\0A\00"
@.str.3 = [7 x i8] c"option\00"
@.str.4 = [48 x i8] c"ERROR: the following option is mandatory: %s.\0A\0A\00"
@.str.5 = [8 x i8] c"missing\00"
@.str.6 = [63 x i8] c"ERROR: one of the following options is not positive: -m, -r.\0A\0A\00"
@.str.7 = [6 x i8] c"basic\00"
@.str.8 = [47 x i8] c"ERROR: the command is not written correctly.\0A\0A\00"
@.str.9 = [9 x i8] c"specific\00"
@.str.10 = [13 x i8] c"ERROR: %s.\0A\0A\00"
@.str.11 = [24 x i8] c"ERROR: Internal error.\0A\00"
define void @print_error_cds(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = call i32 (...) @print_help_cds()
br label %49
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i8* %18)
%20 = call i32 (...) @print_help_cds()
br label %48
21: ; preds = %13
%22 = load i8*, i8** %3
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0))
%27 = call i32 (...) @print_help_cds()
br label %47
28: ; preds = %21
%29 = load i8*, i8** %3
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%34 = call i32 (...) @print_help_cds()
br label %46
35: ; preds = %28
%36 = load i8*, i8** %3
%37 = call i32 @strcmp(i8* %36, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%38 = icmp ne i32 %37, 0
br i1 %38, label %43, label %39
39: ; preds = %35
%40 = load i8*, i8** %4
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %40)
%42 = call i32 (...) @print_help_cds()
br label %45
43: ; preds = %35
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
br label %45
45: ; preds = %43, %39
br label %46
46: ; preds = %45, %32
br label %47
47: ; preds = %46, %25
br label %48
48: ; preds = %47, %17
br label %49
49: ; preds = %48, %9
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"cmd\00"
@.str.2 = [26 x i8] c"ERROR: no value for %s.\0A\0A\00"
@.str.3 = [7 x i8] c"option\00"
@.str.4 = [48 x i8] c"ERROR: the following option is mandatory: %s.\0A\0A\00"
@.str.5 = [8 x i8] c"missing\00"
@.str.7 = [6 x i8] c"basic\00"
@.str.9 = [9 x i8] c"specific\00"
@.str.10 = [13 x i8] c"ERROR: %s.\0A\0A\00"
@str = [62 x i8] c"ERROR: one of the following options is not positive: -m, -r.\0A\00"
@str.12 = [46 x i8] c"ERROR: the command is not written correctly.\0A\00"
@str.13 = [23 x i8] c"ERROR: Internal error.\00"
define void @print_error_cds(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%8 = tail call i32 (...) @print_help_cds()
br label %35
9: ; preds = %2
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%14 = tail call i32 (...) @print_help_cds()
br label %35
15: ; preds = %9
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%20 = tail call i32 (...) @print_help_cds()
br label %35
21: ; preds = %15
%22 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.12, i64 0, i64 0))
%26 = tail call i32 (...) @print_help_cds()
br label %35
27: ; preds = %21
%28 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %1)
%32 = tail call i32 (...) @print_help_cds()
br label %35
33: ; preds = %27
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.13, i64 0, i64 0))
br label %35
35: ; preds = %12, %24, %33, %30, %18, %6
%36 = tail call i32 @putchar(i32 10)
%37 = tail call i32 @exit(i32 1)
unreachable
}