#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*/ printf(char *, ...);
void show_state(char *run_buffer_array[], int args_count) {
  static int i;
  printf("Command: %s\n", run_buffer_array[0]);
  for (i = 0; i < args_count; i++) {
    printf("Argument %d: %s\n", i, run_buffer_array[1 + i]);
  }
}


x86 assembly (clang, -O0):
<show_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,0x2eee(%rip)
mov    0x2ee8(%rip),%eax
cmp    -0xc(%rbp),%eax
jge    1189 <show_state+0x79>
mov    0x2ed9(%rip),%esi
mov    -0x8(%rbp),%rax
mov    0x2ecf(%rip),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2eb1(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ea8(%rip)
jmp    113e <show_state+0x2e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_state>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x0,0x2ef8(%rip)
test   %ebp,%ebp
jle    1175 <show_state+0x65>
lea    0xece(%rip),%r14
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %eax,%rsi
mov    0x8(%rbx,%rsi,8),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2ec4(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ebb(%rip)
cmp    %ebp,%eax
jl     1150 <show_state+0x40>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@show_state.i = internal unnamed_addr global i32 0
@.str = [13 x i8] c"Command: %s\0A\00"
@.str.1 = [17 x i8] c"Argument %d: %s\0A\00"
define void @show_state(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
store i32 0, i32* @show_state.i
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %16
6: ; preds = %2, %6
%7 = phi i32 [ %14, %6 ], [ 0, %2 ]
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* %11)
%13 = load i32, i32* @show_state.i
%14 = add nsw i32 %13, 1
store i32 %14, i32* @show_state.i
%15 = icmp slt i32 %14, %1
br i1 %15, label %6, label %16
16: ; preds = %6, %2
ret void
}