#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*/ INIT_COMP(void (*)(int, char **));
int /*<<< orphan*/ INIT_COMP_ACTIVE_PORT(void (*)(int, char **), int,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ INIT_COMP_PASSIVE_PORT(void (*)(int, char **),
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ WRITE_DEBUG_INFO_COMP(char *, int);
int /*<<< orphan*/ atoi(char *);
void BrzWhile(int num, char *args[]) {
  INIT_COMP(BrzWhile);
  INIT_COMP_PASSIVE_PORT(BrzWhile, 0, atoi(args[0]));
  INIT_COMP_ACTIVE_PORT(BrzWhile, 1, atoi(args[1]));
  INIT_COMP_ACTIVE_PORT(BrzWhile, 2, atoi(args[2]));
  WRITE_DEBUG_INFO_COMP("DO", 3);
}


x86 assembly (clang, -O0):
<BrzWhile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e82(%rip),%rdi
call   1060 <INIT_COMP@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,%edx
mov    0x2e68(%rip),%rdi
xor    %esi,%esi
call   1030 <INIT_COMP_PASSIVE_PORT@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,%edx
mov    0x2e4b(%rip),%rdi
mov    $0x1,%esi
call   1040 <INIT_COMP_ACTIVE_PORT@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,%edx
mov    0x2e2b(%rip),%rdi
mov    $0x2,%esi
call   1040 <INIT_COMP_ACTIVE_PORT@plt>
lea    0xe32(%rip),%rdi
mov    $0x3,%esi
call   1050 <WRITE_DEBUG_INFO_COMP@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzWhile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e8a(%rip),%r14
mov    %r14,%rdi
call   1060 <INIT_COMP@plt>
mov    (%rbx),%rdi
call   1070 <atoi@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1030 <INIT_COMP_PASSIVE_PORT@plt>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1040 <INIT_COMP_ACTIVE_PORT@plt>
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1040 <INIT_COMP_ACTIVE_PORT@plt>
lea    0xe4f(%rip),%rdi
mov    $0x3,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <WRITE_DEBUG_INFO_COMP@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"DO\00"
define void @BrzWhile(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @INIT_COMP(void (i32, i8**)* @BrzWhile)
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = call i32 @INIT_COMP_PASSIVE_PORT(void (i32, i8**)* @BrzWhile, i32 0, i32 %9)
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
%15 = call i32 @INIT_COMP_ACTIVE_PORT(void (i32, i8**)* @BrzWhile, i32 1, i32 %14)
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
%20 = call i32 @INIT_COMP_ACTIVE_PORT(void (i32, i8**)* @BrzWhile, i32 2, i32 %19)
%21 = call i32 @WRITE_DEBUG_INFO_COMP(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"DO\00"
define void @BrzWhile(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @INIT_COMP(void (i32, i8**)* @BrzWhile)
%4 = load i8*, i8** %1
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @INIT_COMP_PASSIVE_PORT(void (i32, i8**)* @BrzWhile, i32 0, i32 %5)
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @INIT_COMP_ACTIVE_PORT(void (i32, i8**)* @BrzWhile, i32 1, i32 %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = tail call i32 @INIT_COMP_ACTIVE_PORT(void (i32, i8**)* @BrzWhile, i32 2, i32 %13)
%15 = tail call i32 @WRITE_DEBUG_INFO_COMP(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}