#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void b_echo(int arg_c, char arg[][100 + 1]) {
  for (int i = 1; i < arg_c; ++i) {
    fflush(stdout);
    fprintf(stdout, "%s ", arg[i]);
  }
  fprintf(stdout, "%s\n", arg[arg_c]);
}


x86 assembly (clang, -O0):
<b_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1182 <b_echo+0x62>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rax
imul   $0x65,%rax,%rax
add    %rax,%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <b_echo+0x16>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
movslq -0x4(%rbp),%rax
imul   $0x65,%rax,%rax
add    %rax,%rdx
lea    0xe63(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_echo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%r14d
cmp    $0x2,%edi
jl     1172 <b_echo+0x52>
mov    %r14d,%ebx
lea    0x65(%r15),%rbp
add    $0xffffffffffffffff,%rbx
mov    0x2e98(%rip),%r13
lea    0xeb1(%rip),%r12
nop
mov    0x0(%r13),%edi
call   1040 <fflush@plt>
mov    0x0(%r13),%edi
mov    %r12,%rsi
mov    %rbp,%rdx
call   1030 <fprintf@plt>
add    $0x65,%rbp
add    $0xffffffffffffffff,%rbx
jne    1150 <b_echo+0x30>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
movslq %r14d,%rax
imul   $0x65,%rax,%rax
add    %rax,%r15
lea    0xe78(%rip),%rsi
mov    %r15,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @b_echo(i32 %0, [101 x i8]* %1) {
%3 = alloca i32
%4 = alloca [101 x i8]*
%5 = alloca i32
store i32 %0, i32* %3
store [101 x i8]* %1, [101 x i8]** %4
store i32 1, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
%13 = load i32, i32* @stdout
%14 = load [101 x i8]*, [101 x i8]** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [101 x i8], [101 x i8]* %14, i64 %16
%18 = getelementptr inbounds [101 x i8], [101 x i8]* %17, i64 0, i64 0
%19 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %10
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
%24 = load i32, i32* @stdout
%25 = load [101 x i8]*, [101 x i8]** %4
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [101 x i8], [101 x i8]* %25, i64 %27
%29 = getelementptr inbounds [101 x i8], [101 x i8]* %28, i64 0, i64 0
%30 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %29)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @b_echo(i32 %0, [101 x i8]* %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %11
6: ; preds = %11, %2
%7 = load i32, i32* @stdout
%8 = sext i32 %0 to i64
%9 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 %8, i64 0
%10 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
11: ; preds = %4, %11
%12 = phi i64 [ 1, %4 ], [ %18, %11 ]
%13 = load i32, i32* @stdout
%14 = tail call i32 @fflush(i32 %13)
%15 = load i32, i32* @stdout
%16 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 %12, i64 0
%17 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = add nuw nsw i64 %12, 1
%19 = icmp eq i64 %18, %5
br i1 %19, label %6, label %11
}