#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  size_t we_wordc;
  int /*<<< orphan*/ *we_wordv;
};
typedef TYPE_1__ wordexp_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ wordexp(char *, TYPE_1__ *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char *a = argv[1];
  printf("a >%s<\n", a);
  wordexp_t we;
  wordexp(a, &we, 0);
  for (size_t i = 0; i < we.we_wordc; ++i) {
    puts(we.we_wordv[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1050 <wordexp@plt>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    11a8 <main+0x78>
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <puts@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1179 <main+0x49>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rbx
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1050 <wordexp@plt>
cmpq   $0x0,(%rsp)
je     1177 <main+0x47>
xor    %ebx,%ebx
xchg   %ax,%ax
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,4),%edi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    (%rsp),%rbx
jb     1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i32* }
@.str = [8 x i8] c"a >%s<\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca %struct.TYPE_3__
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %6
%15 = call i32 @wordexp(i8* %14, %struct.TYPE_3__* %7, i32 0)
store i64 0, i64* %8
br label %16
16: ; preds = %28, %2
%17 = load i64, i64* %8
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
%19 = load i64, i64* %18
%20 = icmp ult i64 %17, %19
br i1 %20, label %21, label %31
21: ; preds = %16
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
%23 = load i32*, i32** %22
%24 = load i64, i64* %8
%25 = getelementptr inbounds i32, i32* %23, i64 %24
%26 = load i32, i32* %25
%27 = call i32 @puts(i32 %26)
br label %28
28: ; preds = %21
%29 = load i64, i64* %8
%30 = add i64 %29, 1
store i64 %30, i64* %8
br label %16
31: ; preds = %16
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i32* }
@.str = [8 x i8] c"a >%s<\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.TYPE_3__
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = bitcast %struct.TYPE_3__* %3 to i8*
%8 = call i32 @wordexp(i8* %5, %struct.TYPE_3__* %3, i32 0)
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 1
br label %15
14: ; preds = %15, %2
ret i32 0
15: ; preds = %12, %15
%16 = phi i64 [ 0, %12 ], [ %21, %15 ]
%17 = load i32*, i32** %13
%18 = getelementptr inbounds i32, i32* %17, i64 %16
%19 = load i32, i32* %18
%20 = call i32 @puts(i32 %19)
%21 = add nuw i64 %16, 1
%22 = load i64, i64* %9
%23 = icmp ult i64 %21, %22
br i1 %23, label %15, label %14
}