#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 */
struct bitis_ReturnToken {
  int dummy;
};

/* Variables and functions */
char *returnToken_getValue(struct bitis_ReturnToken *, char *);
int strtol(char *, int /*<<< orphan*/, int);
int getStreamCount(struct bitis_ReturnToken *ret_token) {
  char *streamCountStr = returnToken_getValue(ret_token, "STREAMCOUNT");
  if (streamCountStr == 0)
    return 0;
  return strtol(returnToken_getValue(ret_token, "STREAMCOUNT"), 0, 10);
}


x86 assembly (clang, -O0):
<getStreamCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <returnToken_getValue@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <getStreamCount+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1179 <getStreamCount+0x59>
mov    -0x10(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1030 <returnToken_getValue@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStreamCount>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <returnToken_getValue@plt>
test   %rax,%rax
je     1154 <getStreamCount+0x34>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <returnToken_getValue@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1040 <strtol@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.bitis_ReturnToken = type { i32 }
@.str = [12 x i8] c"STREAMCOUNT\00"
define i32 @getStreamCount(%struct.bitis_ReturnToken* %0) {
%2 = alloca i32
%3 = alloca %struct.bitis_ReturnToken*
%4 = alloca i8*
store %struct.bitis_ReturnToken* %0, %struct.bitis_ReturnToken** %3
%5 = load %struct.bitis_ReturnToken*, %struct.bitis_ReturnToken** %3
%6 = call i8* @returnToken_getValue(%struct.bitis_ReturnToken* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %14
10: ; preds = %1
%11 = load %struct.bitis_ReturnToken*, %struct.bitis_ReturnToken** %3
%12 = call i8* @returnToken_getValue(%struct.bitis_ReturnToken* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @strtol(i8* %12, i32 0, i32 10)
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.bitis_ReturnToken = type { i32 }
@.str = [12 x i8] c"STREAMCOUNT\00"
define i32 @getStreamCount(%struct.bitis_ReturnToken* %0) {
%2 = tail call i8* @returnToken_getValue(%struct.bitis_ReturnToken* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i8* @returnToken_getValue(%struct.bitis_ReturnToken* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strtol(i8* %5, i32 0, i32 10)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}