#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);
int /*<<< orphan*/ INIT_COMP_CONTROLLED_DATA_PORT(int, int);
int /*<<< orphan*/ INIT_COMP_PASSIVE_PORT(void (*)(int, char **),
                                          int /*<<< orphan*/, int);
int /*<<< orphan*/ WRITE_DEBUG_INFO_COMP(char *, int);
int arg2bool(char *);
int atoi(char *);
void BrzFetch(int num, char *args[]) {
  int isOutBroad = arg2bool(args[1]);
  int in = atoi(args[2]);
  int out1 = atoi(args[3]);
  int out2 = atoi(args[4]);
  INIT_COMP(BrzFetch);
  INIT_COMP_PASSIVE_PORT(BrzFetch, 0, in);
  INIT_COMP_ACTIVE_PORT(BrzFetch, 1, out1);
  INIT_COMP_ACTIVE_PORT(BrzFetch, 2, out2);
  INIT_COMP_CONTROLLED_DATA_PORT(2, out2);
  WRITE_DEBUG_INFO_COMP("->", 3);
}


x86 assembly (clang, -O0):
<BrzFetch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <arg2bool@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e1a(%rip),%rdi
call   1080 <INIT_COMP@plt>
mov    -0x18(%rbp),%edx
mov    0x2e0b(%rip),%rdi
xor    %esi,%esi
call   1030 <INIT_COMP_PASSIVE_PORT@plt>
mov    -0x1c(%rbp),%edx
mov    0x2dfa(%rip),%rdi
mov    $0x1,%esi
call   1040 <INIT_COMP_ACTIVE_PORT@plt>
mov    -0x20(%rbp),%edx
mov    0x2de6(%rip),%rdi
mov    $0x2,%esi
call   1040 <INIT_COMP_ACTIVE_PORT@plt>
mov    -0x20(%rbp),%esi
mov    $0x2,%edi
call   1050 <INIT_COMP_CONTROLLED_DATA_PORT@plt>
lea    0xde8(%rip),%rdi
mov    $0x3,%esi
call   1060 <WRITE_DEBUG_INFO_COMP@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzFetch>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1070 <arg2bool@plt>
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r15d
mov    0x18(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r14d
mov    0x20(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebx
mov    0x2e33(%rip),%rbp
mov    %rbp,%rdi
call   1080 <INIT_COMP@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %r15d,%edx
call   1030 <INIT_COMP_PASSIVE_PORT@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
call   1040 <INIT_COMP_ACTIVE_PORT@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    %ebx,%edx
call   1040 <INIT_COMP_ACTIVE_PORT@plt>
mov    $0x2,%edi
mov    %ebx,%esi
call   1050 <INIT_COMP_CONTROLLED_DATA_PORT@plt>
lea    0xe0c(%rip),%rdi
mov    $0x3,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <WRITE_DEBUG_INFO_COMP@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"->\00"
define void @BrzFetch(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @arg2bool(i8* %11)
store i32 %12, i32* %5
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %6
%17 = load i8**, i8*** %4
%18 = getelementptr inbounds i8*, i8** %17, i64 3
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %7
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i64 4
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %8
%25 = call i32 @INIT_COMP(void (i32, i8**)* @BrzFetch)
%26 = load i32, i32* %6
%27 = call i32 @INIT_COMP_PASSIVE_PORT(void (i32, i8**)* @BrzFetch, i32 0, i32 %26)
%28 = load i32, i32* %7
%29 = call i32 @INIT_COMP_ACTIVE_PORT(void (i32, i8**)* @BrzFetch, i32 1, i32 %28)
%30 = load i32, i32* %8
%31 = call i32 @INIT_COMP_ACTIVE_PORT(void (i32, i8**)* @BrzFetch, i32 2, i32 %30)
%32 = load i32, i32* %8
%33 = call i32 @INIT_COMP_CONTROLLED_DATA_PORT(i32 2, i32 %32)
%34 = 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"->\00"
define void @BrzFetch(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @arg2bool(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 4
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = tail call i32 @INIT_COMP(void (i32, i8**)* @BrzFetch)
%16 = tail call i32 @INIT_COMP_PASSIVE_PORT(void (i32, i8**)* @BrzFetch, i32 0, i32 %8)
%17 = tail call i32 @INIT_COMP_ACTIVE_PORT(void (i32, i8**)* @BrzFetch, i32 1, i32 %11)
%18 = tail call i32 @INIT_COMP_ACTIVE_PORT(void (i32, i8**)* @BrzFetch, i32 2, i32 %14)
%19 = tail call i32 @INIT_COMP_CONTROLLED_DATA_PORT(i32 2, i32 %14)
%20 = 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
}