#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float x, y;
  printf("Enter coordinates \n");
  scanf("%f %f", &x, &y);
  if (x > 0 && y > 0)
    printf("I quadrant.\n");
  if (x > 0 && y < 0)
    printf("IV quadrant.\n");
  if (x < 0 && y > 0)
    printf("II quadrant.\n");
  if (x < 0 && y < 0)
    printf("III quadrant.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    117d <main+0x5d>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    117d <main+0x5d>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11a7 <main+0x87>
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11a7 <main+0x87>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11d1 <main+0xb1>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11d1 <main+0xb1>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11f7 <main+0xd7>
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11f7 <main+0xd7>
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
movss  (%rsp),%xmm1
jbe    1173 <main+0x53>
ucomiss %xmm2,%xmm1
jbe    1173 <main+0x53>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm2,%xmm2
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
ucomiss %xmm2,%xmm0
jbe    1197 <main+0x77>
xorps  %xmm2,%xmm2
ucomiss %xmm1,%xmm2
jbe    1197 <main+0x77>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jbe    11be <main+0x9e>
ucomiss %xmm2,%xmm1
jbe    11be <main+0x9e>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm2,%xmm2
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
ucomiss %xmm0,%xmm2
jbe    11d7 <main+0xb7>
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
jbe    11d7 <main+0xb7>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter coordinates \0A\00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [13 x i8] c"I quadrant.\0A\00"
@.str.3 = [14 x i8] c"IV quadrant.\0A\00"
@.str.4 = [14 x i8] c"II quadrant.\0A\00"
@.str.5 = [15 x i8] c"III quadrant.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%6 = load float, float* %2
%7 = fcmp ogt float %6, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load float, float* %3
%10 = fcmp ogt float %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %8, %0
%14 = load float, float* %2
%15 = fcmp ogt float %14, 0.000000e+00
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load float, float* %3
%18 = fcmp olt float %17, 0.000000e+00
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %21
21: ; preds = %19, %16, %13
%22 = load float, float* %2
%23 = fcmp olt float %22, 0.000000e+00
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = load float, float* %3
%26 = fcmp ogt float %25, 0.000000e+00
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %27, %24, %21
%30 = load float, float* %2
%31 = fcmp olt float %30, 0.000000e+00
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load float, float* %3
%34 = fcmp olt float %33, 0.000000e+00
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %35, %32, %29
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%f %f\00"
@str = [19 x i8] c"Enter coordinates \00"
@str.6 = [14 x i8] c"III quadrant.\00"
@str.7 = [13 x i8] c"II quadrant.\00"
@str.8 = [13 x i8] c"IV quadrant.\00"
@str.9 = [12 x i8] c"I quadrant.\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = load float, float* %1
%8 = fcmp ogt float %7, 0.000000e+00
%9 = load float, float* %2
%10 = fcmp ogt float %9, 0.000000e+00
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %12, label %16
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.9, i64 0, i64 0))
%14 = load float, float* %1
%15 = load float, float* %2
br label %16
16: ; preds = %12, %0
%17 = phi float [ %15, %12 ], [ %9, %0 ]
%18 = phi float [ %14, %12 ], [ %7, %0 ]
%19 = fcmp ogt float %18, 0.000000e+00
%20 = fcmp olt float %17, 0.000000e+00
%21 = select i1 %19, i1 %20, i1 false
br i1 %21, label %22, label %26
22: ; preds = %16
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.8, i64 0, i64 0))
%24 = load float, float* %1
%25 = load float, float* %2
br label %26
26: ; preds = %22, %16
%27 = phi float [ %25, %22 ], [ %17, %16 ]
%28 = phi float [ %24, %22 ], [ %18, %16 ]
%29 = fcmp olt float %28, 0.000000e+00
%30 = fcmp ogt float %27, 0.000000e+00
%31 = select i1 %29, i1 %30, i1 false
br i1 %31, label %32, label %36
32: ; preds = %26
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
%34 = load float, float* %1
%35 = load float, float* %2
br label %36
36: ; preds = %32, %26
%37 = phi float [ %35, %32 ], [ %27, %26 ]
%38 = phi float [ %34, %32 ], [ %28, %26 ]
%39 = fcmp olt float %38, 0.000000e+00
%40 = fcmp olt float %37, 0.000000e+00
%41 = select i1 %39, i1 %40, i1 false
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
br label %44
44: ; preds = %42, %36
ret i32 0
}