#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 */
typedef scalar_t__ uint;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, ...);
void fout(FILE *out, uint *first, uint known, double value) {
  char *space = " ";
  if (*first) {
    space = "";
    *first = 0;
  }
  if (!known) {
    fprintf(out, "%s?", space);
    return;
  }
  fprintf(out, "%s%f", space, value);
}


x86 assembly (clang, -O0):
<fout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
lea    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1158 <fout+0x48>
lea    0xeb8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0x0,-0x18(%rbp)
jne    117e <fout+0x6e>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1199 <fout+0x89>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
lea    0xe74(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fout>:
mov    %rdx,%rax
cmpq   $0x0,(%rsi)
je     113a <fout+0x2a>
movq   $0x0,(%rsi)
lea    0xeda(%rip),%rdx
test   %rax,%rax
je     1146 <fout+0x36>
lea    0xed3(%rip),%rsi
mov    $0x1,%al
jmp    1030 <fprintf@plt>
lea    0xebf(%rip),%rdx
test   %rax,%rax
jne    112c <fout+0x1c>
lea    0xeb5(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"%s?\00"
@.str.3 = [5 x i8] c"%s%f\00"
define void @fout(i32* %0, i64* %1, i64 %2, double %3) {
%5 = alloca i32*
%6 = alloca i64*
%7 = alloca i64
%8 = alloca double
%9 = alloca i8*
store i32* %0, i32** %5
store i64* %1, i64** %6
store i64 %2, i64* %7
store double %3, double* %8
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = load i64*, i64** %6
%11 = load i64, i64* %10
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %4
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %9
%14 = load i64*, i64** %6
store i64 0, i64* %14
br label %15
15: ; preds = %13, %4
%16 = load i64, i64* %7
%17 = icmp ne i64 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = load i32*, i32** %5
%20 = load i8*, i8** %9
%21 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %20)
br label %27
22: ; preds = %15
%23 = load i32*, i32** %5
%24 = load i8*, i8** %9
%25 = load double, double* %8
%26 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %24, double %25)
br label %27
27: ; preds = %22, %18
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"%s?\00"
@.str.3 = [5 x i8] c"%s%f\00"
define void @fout(i32* nocapture %0, i64* nocapture %1, i64 %2, double %3) {
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
store i64 0, i64* %1
br label %8
8: ; preds = %7, %4
%9 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %7 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %4 ]
%10 = icmp eq i64 %2, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %9)
br label %15
13: ; preds = %8
%14 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %9, double %3)
br label %15
15: ; preds = %13, %11
ret void
}