#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*/ seh_emit_long(char const *);
void seh_write_text_eh_data(const char *hnd, const char *hnd_data) {
  if (!hnd || *hnd == 0)
    return;
  if (hnd[0] == '@')
    seh_emit_long("0");
  else
    seh_emit_long(hnd);
  if (!hnd_data || hnd_data[0] == '@')
    seh_emit_long("0");
  else
    seh_emit_long(hnd_data);
}


x86 assembly (clang, -O0):
<seh_write_text_eh_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <seh_write_text_eh_data+0x2b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1140 <seh_write_text_eh_data+0x30>
jmp    119f <seh_write_text_eh_data+0x8f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    1161 <seh_write_text_eh_data+0x51>
lea    0xea9(%rip),%rdi
call   1030 <seh_emit_long@plt>
jmp    116a <seh_write_text_eh_data+0x5a>
mov    -0x8(%rbp),%rdi
call   1030 <seh_emit_long@plt>
cmpq   $0x0,-0x10(%rbp)
je     1185 <seh_write_text_eh_data+0x75>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    1196 <seh_write_text_eh_data+0x86>
lea    0xe74(%rip),%rdi
call   1030 <seh_emit_long@plt>
jmp    119f <seh_write_text_eh_data+0x8f>
mov    -0x10(%rbp),%rdi
call   1030 <seh_emit_long@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seh_write_text_eh_data>:
push   %rbx
test   %rdi,%rdi
je     1146 <seh_write_text_eh_data+0x36>
mov    (%rdi),%al
test   %al,%al
je     1146 <seh_write_text_eh_data+0x36>
mov    %rsi,%rbx
cmp    $0x40,%al
jne    112a <seh_write_text_eh_data+0x1a>
lea    0xed6(%rip),%rdi
call   1030 <seh_emit_long@plt>
test   %rbx,%rbx
je     1139 <seh_write_text_eh_data+0x29>
cmpb   $0x40,(%rbx)
jne    1148 <seh_write_text_eh_data+0x38>
lea    0xec0(%rip),%rdi
pop    %rbx
jmp    1030 <seh_emit_long@plt>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <seh_emit_long@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define void @seh_write_text_eh_data(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7, %2
br label %38
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 64
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 @seh_emit_long(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %24
21: ; preds = %13
%22 = load i8*, i8** %3
%23 = call i32 @seh_emit_long(i8* %22)
br label %24
24: ; preds = %21, %19
%25 = load i8*, i8** %4
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 64
br i1 %32, label %33, label %35
33: ; preds = %27, %24
%34 = call i32 @seh_emit_long(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %38
35: ; preds = %27
%36 = load i8*, i8** %4
%37 = call i32 @seh_emit_long(i8* %36)
br label %38
38: ; preds = %12, %35, %33
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define void @seh_write_text_eh_data(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %19, label %4
4: ; preds = %2
%5 = load i8, i8* %0
switch i8 %5, label %8 [
i8 0, label %19
i8 64, label %6
]
6: ; preds = %4
%7 = tail call i32 @seh_emit_long(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %4
%9 = tail call i32 @seh_emit_long(i8* %0)
br label %10
10: ; preds = %8, %6
%11 = icmp eq i8* %1, null
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = load i8, i8* %1
%14 = icmp eq i8 %13, 64
br i1 %14, label %15, label %17
15: ; preds = %12, %10
%16 = tail call i32 @seh_emit_long(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %19
17: ; preds = %12
%18 = tail call i32 @seh_emit_long(i8* %1)
br label %19
19: ; preds = %4, %2, %17, %15
ret void
}