#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
unsigned int sis32toh(unsigned int);
scalar_t__ sisRead(int /*<<< orphan*/ *, unsigned int *, int, char *, int);
int condNumber(FILE *fp, char *err, int errlen) {
  unsigned int value, unused;
  if (sisRead(fp, &value, 4, err, errlen))
    return 1;
  value = sis32toh(value);
  if (sisRead(fp, &unused, 4, err, errlen))
    return 1;
  printf("0x%04x", value);
  return 0;
}


x86 assembly (clang, -O0):
<condNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    -0x20(%rbp),%rsi
mov    $0x4,%edx
call   1050 <sisRead@plt>
cmp    $0x0,%rax
je     1173 <condNumber+0x43>
movl   $0x1,-0x4(%rbp)
jmp    11c4 <condNumber+0x94>
mov    -0x20(%rbp),%edi
call   1030 <sis32toh@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
call   1050 <sisRead@plt>
cmp    $0x0,%rax
je     11ae <condNumber+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    11c4 <condNumber+0x94>
mov    -0x20(%rbp),%esi
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<condNumber>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsp,%rsi
mov    $0x4,%edx
mov    %rbx,%rcx
mov    %r15d,%r8d
call   1050 <sisRead@plt>
mov    $0x1,%r14d
test   %rax,%rax
jne    1198 <condNumber+0x68>
mov    (%rsp),%edi
call   1030 <sis32toh@plt>
mov    %eax,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rbp,%rdi
mov    $0x4,%edx
mov    %rbx,%rcx
mov    %r15d,%r8d
call   1050 <sisRead@plt>
test   %rax,%rax
jne    1198 <condNumber+0x68>
mov    (%rsp),%esi
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"0x%04x\00"
define i32 @condNumber(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%10 = load i32*, i32** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call i64 @sisRead(i32* %10, i32* %8, i32 4, i8* %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 1, i32* %4
br label %28
16: ; preds = %3
%17 = load i32, i32* %8
%18 = call i32 @sis32toh(i32 %17)
store i32 %18, i32* %8
%19 = load i32*, i32** %5
%20 = load i8*, i8** %6
%21 = load i32, i32* %7
%22 = call i64 @sisRead(i32* %19, i32* %9, i32 4, i8* %20, i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %16
store i32 1, i32* %4
br label %28
25: ; preds = %16
%26 = load i32, i32* %8
%27 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %26)
store i32 0, i32* %4
br label %28
28: ; preds = %25, %24, %15
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
@.str = [7 x i8] c"0x%04x\00"
define i32 @condNumber(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i64 @sisRead(i32* %0, i32* %4, i32 4, i8* %1, i32 %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i32, i32* %4
%12 = call i32 @sis32toh(i32 %11)
store i32 %12, i32* %4
%13 = call i64 @sisRead(i32* %0, i32* %5, i32 4, i8* %1, i32 %2)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10, %3, %15
%19 = phi i32 [ 0, %15 ], [ 1, %3 ], [ 1, %10 ]
ret i32 %19
}