#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 */
char get_spec();
int /*<<< orphan*/ kf_zrusit();
int /*<<< orphan*/ send_data();
int ok_scr(void) {
  char c;
  if ((c = get_spec()) != 0) {
    switch (c) {
    case 4:
      return 1;
      break;
    case 5:
      return -1;
      break;
    case 21:
      kf_zrusit();
      break;
    case 22:
      send_data();
      break;
    default:
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<ok_scr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get_spec@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     11b2 <ok_scr+0x82>
movsbl -0x5(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x12,%eax
ja     11a8 <ok_scr+0x78>
mov    -0x10(%rbp),%rax
lea    0xe91(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    11b9 <ok_scr+0x89>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b9 <ok_scr+0x89>
mov    $0x0,%al
call   1030 <kf_zrusit@plt>
jmp    11ad <ok_scr+0x7d>
mov    $0x0,%al
call   1040 <send_data@plt>
jmp    11ad <ok_scr+0x7d>
jmp    11ad <ok_scr+0x7d>
jmp    11b2 <ok_scr+0x82>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok_scr>:
push   %rax
xor    %eax,%eax
call   1050 <get_spec@plt>
test   %al,%al
je     1173 <ok_scr+0x43>
movsbl %al,%ecx
add    $0xfffffffc,%ecx
cmp    $0x12,%ecx
ja     1173 <ok_scr+0x43>
mov    $0x1,%eax
lea    0xead(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <kf_zrusit@plt>
jmp    1173 <ok_scr+0x43>
xor    %eax,%eax
call   1040 <send_data@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ok_scr() {
%1 = alloca i32
%2 = alloca i8
%3 = call signext i8 (...) @get_spec()
store i8 %3, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
switch i32 %8, label %15 [
i32 4, label %9
i32 5, label %10
i32 21, label %11
i32 22, label %13
]
9: ; preds = %6
store i32 1, i32* %1
br label %18
10: ; preds = %6
store i32 -1, i32* %1
br label %18
11: ; preds = %6
%12 = call i32 (...) @kf_zrusit()
br label %16
13: ; preds = %6
%14 = call i32 (...) @send_data()
br label %16
15: ; preds = %6
br label %16
16: ; preds = %15, %13, %11
br label %17
17: ; preds = %16, %0
store i32 0, i32* %1
br label %18
18: ; preds = %17, %10, %9
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @ok_scr() {
%1 = tail call signext i8 (...) @get_spec()
%2 = icmp eq i8 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = sext i8 %1 to i32
switch i32 %4, label %10 [
i32 4, label %11
i32 5, label %5
i32 21, label %6
i32 22, label %8
]
5: ; preds = %3
br label %11
6: ; preds = %3
%7 = tail call i32 (...) @kf_zrusit()
br label %10
8: ; preds = %3
%9 = tail call i32 (...) @send_data()
br label %10
10: ; preds = %6, %8, %3, %0
br label %11
11: ; preds = %3, %10, %5
%12 = phi i32 [ 0, %10 ], [ -1, %5 ], [ 1, %3 ]
ret i32 %12
}