#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*/ expand(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int main(int argc, char *argv[]) {
  if (argc == 1)
    printf("Usage: ./a.out args\n");
  else {
    char s2[1000];
    while ((*++argv) != NULL) {
      expand(*argv, s2);
      printf("%s ", s2);
    }
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1166 <main+0x36>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11bc <main+0x8c>
jmp    116b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     11b2 <main+0x82>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0x400(%rbp),%rsi
call   1050 <expand@plt>
lea    -0x400(%rbp),%rsi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    116b <main+0x3b>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x3f0,%rsp
cmp    $0x1,%edi
jne    115f <main+0x1f>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
jmp    11ab <main+0x6b>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     11a1 <main+0x61>
add    $0x10,%rbx
mov    %rsp,%r14
lea    0xe87(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rsi
call   1060 <expand@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1180 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: ./a.out args\0A\00"
@.str.1 = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %26
11: ; preds = %2
br label %12
12: ; preds = %17, %11
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %5
%15 = load i8*, i8** %14
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %24
17: ; preds = %12
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%21 = call i32 @expand(i8* %19, i8* %20)
%22 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %22)
br label %12
24: ; preds = %12
%25 = call i32 @putchar(i8 signext 10)
br label %26
26: ; preds = %24, %9
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%s \00"
@str = [20 x i8] c"Usage: ./a.out args\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1000 x i8]
%4 = icmp eq i32 %0, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %22
7: ; preds = %2
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %20, label %12
12: ; preds = %7, %12
%13 = phi i8* [ %18, %12 ], [ %10, %7 ]
%14 = phi i8** [ %17, %12 ], [ %9, %7 ]
%15 = call i32 @expand(i8* %13, i8* %8)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%17 = getelementptr inbounds i8*, i8** %14, i64 1
%18 = load i8*, i8** %17
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %12
20: ; preds = %12, %7
%21 = call i32 @putchar(i8 signext 10)
br label %22
22: ; preds = %20, %5
ret i32 0
}