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

/* Variables and functions */
char *LANG(char *);
int /*<<< orphan*/ exitPGP(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void err(int c, char *msg) {
  if (c == 4) {
    fprintf(stderr, LANG("\nOut of memory\n"));
    exitPGP(7);
  } else {
    fprintf(stderr, LANG("\nCompression/decompression error\n"));
    exitPGP(23);
  }
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x4(%rbp)
jne    117b <err+0x4b>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    0xea4(%rip),%rdi
call   1050 <LANG@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rsi
call   1030 <fprintf@plt>
mov    $0x7,%edi
call   1040 <exitPGP@plt>
jmp    11a8 <err+0x78>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
lea    0xe82(%rip),%rdi
call   1050 <LANG@plt>
mov    -0x18(%rbp),%edi
mov    %rax,%rsi
call   1030 <fprintf@plt>
mov    $0x17,%edi
call   1040 <exitPGP@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cmp    $0x4,%edi
setne  %bl
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebp
lea    0xeb5(%rip),%rax
lea    0xebe(%rip),%rdi
cmove  %rax,%rdi
shl    $0x4,%ebx
or     $0x7,%ebx
call   1050 <LANG@plt>
mov    %ebp,%edi
mov    %rax,%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <exitPGP@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"\0AOut of memory\0A\00"
@.str.1 = [34 x i8] c"\0ACompression/decompression error\0A\00"
define void @err(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i8* @LANG(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @fprintf(i32 %8, i8* %9)
%11 = call i32 @exitPGP(i32 7)
br label %17
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i8* @LANG(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @fprintf(i32 %13, i8* %14)
%16 = call i32 @exitPGP(i32 23)
br label %17
17: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"\0AOut of memory\0A\00"
@.str.1 = [34 x i8] c"\0ACompression/decompression error\0A\00"
define void @err(i32 %0, i8* nocapture readnone %1) {
%3 = icmp eq i32 %0, 4
%4 = load i32, i32* @stderr
%5 = select i1 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0)
%6 = select i1 %3, i32 7, i32 23
%7 = tail call i8* @LANG(i8* %5)
%8 = tail call i32 @fprintf(i32 %4, i8* %7)
%9 = tail call i32 @exitPGP(i32 %6)
ret void
}