#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 zint_symbol {
  int dummy;
};

/* Variables and functions */
int ZBarcode_Buffer(struct zint_symbol *, int);
int ZBarcode_Encode_File(struct zint_symbol *, char const *);
int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol,
                                    char const *filename, int rotate_angle) {
  int error_number;
  int first_err;
  error_number = ZBarcode_Encode_File(symbol, filename);
  if (error_number >= 5) {
    return error_number;
  }
  first_err = error_number;
  error_number = ZBarcode_Buffer(symbol, rotate_angle);
  if (error_number == 0) {
    error_number = first_err;
  }
  return error_number;
}


x86 assembly (clang, -O0):
<ZBarcode_Encode_File_and_Buffer>:
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),%rsi
call   1030 <ZBarcode_Encode_File@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x5,-0x20(%rbp)
jl     1158 <ZBarcode_Encode_File_and_Buffer+0x38>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <ZBarcode_Encode_File_and_Buffer+0x63>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <ZBarcode_Buffer@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    117d <ZBarcode_Encode_File_and_Buffer+0x5d>
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZBarcode_Encode_File_and_Buffer>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbp
call   1030 <ZBarcode_Encode_File@plt>
mov    %eax,%ebx
cmp    $0x4,%eax
jg     1146 <ZBarcode_Encode_File_and_Buffer+0x26>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1040 <ZBarcode_Buffer@plt>
test   %eax,%eax
cmovne %eax,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.zint_symbol = type { i32 }
define i32 @ZBarcode_Encode_File_and_Buffer(%struct.zint_symbol* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.zint_symbol*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.zint_symbol* %0, %struct.zint_symbol** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%10 = load %struct.zint_symbol*, %struct.zint_symbol** %5
%11 = load i8*, i8** %6
%12 = call i32 @ZBarcode_Encode_File(%struct.zint_symbol* %10, i8* %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp sge i32 %13, 5
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i32, i32* %8
store i32 %16, i32* %4
br label %28
17: ; preds = %3
%18 = load i32, i32* %8
store i32 %18, i32* %9
%19 = load %struct.zint_symbol*, %struct.zint_symbol** %5
%20 = load i32, i32* %7
%21 = call i32 @ZBarcode_Buffer(%struct.zint_symbol* %19, i32 %20)
store i32 %21, i32* %8
%22 = load i32, i32* %8
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %17
%25 = load i32, i32* %9
store i32 %25, i32* %8
br label %26
26: ; preds = %24, %17
%27 = load i32, i32* %8
store i32 %27, i32* %4
br label %28
28: ; preds = %26, %15
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
%struct.zint_symbol = type { i32 }
define i32 @ZBarcode_Encode_File_and_Buffer(%struct.zint_symbol* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ZBarcode_Encode_File(%struct.zint_symbol* %0, i8* %1)
%5 = icmp sgt i32 %4, 4
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @ZBarcode_Buffer(%struct.zint_symbol* %0, i32 %2)
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 %4, i32 %7
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ %9, %6 ], [ %4, %3 ]
ret i32 %11
}