#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("\t.db\t");
  else if (Size == 2)
    printf2("\t.dw\t");
  else if (Size == 4)
    printf2("\t.dd\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    11d9 <GenAddrData+0x79>
cmpl   $0x2,-0x4(%rbp)
jne    11b7 <GenAddrData+0x57>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
jmp    11d4 <GenAddrData+0x74>
cmpl   $0x4,-0x4(%rbp)
jne    11cf <GenAddrData+0x6f>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
jmp    11d4 <GenAddrData+0x74>
jmp    11d9 <GenAddrData+0x79>
mov    -0x10(%rbp),%rdi
call   1060 <GenPrintLabel@plt>
cmpl   $0x0,-0x14(%rbp)
je     11fd <GenAddrData+0x9d>
mov    -0x14(%rbp),%esi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
lea    0xe01(%rip),%rdi
call   1070 <puts2@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%eax
jne    122c <GenAddrData+0xcc>
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     118a <GenAddrData+0x2a>
cmp    $0x4,%ebx
je     1193 <GenAddrData+0x33>
cmp    $0x2,%ebx
jne    11a1 <GenAddrData+0x41>
lea    0xe7e(%rip),%rdi
jmp    119a <GenAddrData+0x3a>
lea    0xe6f(%rip),%rdi
jmp    119a <GenAddrData+0x3a>
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1030 <printf2@plt>
mov    %r14,%rdi
call   1060 <GenPrintLabel@plt>
test   %ebp,%ebp
je     11bd <GenAddrData+0x5d>
lea    0xe5e(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf2@plt>
lea    0xe41(%rip),%rdi
call   1070 <puts2@plt>
movsbl (%r14),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
je     11db <GenAddrData+0x7b>
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 = [6 x i8] c"\09.db\09\00"
@.str.1 = [6 x i8] c"\09.dw\09\00"
@.str.2 = [6 x i8] c"\09.dd\09\00"
@.str.3 = [5 x i8] c" %+d\00"
@.str.4 = [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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %25
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 ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %24
18: ; preds = %13
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (i8*, ...) @printf2(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
br label %24
24: ; preds = %23, %16
br label %25
25: ; preds = %24, %11
%26 = load i8*, i8** %5
%27 = call i32 @GenPrintLabel(i8* %26)
%28 = load i32, i32* %6
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i32, i32* %6
%32 = call i32 (i8*, ...) @printf2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %30, %25
%34 = call i32 @puts2(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%35 = load i8*, i8** %5
%36 = load i8, i8* %35
%37 = call i32 @isdigit(i8 signext %36)
%38 = icmp ne i32 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %33
%40 = load i8*, i8** %5
%41 = call i32 @GenAddGlobal(i8* %40, i32 2)
br label %42
42: ; preds = %39, %33
ret void
}

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