#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*/ AppendItem(char *, char *, int, int);
int strlen(char *);
void AppendPair(char *linea, char *a, char *lineb, char *b) {
  int lena, lenb, width;
  lena = strlen(a);
  lenb = strlen(b);
  width = ((lena >= lenb) ? lena : lenb) + 1;
  AppendItem(linea, a, lena, width);
  AppendItem(lineb, b, lenb, width);
}


x86 assembly (clang, -O0):
<AppendPair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jl     1167 <AppendPair+0x47>
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    116d <AppendPair+0x4d>
mov    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x2c(%rbp),%ecx
call   1040 <AppendItem@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
call   1040 <AppendItem@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AppendPair>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,(%rsp)
mov    %rsi,%r13
mov    %rdi,%r12
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
cmp    %eax,%r14d
mov    %r14d,%ebp
cmovl  %eax,%ebp
add    $0x1,%ebp
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1040 <AppendItem@plt>
mov    (%rsp),%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <AppendItem@plt>

LLVM IR (-O0):
define void @AppendPair(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %9
%14 = load i8*, i8** %8
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %10
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = icmp sge i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %4
%20 = load i32, i32* %9
br label %23
21: ; preds = %4
%22 = load i32, i32* %10
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
%25 = add nsw i32 %24, 1
store i32 %25, i32* %11
%26 = load i8*, i8** %5
%27 = load i8*, i8** %6
%28 = load i32, i32* %9
%29 = load i32, i32* %11
%30 = call i32 @AppendItem(i8* %26, i8* %27, i32 %28, i32 %29)
%31 = load i8*, i8** %7
%32 = load i8*, i8** %8
%33 = load i32, i32* %10
%34 = load i32, i32* %11
%35 = call i32 @AppendItem(i8* %31, i8* %32, i32 %33, i32 %34)
ret void
}

LLVM IR (-O2):
define void @AppendPair(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @strlen(i8* %3)
%7 = icmp slt i32 %5, %6
%8 = select i1 %7, i32 %6, i32 %5
%9 = add nsw i32 %8, 1
%10 = tail call i32 @AppendItem(i8* %0, i8* %1, i32 %5, i32 %9)
%11 = tail call i32 @AppendItem(i8* %2, i8* %3, i32 %6, i32 %9)
ret void
}