#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 EXIT_SUCCESS;
int atoi(char *);
char *join_list(char const, int, char **);
int /*<<< orphan*/ printf(char *, char *);
int join_list_wrapper(char **av) {
  const char sep = av[2][0];
  int count = atoi(av[3]);
  char *output;
  output = join_list(sep, count, av + 4);
  printf("%s\n", output);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<join_list_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rdx
add    $0x20,%rdx
movsbl %al,%edi
call   1040 <join_list@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_list_wrapper>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x10(%rdi),%rax
mov    0x18(%rdi),%rdi
movsbl (%rax),%ebp
call   1050 <atoi@plt>
add    $0x20,%rbx
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <join_list@plt>
lea    0xea3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @join_list_wrapper(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8*
store i8** %0, i8*** %2
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
store i8 %10, i8* %3
%11 = load i8**, i8*** %2
%12 = getelementptr inbounds i8*, i8** %11, i64 3
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %4
%15 = load i8, i8* %3
%16 = load i32, i32* %4
%17 = load i8**, i8*** %2
%18 = getelementptr inbounds i8*, i8** %17, i64 4
%19 = call i8* @join_list(i8 signext %15, i32 %16, i8** %18)
store i8* %19, i8** %5
%20 = load i8*, i8** %5
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i32, i32* @EXIT_SUCCESS
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @join_list_wrapper(i8** %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8*, i8** %0, i64 3
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %0, i64 4
%9 = tail call i8* @join_list(i8 signext %4, i32 %7, i8** %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}