#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__ point(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putfont(char *);
int /*<<< orphan*/ putsize(char *);
void puttext(char *s, char *fn, char *size) {
  if (point(s)) {
    putfont(fn);
    putsize(size);
    printf("%s", s);
    if (*fn)
      printf("\\f\\*(#e");
    if (size != NULL)
      putsize("0");
  }
}


x86 assembly (clang, -O0):
<puttext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <point@plt>
cmp    $0x0,%rax
je     11c2 <puttext+0x82>
mov    -0x10(%rbp),%rdi
call   1050 <putfont@plt>
mov    -0x18(%rbp),%rdi
call   1030 <putsize@plt>
mov    -0x8(%rbp),%rsi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11a6 <puttext+0x66>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
je     11bd <puttext+0x7d>
lea    0xe53(%rip),%rdi
call   1030 <putsize@plt>
jmp    11c2 <puttext+0x82>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puttext>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1060 <point@plt>
test   %rax,%rax
je     11a3 <puttext+0x63>
mov    %r15,%rdi
call   1050 <putfont@plt>
mov    %r14,%rdi
call   1030 <putsize@plt>
lea    0xe91(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
cmpb   $0x0,(%r15)
je     118d <puttext+0x4d>
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14,%r14
je     11a3 <puttext+0x63>
lea    0xe72(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putsize@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"\\f\\*(#e\00"
@.str.2 = [2 x i8] c"0\00"
define void @puttext(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @point(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3
%7 = tail call i32 @putfont(i8* %1)
%8 = tail call i32 @putsize(i8* %2)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = load i8, i8* %1
%11 = icmp eq i8 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %6
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
%15 = icmp eq i8* %2, null
br i1 %15, label %18, label %16
16: ; preds = %14
%17 = tail call i32 @putsize(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %14, %16, %3
ret void
}