#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 */
float fabs(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ system(char *);
int main() {
  char p[5], q[5];
  printf("Zadayte znachenna:\n");
  printf("Vvedit p ( True | False ) -> ");
  scanf("%s", &p);
  printf("Vvedit q ( True | False ) -> ");
  scanf("%s", &q);
  float x, y, z;
  printf("Vvedit x, y, z -> ");
  scanf("%f%f%f", &x, &y, &z);
  float min = fabs(x);
  if (min > y)
    min = fabs(y);
  if (min > z)
    min = fabs(z);
  int check = min > x + y + z;
  switch (check) {
  case 0: {
    printf("Result: %s", q);
    system("PAUSE");
    return 0;
  }
  case 1: {
    printf("Result: %s", p);
    system("PAUSE");
    return 0;
  }
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf00(%rip),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0xe(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
mov    $0x0,%al
call   1060 <scanf@plt>
movss  -0x14(%rbp),%xmm0
call   1050 <fabs@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    11f2 <main+0xb2>
movss  -0x18(%rbp),%xmm0
call   1050 <fabs@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    1210 <main+0xd0>
movss  -0x1c(%rbp),%xmm0
call   1050 <fabs@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
addss  %xmm2,%xmm1
movss  -0x1c(%rbp),%xmm2
addss  %xmm2,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
test   %eax,%eax
je     125c <main+0x11c>
jmp    124b <main+0x10b>
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
je     1286 <main+0x146>
jmp    12ab <main+0x16b>
lea    -0xe(%rbp),%rsi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe00(%rip),%rdi
call   1030 <system@plt>
movl   $0x0,-0x4(%rbp)
jmp    12ab <main+0x16b>
lea    -0x9(%rbp),%rsi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdd6(%rip),%rdi
call   1030 <system@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf04(%rip),%r15
lea    0x1b(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x16(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeae(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %eax,%eax
call   1060 <scanf@plt>
movss  0x10(%rsp),%xmm0
movaps 0xe2c(%rip),%xmm1
movaps %xmm0,%xmm2
andps  %xmm1,%xmm2
movss  0xc(%rsp),%xmm3
movaps %xmm3,%xmm4
andps  %xmm1,%xmm4
addss  %xmm3,%xmm0
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm4
andnps %xmm2,%xmm3
orps   %xmm4,%xmm3
movss  0x8(%rsp),%xmm2
andps  %xmm2,%xmm1
addss  %xmm2,%xmm0
cmpltss %xmm3,%xmm2
movaps %xmm2,%xmm4
andnps %xmm3,%xmm4
andps  %xmm1,%xmm2
orps   %xmm4,%xmm2
ucomiss %xmm0,%xmm2
cmovbe %r14,%rbx
lea    0xe42(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3c(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Zadayte znachenna:\0A\00"
@.str.1 = [30 x i8] c"Vvedit p ( True | False ) -> \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [30 x i8] c"Vvedit q ( True | False ) -> \00"
@.str.4 = [19 x i8] c"Vvedit x, y, z -> \00"
@.str.5 = [7 x i8] c"%f%f%f\00"
@.str.6 = [11 x i8] c"Result: %s\00"
@.str.7 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), [5 x i8]* %2)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), [5 x i8]* %3)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), float* %4, float* %5, float* %6)
%16 = load float, float* %4
%17 = call float @fabs(float %16)
store float %17, float* %7
%18 = load float, float* %7
%19 = load float, float* %5
%20 = fcmp ogt float %18, %19
br i1 %20, label %21, label %24
21: ; preds = %0
%22 = load float, float* %5
%23 = call float @fabs(float %22)
store float %23, float* %7
br label %24
24: ; preds = %21, %0
%25 = load float, float* %7
%26 = load float, float* %6
%27 = fcmp ogt float %25, %26
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load float, float* %6
%30 = call float @fabs(float %29)
store float %30, float* %7
br label %31
31: ; preds = %28, %24
%32 = load float, float* %7
%33 = load float, float* %4
%34 = load float, float* %5
%35 = fadd float %33, %34
%36 = load float, float* %6
%37 = fadd float %35, %36
%38 = fcmp ogt float %32, %37
%39 = zext i1 %38 to i32
store i32 %39, i32* %8
%40 = load i32, i32* %8
switch i32 %40, label %49 [
i32 0, label %41
i32 1, label %45
]
41: ; preds = %31
%42 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %42)
%44 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %49
45: ; preds = %31
%46 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %46)
%48 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %49
49: ; preds = %41, %45, %31
%50 = load i32, i32* %1
ret i32 %50
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"Vvedit p ( True | False ) -> \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [30 x i8] c"Vvedit q ( True | False ) -> \00"
@.str.4 = [19 x i8] c"Vvedit x, y, z -> \00"
@.str.5 = [7 x i8] c"%f%f%f\00"
@.str.6 = [11 x i8] c"Result: %s\00"
@.str.7 = [6 x i8] c"PAUSE\00"
@str = [19 x i8] c"Zadayte znachenna:\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), [5 x i8]* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), [5 x i8]* %2)
%13 = bitcast float* %3 to i8*
%14 = bitcast float* %4 to i8*
%15 = bitcast float* %5 to i8*
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), float* %3, float* %4, float* %5)
%18 = load float, float* %3
%19 = call float @llvm.fabs.f32(float %18)
%20 = load float, float* %4
%21 = fcmp ogt float %19, %20
%22 = call float @llvm.fabs.f32(float %20)
%23 = select i1 %21, float %22, float %19
%24 = load float, float* %5
%25 = fcmp ogt float %23, %24
%26 = call float @llvm.fabs.f32(float %24)
%27 = select i1 %25, float %26, float %23
%28 = fadd float %18, %20
%29 = fadd float %28, %24
%30 = fcmp ule float %27, %29
%31 = select i1 %30, i8* %7, i8* %6
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %31)
%33 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}