#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 add_strings_short_to_long(char const *, char const *, char **);
scalar_t__ strlen(char const *);
int add_digit_strings(const char *in_1_string, const char *in_2_string,
                      char **out_string_ptr) {
  int status;
  if (strlen(in_2_string) < strlen(in_1_string))
    status =
        add_strings_short_to_long(in_2_string, in_1_string, out_string_ptr);
  else
    status =
        add_strings_short_to_long(in_1_string, in_2_string, out_string_ptr);
  return status;
}


x86 assembly (clang, -O0):
<add_digit_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jge    1173 <add_digit_strings+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <add_strings_short_to_long@plt>
mov    %eax,-0x1c(%rbp)
jmp    1187 <add_digit_strings+0x67>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <add_strings_short_to_long@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_digit_strings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %rax,%r12
jge    1151 <add_digit_strings+0x31>
mov    %r15,%rdi
mov    %rbx,%rsi
jmp    1157 <add_digit_strings+0x37>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <add_strings_short_to_long@plt>

LLVM IR (-O0):
define i32 @add_digit_strings(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = icmp slt i64 %9, %11
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = load i8*, i8** %4
%16 = load i8**, i8*** %6
%17 = call i32 @add_strings_short_to_long(i8* %14, i8* %15, i8** %16)
store i32 %17, i32* %7
br label %23
18: ; preds = %3
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = load i8**, i8*** %6
%22 = call i32 @add_strings_short_to_long(i8* %19, i8* %20, i8** %21)
store i32 %22, i32* %7
br label %23
23: ; preds = %18, %13
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @add_digit_strings(i8* %0, i8* %1, i8** %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = icmp slt i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @add_strings_short_to_long(i8* %1, i8* %0, i8** %2)
br label %11
9: ; preds = %3
%10 = tail call i32 @add_strings_short_to_long(i8* %0, i8* %1, i8** %2)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}