#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 *, ...);
void print_complex_numbers(double real, double image) {
  if (image < 0 && real != 0) {
    printf(" %f - %f i ", real, (-1) * image);
  } else if (image > 0 && real != 0) {
    printf(" %f + %f i ", real, image);
  } else if (real == 0 && image != 0) {
    printf(" %f i ", image);
  } else if (real == 0 && image == 0) {
    printf("0");
  } else if (real != 0 && image == 0) {
    printf(" %f ", real);
  }
}


x86 assembly (clang, -O0):
<print_complex_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1172 <print_complex_numbers+0x62>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114d <print_complex_numbers+0x3d>
jp     114d <print_complex_numbers+0x3d>
jmp    1172 <print_complex_numbers+0x62>
movsd  -0x8(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
lea    0xea2(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    12aa <print_complex_numbers+0x19a>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11be <print_complex_numbers+0xae>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11a1 <print_complex_numbers+0x91>
jp     11a1 <print_complex_numbers+0x91>
jmp    11be <print_complex_numbers+0xae>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe62(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    12a5 <print_complex_numbers+0x195>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    120b <print_complex_numbers+0xfb>
jp     120b <print_complex_numbers+0xfb>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f3 <print_complex_numbers+0xe3>
jp     11f3 <print_complex_numbers+0xe3>
jmp    120b <print_complex_numbers+0xfb>
movsd  -0x10(%rbp),%xmm0
lea    0xe1a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12a0 <print_complex_numbers+0x190>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    124e <print_complex_numbers+0x13e>
jp     124e <print_complex_numbers+0x13e>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    124e <print_complex_numbers+0x13e>
jp     124e <print_complex_numbers+0x13e>
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129b <print_complex_numbers+0x18b>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    126b <print_complex_numbers+0x15b>
jp     126b <print_complex_numbers+0x15b>
jmp    1296 <print_complex_numbers+0x186>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1296 <print_complex_numbers+0x186>
jp     1296 <print_complex_numbers+0x186>
movsd  -0x8(%rbp),%xmm0
lea    0xd93(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    129b <print_complex_numbers+0x18b>
jmp    12a0 <print_complex_numbers+0x190>
jmp    12a5 <print_complex_numbers+0x195>
jmp    12aa <print_complex_numbers+0x19a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_complex_numbers>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    112c <print_complex_numbers+0xc>
jnp    1148 <print_complex_numbers+0x28>
ucomisd %xmm1,%xmm2
jbe    1148 <print_complex_numbers+0x28>
xorpd  0xec6(%rip),%xmm1
lea    0xecf(%rip),%rdi
mov    $0x2,%al
jmp    1040 <printf@plt>
ucomisd %xmm2,%xmm0
jne    1150 <print_complex_numbers+0x30>
jnp    1168 <print_complex_numbers+0x48>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    1168 <print_complex_numbers+0x48>
lea    0xebb(%rip),%rdi
mov    $0x2,%al
jmp    1040 <printf@plt>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    118e <print_complex_numbers+0x6e>
jp     118e <print_complex_numbers+0x6e>
ucomisd %xmm2,%xmm1
jne    117c <print_complex_numbers+0x5c>
jnp    118e <print_complex_numbers+0x6e>
lea    0xe9e(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
jmp    1040 <printf@plt>
ucomisd %xmm2,%xmm0
jne    11ac <print_complex_numbers+0x8c>
jp     11ac <print_complex_numbers+0x8c>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    11ac <print_complex_numbers+0x8c>
jp     11ac <print_complex_numbers+0x8c>
mov    $0x30,%edi
jmp    1030 <putchar@plt>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    11b8 <print_complex_numbers+0x98>
jnp    11ce <print_complex_numbers+0xae>
ucomisd %xmm2,%xmm1
jne    11ce <print_complex_numbers+0xae>
jp     11ce <print_complex_numbers+0xae>
lea    0xe61(%rip),%rdi
mov    $0x1,%al
jmp    1040 <printf@plt>
ret

LLVM IR (-O0):
@.str = [12 x i8] c" %f - %f i \00"
@.str.1 = [12 x i8] c" %f + %f i \00"
@.str.2 = [7 x i8] c" %f i \00"
@.str.3 = [2 x i8] c"0\00"
@.str.4 = [5 x i8] c" %f \00"
define void @print_complex_numbers(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load double, double* %3
%9 = fcmp une double %8, 0.000000e+00
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fmul double -1.000000e+00, %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %11, double %13)
br label %55
15: ; preds = %7, %2
%16 = load double, double* %4
%17 = fcmp ogt double %16, 0.000000e+00
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load double, double* %3
%20 = fcmp une double %19, 0.000000e+00
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load double, double* %3
%23 = load double, double* %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %22, double %23)
br label %54
25: ; preds = %18, %15
%26 = load double, double* %3
%27 = fcmp oeq double %26, 0.000000e+00
br i1 %27, label %28, label %34
28: ; preds = %25
%29 = load double, double* %4
%30 = fcmp une double %29, 0.000000e+00
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load double, double* %4
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %32)
br label %53
34: ; preds = %28, %25
%35 = load double, double* %3
%36 = fcmp oeq double %35, 0.000000e+00
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load double, double* %4
%39 = fcmp oeq double %38, 0.000000e+00
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %52
42: ; preds = %37, %34
%43 = load double, double* %3
%44 = fcmp une double %43, 0.000000e+00
br i1 %44, label %45, label %51
45: ; preds = %42
%46 = load double, double* %4
%47 = fcmp oeq double %46, 0.000000e+00
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load double, double* %3
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %49)
br label %51
51: ; preds = %48, %45, %42
br label %52
52: ; preds = %51, %40
br label %53
53: ; preds = %52, %31
br label %54
54: ; preds = %53, %21
br label %55
55: ; preds = %54, %10
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c" %f - %f i \00"
@.str.1 = [12 x i8] c" %f + %f i \00"
@.str.2 = [7 x i8] c" %f i \00"
@.str.4 = [5 x i8] c" %f \00"
define void @print_complex_numbers(double %0, double %1) {
%3 = fcmp olt double %1, 0.000000e+00
%4 = fcmp une double %0, 0.000000e+00
%5 = and i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = fneg double %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %0, double %7)
br label %29
9: ; preds = %2
%10 = fcmp ogt double %1, 0.000000e+00
%11 = and i1 %4, %10
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %0, double %1)
br label %29
14: ; preds = %9
%15 = fcmp oeq double %0, 0.000000e+00
%16 = fcmp une double %1, 0.000000e+00
%17 = and i1 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %1)
br label %29
20: ; preds = %14
%21 = fcmp oeq double %1, 0.000000e+00
%22 = and i1 %15, %21
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = tail call i32 @putchar(i32 48)
br label %29
25: ; preds = %20
%26 = and i1 %4, %21
br i1 %26, label %27, label %29
27: ; preds = %25
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %0)
br label %29
29: ; preds = %12, %23, %27, %25, %18, %6
ret void
}