#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_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  char **we_wordv;
  int we_wordc;
};
typedef TYPE_1__ wordexp_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ wordexp(char *, TYPE_1__ *, int /*<<< orphan*/);
int /*<<< orphan*/ wordfree(TYPE_1__ *);
int main(int argc, char **argv) {
  wordexp_t p;
  char **w;
  int i;
  wordexp("[p-t]*.*", &p, 0);
  w = p.we_wordv;
  for (i = 0; i < p.we_wordc; i++)
    printf("WOEX: %s\n", w[i]);
  wordfree(&p);
  exit(EXIT_SUCCESS);
}


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)
lea    0xea3(%rip),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1060 <wordexp@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11a9 <main+0x69>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1177 <main+0x37>
lea    -0x20(%rbp),%rdi
call   1040 <wordfree@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1060 <wordexp@plt>
cmpl   $0x0,0x8(%rsp)
jle    118a <main+0x4a>
mov    (%rsp),%r15
xor    %ebx,%ebx
lea    0xe9b(%rip),%r14
xchg   %ax,%ax
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
cmp    %rax,%rbx
jl     1170 <main+0x30>
mov    %rsp,%rdi
call   1040 <wordfree@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i8**, i32 }
@.str = [9 x i8] c"[p-t]*.*\00"
@.str.1 = [10 x i8] c"WOEX: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.TYPE_4__
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @wordexp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.TYPE_4__* %6, i32 0)
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%11 = load i8**, i8*** %10
store i8** %11, i8*** %7
store i32 0, i32* %8
br label %12
12: ; preds = %24, %2
%13 = load i32, i32* %8
%14 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 1
%15 = load i32, i32* %14
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %27
17: ; preds = %12
%18 = load i8**, i8*** %7
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %17
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %12
27: ; preds = %12
%28 = call i32 @wordfree(%struct.TYPE_4__* %6)
%29 = load i32, i32* @EXIT_SUCCESS
%30 = call i32 @exit(i32 %29)
unreachable
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i8**, i32 }
@.str = [9 x i8] c"[p-t]*.*\00"
@.str.1 = [10 x i8] c"WOEX: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.TYPE_4__
%4 = bitcast %struct.TYPE_4__* %3 to i8*
%5 = call i32 @wordexp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.TYPE_4__* %3, i32 0)
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%7 = load i8**, i8*** %6
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 1
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %2, %11
%12 = phi i64 [ %16, %11 ], [ 0, %2 ]
%13 = getelementptr inbounds i8*, i8** %7, i64 %12
%14 = load i8*, i8** %13
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = add nuw nsw i64 %12, 1
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %16, %18
br i1 %19, label %11, label %20
20: ; preds = %11, %2
%21 = call i32 @wordfree(%struct.TYPE_4__* %3)
%22 = load i32, i32* @EXIT_SUCCESS
%23 = call i32 @exit(i32 %22)
unreachable
}