void print_host(const char *a, const char *b, int both) {
  int plen;
  plen = printf("%s", a);
  if (both)
    plen += printf(" (%s)", b);
  if (plen >= 52)
    plen = 52 - 1;
  printf("%*s", 52 - plen, "");
}


x86 assembly (clang, -O0):
<print_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115a <print_host+0x4a>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x34,-0x18(%rbp)
jl     116b <print_host+0x5b>
movl   $0x33,-0x18(%rbp)
mov    $0x34,%esi
sub    -0x18(%rbp),%esi
lea    0xe8f(%rip),%rdi
lea    0xe87(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_host>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rsi
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %eax,%ebx
test   %ebp,%ebp
je     1143 <print_host+0x33>
lea    0xecc(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %eax,%ebx
cmp    $0x33,%ebx
mov    $0x33,%eax
cmovl  %ebx,%eax
mov    $0x34,%esi
sub    %eax,%esi
lea    0xead(%rip),%rdi
lea    0xea5(%rip),%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c" (%s)\00"
@.str.2 = [4 x i8] c"%*s\00"
@.str.3 = [1 x i8] zeroinitializer
define void @print_host(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i32 %2, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = add nsw i32 %7, %4
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %8, %6 ], [ %4, %3 ]
%11 = icmp slt i32 %10, 51
%12 = select i1 %11, i32 %10, i32 51
%13 = sub nsw i32 52, %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}