#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 */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ usage(int);
void seetex_error(char *errmsg, int error_code) {
  (void)printf("\nseetex:error:\n");
  (void)printf("seetex:error:%s \n", errmsg);
  (void)printf("seetex:error:\n\n");
  if (error_code < 0)
    (void)usage(error_code);
  else
    (void)exit((int)error_code);
}


x86 assembly (clang, -O0):
<seetex_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jge    1184 <seetex_error+0x54>
mov    -0xc(%rbp),%edi
call   1040 <usage@plt>
jmp    118c <seetex_error+0x5c>
mov    -0xc(%rbp),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seetex_error>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
test   %ebx,%ebx
jns    1184 <seetex_error+0x44>
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <usage@plt>
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\0Aseetex:error:\0A\00"
@.str.1 = [18 x i8] c"seetex:error:%s \0A\00"
@.str.2 = [16 x i8] c"seetex:error:\0A\0A\00"
define void @seetex_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @usage(i32 %12)
br label %17
14: ; preds = %2
%15 = load i32, i32* %4
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"seetex:error:%s \0A\00"
@str = [15 x i8] c"\0Aseetex:error:\00"
@str.3 = [15 x i8] c"seetex:error:\0A\00"
define void @seetex_error(i8* %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0))
%6 = icmp slt i32 %1, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @usage(i32 %1)
ret void
9: ; preds = %2
%10 = tail call i32 @exit(i32 %1)
unreachable
}