#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int throw_error(int code) {
  if (code == 1) {
    fprintf(stderr, "Zadane spatne argumenty. Podivejte se --help\n");
    return 1;
  } else if (code == 2) {
    fprintf(stderr, "Chyba pri forkovani procesu!\n");
    return 2;
  } else {
    fprintf(stderr, "Unkown error\n");
    return 93;
  }
}


x86 assembly (clang, -O0):
<throw_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1146 <throw_error+0x36>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    118d <throw_error+0x7d>
cmpl   $0x2,-0x8(%rbp)
jne    1171 <throw_error+0x61>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    118d <throw_error+0x7d>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x5d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<throw_error>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%edi
je     112b <throw_error+0x1b>
cmp    $0x2,%ebx
jne    1134 <throw_error+0x24>
mov    $0x2,%ebx
lea    0xf05(%rip),%rsi
jmp    1140 <throw_error+0x30>
lea    0xece(%rip),%rsi
jmp    1140 <throw_error+0x30>
mov    $0x5d,%ebx
lea    0xf0c(%rip),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Zadane spatne argumenty. Podivejte se --help\0A\00"
@.str.1 = [30 x i8] c"Chyba pri forkovani procesu!\0A\00"
@.str.2 = [14 x i8] c"Unkown error\0A\00"
define i32 @throw_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %18
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %2
br label %18
15: ; preds = %9
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
store i32 93, i32* %2
br label %18
18: ; preds = %15, %12, %6
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Zadane spatne argumenty. Podivejte se --help\0A\00"
@.str.1 = [30 x i8] c"Chyba pri forkovani procesu!\0A\00"
@.str.2 = [14 x i8] c"Unkown error\0A\00"
define i32 @throw_error(i32 %0) {
switch i32 %0, label %3 [
i32 1, label %4
i32 2, label %2
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %3, %2
%5 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), %1 ]
%6 = phi i32 [ 93, %3 ], [ 2, %2 ], [ %0, %1 ]
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* %5)
ret i32 %6
}