#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*/ aff_cmd(char *, char *);
int /*<<< orphan*/ ft_putstr(char *);
scalar_t__ ft_strcmp(char *, int /*<<< orphan*/);
int /*<<< orphan*/ ft_strjoin(char *, char *);
void show_argument_completion(char **tab, char *str) {
  int i;
  i = 0;
  ft_putstr("\n");
  while (tab[i]) {
    if (ft_strcmp(tab[i], ft_strjoin(str, "*"))) {
      aff_cmd(tab[i], str);
      ft_putstr("\n");
    }
    ++i;
  }
}


x86 assembly (clang, -O0):
<show_argument_completion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xea2(%rip),%rdi
call   1060 <ft_putstr@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11da <show_argument_completion+0x9a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe71(%rip),%rsi
call   1050 <ft_strjoin@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <ft_strcmp@plt>
cmp    $0x0,%rax
je     11cc <show_argument_completion+0x8c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <aff_cmd@plt>
lea    0xe39(%rip),%rdi
call   1060 <ft_putstr@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <show_argument_completion+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_argument_completion>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeaa(%rip),%rdi
call   1060 <ft_putstr@plt>
mov    (%rbx),%r13
test   %r13,%r13
je     11bc <show_argument_completion+0x7c>
add    $0x8,%rbx
lea    0xe94(%rip),%r15
lea    0xe8b(%rip),%r12
jmp    118c <show_argument_completion+0x4c>
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%r13
add    $0x8,%rbx
test   %r13,%r13
je     11bc <show_argument_completion+0x7c>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <ft_strjoin@plt>
mov    %r13,%rdi
mov    %eax,%esi
call   1040 <ft_strcmp@plt>
test   %rax,%rax
je     1180 <show_argument_completion+0x40>
mov    -0x8(%rbx),%rdi
mov    %r14,%rsi
call   1030 <aff_cmd@plt>
mov    %r12,%rdi
call   1060 <ft_putstr@plt>
jmp    1180 <show_argument_completion+0x40>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c"*\00"
define void @show_argument_completion(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i32
store i8** %0, i8*** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = call i32 @ft_putstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %33, %2
%8 = load i8**, i8*** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %36
14: ; preds = %7
%15 = load i8**, i8*** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = load i8*, i8** %4
%21 = call i32 @ft_strjoin(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = call i64 @ft_strcmp(i8* %19, i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %33
24: ; preds = %14
%25 = load i8**, i8*** %3
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = load i8*, i8** %4
%31 = call i32 @aff_cmd(i8* %29, i8* %30)
%32 = call i32 @ft_putstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %33
33: ; preds = %24, %14
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %7
36: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c"*\00"
define void @show_argument_completion(i8** nocapture %0, i8* %1) {
%3 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %22, label %6
6: ; preds = %2, %17
%7 = phi i64 [ %18, %17 ], [ 0, %2 ]
%8 = phi i8* [ %20, %17 ], [ %4, %2 ]
%9 = phi i8** [ %19, %17 ], [ %0, %2 ]
%10 = tail call i32 @ft_strjoin(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i64 @ft_strcmp(i8* %8, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %6
%14 = load i8*, i8** %9
%15 = tail call i32 @aff_cmd(i8* %14, i8* %1)
%16 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %13, %6
%18 = add nuw i64 %7, 1
%19 = getelementptr inbounds i8*, i8** %0, i64 %18
%20 = load i8*, i8** %19
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %6
22: ; preds = %17, %2
ret void
}