#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 fsd(int, int);
int fsdE(int, int);
int fsdM(int, int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int /*<<< orphan*/ stderr;
int main() {
  int a, b;
  if (scanf("%d,%d", &a, &b) != 2) {
    fprintf(stderr, "chybne zadani\n");
    return 2;
  }
  int resultFSDM, resultFSDE, resultFSD;
  resultFSDM = fsdM(a, b);
  resultFSDE = fsdE(a, b);
  if (resultFSDM == 0 || resultFSDE == 0) {
    fprintf(stderr, "chybne zadani\n");
  }
  printf("%d\n", resultFSDM);
  printf("%d\n", resultFSDE);
  resultFSD = fsd(a, b);
  if (resultFSD == 0) {
    fprintf(stderr, "chybne zadani\n");
    return 1;
  }
  printf("%d", resultFSD);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1070 <scanf@plt>
cmp    $0x2,%eax
je     11ad <main+0x4d>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
lea    0xe6a(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    125f <main+0xff>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <fsdM@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <fsdE@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     11dd <main+0x7d>
cmpl   $0x0,-0x14(%rbp)
jne    11f2 <main+0x92>
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
lea    0xe19(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%esi
lea    0xe19(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe0a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1080 <fsd@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1249 <main+0xe9>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
lea    0xdce(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    125f <main+0xff>
mov    -0x18(%rbp),%esi
lea    0xdb0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1070 <scanf@plt>
cmp    $0x2,%eax
jne    11fc <main+0x9c>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <fsdM@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1050 <fsdE@plt>
mov    %eax,%ebp
test   %ebx,%ebx
je     11a9 <main+0x49>
test   %ebp,%ebp
jne    11be <main+0x5e>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
lea    0xe4d(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xe50(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1080 <fsd@plt>
test   %eax,%eax
je     1218 <main+0xb8>
lea    0xe12(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
jmp    1232 <main+0xd2>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
lea    0xdfa(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x2,%eax
jmp    1232 <main+0xd2>
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
lea    0xdde(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d,%d\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"chybne zadani\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %1
br label %43
12: ; preds = %0
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @fsdM(i32 %13, i32 %14)
store i32 %15, i32* %4
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @fsdE(i32 %16, i32 %17)
store i32 %18, i32* %5
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %12
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21, %12
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %24, %21
%28 = load i32, i32* %4
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %5
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = call i32 @fsd(i32 %32, i32 %33)
store i32 %34, i32* %6
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %27
%38 = load i32, i32* @stderr
%39 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %43
40: ; preds = %27
%41 = load i32, i32* %6
%42 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %41)
store i32 0, i32* %1
br label %43
43: ; preds = %40, %37, %9
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d,%d\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"chybne zadani\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %35
10: ; preds = %0
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @fsdM(i32 %11, i32 %12)
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @fsdE(i32 %14, i32 %15)
%17 = icmp eq i32 %13, 0
%18 = icmp eq i32 %16, 0
%19 = select i1 %17, i1 true, i1 %18
br i1 %19, label %20, label %23
20: ; preds = %10
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %10, %20
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = call i32 @fsd(i32 %26, i32 %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %23
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %35
33: ; preds = %23
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %28)
br label %35
35: ; preds = %30, %33, %7
%36 = phi i32 [ 2, %7 ], [ 1, %30 ], [ 0, %33 ]
ret i32 %36
}