#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 */
scalar_t__ is_complex_rettype(int);
int /*<<< orphan*/ print_ulps_helper(char *, long long, char **);
void print_ulps(int rettype, long long ulpsr, long long ulpsi, char **failp) {
  if (is_complex_rettype(rettype)) {
    if (ulpsr)
      print_ulps_helper("ulpsr", ulpsr, failp);
    if (ulpsi)
      print_ulps_helper("ulpsi", ulpsi, failp);
  } else {
    if (ulpsr)
      print_ulps_helper("ulps", ulpsr, failp);
  }
}


x86 assembly (clang, -O0):
<print_ulps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <is_complex_rettype@plt>
cmp    $0x0,%rax
je     118c <print_ulps+0x6c>
cmpq   $0x0,-0x10(%rbp)
je     1168 <print_ulps+0x48>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe9d(%rip),%rdi
call   1030 <print_ulps_helper@plt>
cmpq   $0x0,-0x18(%rbp)
je     1187 <print_ulps+0x67>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe84(%rip),%rdi
call   1030 <print_ulps_helper@plt>
jmp    11b0 <print_ulps+0x90>
cmpq   $0x0,-0x10(%rbp)
je     11ab <print_ulps+0x8b>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe66(%rip),%rdi
call   1030 <print_ulps_helper@plt>
jmp    11b0 <print_ulps+0x90>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ulps>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
call   1040 <is_complex_rettype@plt>
test   %rax,%rax
je     1160 <print_ulps+0x40>
test   %rbx,%rbx
je     114f <print_ulps+0x2f>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <print_ulps_helper@plt>
test   %r15,%r15
je     117c <print_ulps+0x5c>
lea    0xeab(%rip),%rdi
mov    %r15,%rsi
jmp    116f <print_ulps+0x4f>
test   %rbx,%rbx
je     117c <print_ulps+0x5c>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <print_ulps_helper@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ulpsr\00"
@.str.1 = [6 x i8] c"ulpsi\00"
@.str.2 = [5 x i8] c"ulps\00"
define void @print_ulps(i32 %0, i64 %1, i64 %2, i8** %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8**
store i32 %0, i32* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8** %3, i8*** %8
%9 = load i32, i32* %5
%10 = call i64 @is_complex_rettype(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %4
%13 = load i64, i64* %6
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i64, i64* %6
%17 = load i8**, i8*** %8
%18 = call i32 @print_ulps_helper(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %16, i8** %17)
br label %19
19: ; preds = %15, %12
%20 = load i64, i64* %7
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i64, i64* %7
%24 = load i8**, i8*** %8
%25 = call i32 @print_ulps_helper(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %23, i8** %24)
br label %26
26: ; preds = %22, %19
br label %35
27: ; preds = %4
%28 = load i64, i64* %6
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = load i64, i64* %6
%32 = load i8**, i8*** %8
%33 = call i32 @print_ulps_helper(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %31, i8** %32)
br label %34
34: ; preds = %30, %27
br label %35
35: ; preds = %34, %26
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ulpsr\00"
@.str.1 = [6 x i8] c"ulpsi\00"
@.str.2 = [5 x i8] c"ulps\00"
define void @print_ulps(i32 %0, i64 %1, i64 %2, i8** %3) {
%5 = tail call i64 @is_complex_rettype(i32 %0)
%6 = icmp eq i64 %5, 0
%7 = icmp eq i64 %1, 0
br i1 %6, label %15, label %8
8: ; preds = %4
br i1 %7, label %11, label %9
9: ; preds = %8
%10 = tail call i32 @print_ulps_helper(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %1, i8** %3)
br label %11
11: ; preds = %9, %8
%12 = icmp eq i64 %2, 0
br i1 %12, label %18, label %13
13: ; preds = %11
%14 = tail call i32 @print_ulps_helper(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %2, i8** %3)
br label %18
15: ; preds = %4
br i1 %7, label %18, label %16
16: ; preds = %15
%17 = tail call i32 @print_ulps_helper(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %1, i8** %3)
br label %18
18: ; preds = %15, %16, %11, %13
ret void
}