#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*/ GenAddGlobal(char *, int);
int /*<<< orphan*/ GenPrintLabel(char *);
int /*<<< orphan*/ isdigit(char);
int /*<<< orphan*/ printf2(char *, ...);
int /*<<< orphan*/ puts2(char *);
int truncInt(int);
void GenAddrData(int Size, char *Label, int ofs) {
  ofs = truncInt(ofs);
  if (Size == 1)
    printf2("\tdb\t");
  else if (Size == 2)
    printf2("\tdw\t");
  GenPrintLabel(Label);
  if (ofs)
    printf2(" %+d", ofs);
  puts2("");
  if (!isdigit(*Label))
    GenAddGlobal(Label, 2);
}


x86 assembly (clang, -O0):
<GenAddrData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1080 <truncInt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    119a <GenAddrData+0x3a>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
jmp    11b7 <GenAddrData+0x57>
cmpl   $0x2,-0x4(%rbp)
jne    11b2 <GenAddrData+0x52>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
jmp    11b7 <GenAddrData+0x57>
mov    -0x10(%rbp),%rdi
call   1060 <GenPrintLabel@plt>
cmpl   $0x0,-0x14(%rbp)
je     11db <GenAddrData+0x7b>
mov    -0x14(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
lea    0xe22(%rip),%rdi
call   1070 <puts2@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%eax
jne    120a <GenAddrData+0xaa>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <GenAddGlobal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenAddrData>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
mov    %edx,%edi
call   1080 <truncInt@plt>
mov    %eax,%ebp
cmp    $0x1,%ebx
je     1185 <GenAddrData+0x25>
cmp    $0x2,%ebx
jne    1193 <GenAddrData+0x33>
lea    0xe82(%rip),%rdi
jmp    118c <GenAddrData+0x2c>
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1030 <printf2@plt>
mov    %r14,%rdi
call   1060 <GenPrintLabel@plt>
test   %ebp,%ebp
je     11af <GenAddrData+0x4f>
lea    0xe64(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf2@plt>
lea    0xe4e(%rip),%rdi
call   1070 <puts2@plt>
movsbl (%r14),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
je     11cd <GenAddrData+0x6d>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14,%rdi
mov    $0x2,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <GenAddGlobal@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\09db\09\00"
@.str.1 = [5 x i8] c"\09dw\09\00"
@.str.2 = [5 x i8] c" %+d\00"
@.str.3 = [1 x i8] zeroinitializer
define void @GenAddrData(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @truncInt(i32 %7)
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 (i8*, ...) @printf2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %19
13: ; preds = %3
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (i8*, ...) @printf2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
br label %19
19: ; preds = %18, %11
%20 = load i8*, i8** %5
%21 = call i32 @GenPrintLabel(i8* %20)
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = load i32, i32* %6
%26 = call i32 (i8*, ...) @printf2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %24, %19
%28 = call i32 @puts2(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%29 = load i8*, i8** %5
%30 = load i8, i8* %29
%31 = call i32 @isdigit(i8 signext %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %27
%34 = load i8*, i8** %5
%35 = call i32 @GenAddGlobal(i8* %34, i32 2)
br label %36
36: ; preds = %33, %27
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\09db\09\00"
@.str.1 = [5 x i8] c"\09dw\09\00"
@.str.2 = [5 x i8] c" %+d\00"
@.str.3 = [1 x i8] zeroinitializer
define void @GenAddrData(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @truncInt(i32 %2)
switch i32 %0, label %9 [
i32 1, label %6
i32 2, label %5
]
5: ; preds = %3
br label %6
6: ; preds = %3, %5
%7 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %3 ]
%8 = tail call i32 (i8*, ...) @printf2(i8* %7)
br label %9
9: ; preds = %6, %3
%10 = tail call i32 @GenPrintLabel(i8* %1)
%11 = icmp eq i32 %4, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 (i8*, ...) @printf2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %4)
br label %14
14: ; preds = %12, %9
%15 = tail call i32 @puts2(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%16 = load i8, i8* %1
%17 = tail call i32 @isdigit(i8 signext %16)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = tail call i32 @GenAddGlobal(i8* %1, i32 2)
br label %21
21: ; preds = %19, %14
ret void
}