#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*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ swprintf(int /*<<< orphan*/ *, size_t, char *,
                            int /*<<< orphan*/ *);
int /*<<< orphan*/ wcslcpy(int /*<<< orphan*/ *, char *, size_t);
void cmd_sep_exec(int argc, wchar_t **argv, wchar_t *out, size_t len) {
  (void)argc;
  (void)argv;
  if (argc != 2) {
    wcslcpy(out, L"<sep-bad-arg>", len);
    return;
  }
  swprintf(out, len, L"%ls", argv[1]);
}


x86 assembly (clang, -O0):
<cmd_sep_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     115a <cmd_sep_exec+0x3a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <wcslcpy@plt>
jmp    1176 <cmd_sep_exec+0x56>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xec7(%rip),%rdx
call   1030 <swprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_sep_exec>:
mov    %rdx,%rax
cmp    $0x2,%edi
jne    1141 <cmd_sep_exec+0x21>
mov    0x8(%rsi),%r8
lea    0xf05(%rip),%rdx
mov    %rax,%rdi
mov    %rcx,%rsi
mov    %r8,%rcx
jmp    1030 <swprintf@plt>
lea    0xeb8(%rip),%rsi
mov    %rax,%rdi
mov    %rcx,%rdx
jmp    1040 <wcslcpy@plt>

LLVM IR (-O0):
@.str = [14 x i32] [i32 60, i32 115, i32 101, i32 112, i32 45, i32 98, i32 97, i32 100, i32 45, i32 97, i32 114, i32 103, i32 62, i32 0]
@.str.1 = [4 x i32] [i32 37, i32 108, i32 115, i32 0]
define void @cmd_sep_exec(i32 %0, i32** %1, i32* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i64
store i32 %0, i32* %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32**, i32*** %6
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = load i32*, i32** %7
%15 = load i64, i64* %8
%16 = call i32 @wcslcpy(i32* %14, i8* bitcast ([14 x i32]* @.str to i8*), i64 %15)
br label %24
17: ; preds = %4
%18 = load i32*, i32** %7
%19 = load i64, i64* %8
%20 = load i32**, i32*** %6
%21 = getelementptr inbounds i32*, i32** %20, i64 1
%22 = load i32*, i32** %21
%23 = call i32 @swprintf(i32* %18, i64 %19, i8* bitcast ([4 x i32]* @.str.1 to i8*), i32* %22)
br label %24
24: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
@.str = [14 x i32] [i32 60, i32 115, i32 101, i32 112, i32 45, i32 98, i32 97, i32 100, i32 45, i32 97, i32 114, i32 103, i32 62, i32 0]
@.str.1 = [4 x i32] [i32 37, i32 108, i32 115, i32 0]
define void @cmd_sep_exec(i32 %0, i32** nocapture %1, i32* %2, i64 %3) {
%5 = icmp eq i32 %0, 2
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @wcslcpy(i32* %2, i8* bitcast ([14 x i32]* @.str to i8*), i64 %3)
br label %12
8: ; preds = %4
%9 = getelementptr inbounds i32*, i32** %1, i64 1
%10 = load i32*, i32** %9
%11 = tail call i32 @swprintf(i32* %2, i64 %3, i8* bitcast ([4 x i32]* @.str.1 to i8*), i32* %10)
br label %12
12: ; preds = %8, %6
ret void
}