#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 atoi(char *);
void parse_bfreq(int argc, char **argv, int *option, int *opt_all,
                 int *bad_arg) {
  if (argc > 1 || *option)
    *bad_arg = 1;
  *option = 1;
  if (argc == 1) {
    *opt_all = atoi(argv[0]);
  } else {
    *opt_all = 0;
  }
}


x86 assembly (clang, -O0):
<parse_bfreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     1142 <parse_bfreq+0x32>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     114c <parse_bfreq+0x3c>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x1,-0x4(%rbp)
jne    1179 <parse_bfreq+0x69>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1183 <parse_bfreq+0x73>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_bfreq>:
push   %rbx
mov    %rcx,%rbx
cmp    $0x1,%edi
jg     111e <parse_bfreq+0xe>
cmpl   $0x0,(%rdx)
je     1125 <parse_bfreq+0x15>
movl   $0x1,(%r8)
movl   $0x1,(%rdx)
xor    %eax,%eax
cmp    $0x1,%edi
jne    113a <parse_bfreq+0x2a>
mov    (%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @parse_bfreq(i32 %0, i8** %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 1
br i1 %12, label %17, label %13
13: ; preds = %5
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13, %5
%18 = load i32*, i32** %10
store i32 1, i32* %18
br label %19
19: ; preds = %17, %13
%20 = load i32*, i32** %8
store i32 1, i32* %20
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %29
23: ; preds = %19
%24 = load i8**, i8*** %7
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
%28 = load i32*, i32** %9
store i32 %27, i32* %28
br label %31
29: ; preds = %19
%30 = load i32*, i32** %9
store i32 0, i32* %30
br label %31
31: ; preds = %29, %23
ret void
}

LLVM IR (-O2):
define void @parse_bfreq(i32 %0, i8** nocapture %1, i32* nocapture %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = icmp sgt i32 %0, 1
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %5
store i32 1, i32* %4
br label %11
11: ; preds = %10, %7
store i32 1, i32* %2
%12 = icmp eq i32 %0, 1
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i8*, i8** %1
%15 = tail call i32 @atoi(i8* %14)
br label %16
16: ; preds = %11, %13
%17 = phi i32 [ %15, %13 ], [ 0, %11 ]
store i32 %17, i32* %3
ret void
}