#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 int /*<<< orphan*/ ws;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ r_cons_printf(char *, char const *, char *, char const *);
int strlen(char const *);
void pair(const char *a, const char *b) {
  char ws[16];
  int al = strlen(a);
  if (!b)
    b = "";
  memset(ws, ' ', sizeof(ws));
  al = 9 - al;
  if (al < 0)
    al = 0;
  ws[al] = 0;
  r_cons_printf("%s%s%s\n", a, ws, b);
}


x86 assembly (clang, -O0):
<pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1162 <pair+0x32>
lea    0xea9(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x20,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
mov    $0x9,%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1191 <pair+0x61>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
mov    -0x8(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe53(%rip),%rdi
call   1030 <r_cons_printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
test   %rbx,%rbx
lea    0xeb5(%rip),%rbp
cmovne %rbx,%rbp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
mov    $0x9,%eax
xor    %ecx,%ecx
sub    %r15d,%eax
cmovs  %ecx,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xe7d(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
call   1030 <r_cons_printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [8 x i8] c"%s%s%s\0A\00"
define void @pair(i8* %0, i8* %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp eq i8* %1, null
%7 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%8 = call i32 @memset(i8* %4, i8 signext 32, i32 16)
%9 = sub nsw i32 9, %5
%10 = icmp sgt i32 %9, 0
%11 = select i1 %10, i32 %9, i32 0
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %12
store i8 0, i8* %13
%14 = call i32 @r_cons_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %4, i8* %7)
ret void
}