#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 *, char const *);
int /*<<< orphan*/ putchar(char);
void printo(const char *o) {
  static int sep = 0;
  if (!sep) {
    putchar('(');
    sep = 1;
  } else if (o) {
    putchar(',');
    putchar(' ');
  }
  if (!o) {
    putchar(')');
    putchar(' ');
    sep = 0;
  } else
    printf("%s", o);
}


x86 assembly (clang, -O0):
<printo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2f01(%rip)
jne    1152 <printo+0x32>
mov    $0x28,%edi
call   1030 <putchar@plt>
movl   $0x1,0x2ee7(%rip)
jmp    1176 <printo+0x56>
cmpq   $0x0,-0x8(%rbp)
je     1171 <printo+0x51>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1176 <printo+0x56>
cmpq   $0x0,-0x8(%rbp)
jne    11a4 <printo+0x84>
mov    $0x29,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movl   $0x0,0x2e95(%rip)
jmp    11b4 <printo+0x94>
mov    -0x8(%rbp),%rsi
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printo>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x1,0x2f09(%rip)
jne    1148 <printo+0x28>
test   %rbx,%rbx
je     116e <printo+0x4e>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    115e <printo+0x3e>
mov    $0x28,%edi
call   1030 <putchar@plt>
movb   $0x1,0x2edb(%rip)
test   %rbx,%rbx
je     116e <printo+0x4e>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>
mov    $0x29,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movb   $0x0,0x2eab(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@printo.sep = internal global i32 0
@.str = [3 x i8] c"%s\00"
define void @printo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @printo.sep
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @putchar(i8 signext 40)
store i32 1, i32* @printo.sep
br label %14
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = call i32 @putchar(i8 signext 44)
%12 = call i32 @putchar(i8 signext 32)
br label %13
13: ; preds = %10, %7
br label %14
14: ; preds = %13, %5
%15 = load i8*, i8** %2
%16 = icmp ne i8* %15, null
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = call i32 @putchar(i8 signext 41)
%19 = call i32 @putchar(i8 signext 32)
store i32 0, i32* @printo.sep
br label %23
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %20, %17
ret void
}

LLVM IR (-O2):
@printo.sep = internal unnamed_addr global i1 false
@.str = [3 x i8] c"%s\00"
define void @printo(i8* %0) {
%2 = load i1, i1* @printo.sep
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = icmp eq i8* %0, null
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = tail call i32 @putchar(i8 signext 44)
%7 = tail call i32 @putchar(i8 signext 32)
br label %14
8: ; preds = %1
%9 = tail call i32 @putchar(i8 signext 40)
store i1 true, i1* @printo.sep
%10 = icmp eq i8* %0, null
br i1 %10, label %11, label %14
11: ; preds = %3, %8
%12 = tail call i32 @putchar(i8 signext 41)
%13 = tail call i32 @putchar(i8 signext 32)
store i1 false, i1* @printo.sep
br label %16
14: ; preds = %5, %8
%15 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %16
16: ; preds = %14, %11
ret void
}