#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 stCharsetProcessor {
  int dummy;
};
struct stCharset {
  int dummy;
};
struct stBitmap {
  int dummy;
};

/* Variables and functions */
int charsetProcessorRead(struct stCharsetProcessor *, struct stCharset *,
                         struct stBitmap *);
int pngReaderRead(char *, struct stBitmap *);
int /*<<< orphan*/ printf(char *, ...);
int readCharset(struct stCharsetProcessor *charsetProcessor,
                struct stCharset *charset, struct stBitmap *bitmap,
                char *pngFilename, int verbose) {
  int i = 0;
  if (verbose)
    printf("Reading input file %s...\n", pngFilename);
  if ((i = pngReaderRead(pngFilename, bitmap)))
    goto out;
  if (verbose)
    printf("Processing blocks...\n");
  if ((i = charsetProcessorRead(charsetProcessor, charset, bitmap)))
    goto out;
out:
  return i;
}


x86 assembly (clang, -O0):
<readCharset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     116f <readCharset+0x3f>
mov    -0x20(%rbp),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <pngReaderRead@plt>
mov    %eax,-0x28(%rbp)
cmp    $0x0,%eax
je     118d <readCharset+0x5d>
jmp    11cc <readCharset+0x9c>
cmpl   $0x0,-0x24(%rbp)
je     11a5 <readCharset+0x75>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <charsetProcessorRead@plt>
mov    %eax,-0x28(%rbp)
cmp    $0x0,%eax
je     11c7 <readCharset+0x97>
jmp    11cc <readCharset+0x9c>
jmp    11cc <readCharset+0x9c>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readCharset>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
test   %r8d,%r8d
je     1187 <readCharset+0x47>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <pngReaderRead@plt>
test   %eax,%eax
jne    1196 <readCharset+0x56>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
jmp    11a2 <readCharset+0x62>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <pngReaderRead@plt>
test   %eax,%eax
je     11a2 <readCharset+0x62>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1060 <charsetProcessorRead@plt>

LLVM IR (-O0):
%struct.stCharsetProcessor = type { i32 }
%struct.stCharset = type { i32 }
%struct.stBitmap = type { i32 }
@.str = [26 x i8] c"Reading input file %s...\0A\00"
@.str.1 = [22 x i8] c"Processing blocks...\0A\00"
define i32 @readCharset(%struct.stCharsetProcessor* %0, %struct.stCharset* %1, %struct.stBitmap* %2, i8* %3, i32 %4) {
%6 = alloca %struct.stCharsetProcessor*
%7 = alloca %struct.stCharset*
%8 = alloca %struct.stBitmap*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store %struct.stCharsetProcessor* %0, %struct.stCharsetProcessor** %6
store %struct.stCharset* %1, %struct.stCharset** %7
store %struct.stBitmap* %2, %struct.stBitmap** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
store i32 0, i32* %11
%12 = load i32, i32* %10
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %5
%15 = load i8*, i8** %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %5
%18 = load i8*, i8** %9
%19 = load %struct.stBitmap*, %struct.stBitmap** %8
%20 = call i32 @pngReaderRead(i8* %18, %struct.stBitmap* %19)
store i32 %20, i32* %11
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %17
br label %36
23: ; preds = %17
%24 = load i32, i32* %10
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
%29 = load %struct.stCharsetProcessor*, %struct.stCharsetProcessor** %6
%30 = load %struct.stCharset*, %struct.stCharset** %7
%31 = load %struct.stBitmap*, %struct.stBitmap** %8
%32 = call i32 @charsetProcessorRead(%struct.stCharsetProcessor* %29, %struct.stCharset* %30, %struct.stBitmap* %31)
store i32 %32, i32* %11
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %28
br label %36
35: ; preds = %28
br label %36
36: ; preds = %35, %34, %22
%37 = load i32, i32* %11
ret i32 %37
}

LLVM IR (-O2):
%struct.stCharsetProcessor = type { i32 }
%struct.stCharset = type { i32 }
%struct.stBitmap = type { i32 }
@.str = [26 x i8] c"Reading input file %s...\0A\00"
@str = [21 x i8] c"Processing blocks...\00"
define i32 @readCharset(%struct.stCharsetProcessor* %0, %struct.stCharset* %1, %struct.stBitmap* %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = tail call i32 @pngReaderRead(i8* %3, %struct.stBitmap* %2)
%9 = icmp eq i32 %8, 0
br i1 %9, label %16, label %18
10: ; preds = %5
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
%12 = tail call i32 @pngReaderRead(i8* %3, %struct.stBitmap* %2)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %7, %14
%17 = tail call i32 @charsetProcessorRead(%struct.stCharsetProcessor* %0, %struct.stCharset* %1, %struct.stBitmap* %2)
br label %18
18: ; preds = %10, %16, %7
%19 = phi i32 [ %8, %7 ], [ %17, %16 ], [ %12, %10 ]
ret i32 %19
}