#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 */
typedef int /*<<< orphan*/ sOutData;

/* Variables and functions */
int iHxEmvGetData(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *, int *,
                  unsigned char *);
int /*<<< orphan*/ vOneTwo0(unsigned char *, int, char *);
int ICC_GetIcPbocVersion(char *pszPbocVer) {
  unsigned char sOutData[10];
  int iOutDataLen, retCode;
  iOutDataLen = sizeof(sOutData);
  retCode = iHxEmvGetData("\x9f\x08", NULL, NULL, &iOutDataLen, sOutData);
  if (retCode)
    return retCode;
  vOneTwo0(sOutData, 2, pszPbocVer);
  return 0;
}


x86 assembly (clang, -O0):
<ICC_GetIcPbocVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0xa,-0x20(%rbp)
lea    -0x1a(%rbp),%r8
lea    0xec2(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
lea    -0x20(%rbp),%rcx
mov    %rdx,%rsi
call   1030 <iHxEmvGetData@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1166 <ICC_GetIcPbocVersion+0x46>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <ICC_GetIcPbocVersion+0x5f>
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2,%esi
call   1040 <vOneTwo0@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ICC_GetIcPbocVersion>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movl   $0xa,0x8(%rsp)
lea    0xec8(%rip),%rdi
lea    0x8(%rsp),%rcx
lea    0xe(%rsp),%r8
xor    %esi,%esi
xor    %edx,%edx
call   1030 <iHxEmvGetData@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1163 <ICC_GetIcPbocVersion+0x43>
lea    0xe(%rsp),%rdi
mov    $0x2,%esi
mov    %rbx,%rdx
call   1040 <vOneTwo0@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\9F\08\00"
define i32 @ICC_GetIcPbocVersion(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [10 x i8]
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 10, i32* %5
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%8 = call i32 @iHxEmvGetData(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32* %5, i8* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %6
store i32 %12, i32* %2
br label %17
13: ; preds = %1
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%15 = load i8*, i8** %3
%16 = call i32 @vOneTwo0(i8* %14, i32 2, i8* %15)
store i32 0, i32* %2
br label %17
17: ; preds = %13, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"\9F\08\00"
define i32 @ICC_GetIcPbocVersion(i8* %0) {
%2 = alloca [10 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%6 = call i32 @iHxEmvGetData(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32* %3, i8* %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @vOneTwo0(i8* %4, i32 2, i8* %0)
br label %10
10: ; preds = %1, %8
ret i32 %6
}