#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*/ assert(int);
int /*<<< orphan*/ newarg(char *);
int /*<<< orphan*/ pusharg(int /*<<< orphan*/);
void push_command_line(int argc, char **argv) {
  assert(argc > 0);
  for (argc--; argc; argc--)
    pusharg(newarg(argv[argc]));
}


x86 assembly (clang, -O0):
<push_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1189 <push_command_line+0x59>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <newarg@plt>
mov    %eax,%edi
call   1050 <pusharg@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <push_command_line+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_command_line>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%r15d
xor    %edi,%edi
test   %r15d,%r15d
setg   %dil
call   1030 <assert@plt>
mov    %r15d,%eax
add    $0xffffffff,%eax
je     1188 <push_command_line+0x58>
cltq
lea    (%r14,%rax,8),%r14
mov    $0x1,%ebp
sub    %r15d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1040 <newarg@plt>
mov    %eax,%edi
call   1050 <pusharg@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%ebp
jne    1170 <push_command_line+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @push_command_line(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
store i32 %10, i32* %3
br label %11
11: ; preds = %22, %2
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load i8**, i8*** %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @newarg(i8* %19)
%21 = call i32 @pusharg(i32 %20)
br label %22
22: ; preds = %14
%23 = load i32, i32* %3
%24 = add nsw i32 %23, -1
store i32 %24, i32* %3
br label %11
25: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @push_command_line(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = add i32 %0, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %19, label %8
8: ; preds = %2
%9 = sext i32 %6 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ %9, %8 ], [ %16, %10 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @newarg(i8* %13)
%15 = tail call i32 @pusharg(i32 %14)
%16 = add nsw i64 %11, -1
%17 = trunc i64 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %10
19: ; preds = %10, %2
ret void
}