#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*/ GenPrintLabel(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.byte\t");
  else if (Size == 2)
    printf2("\t.half\t");
  else if (Size == 4)
    printf2("\t.word\t");
  GenPrintLabel(Label);
  if (ofs)
    printf2(" %+d", ofs);
  puts2("");
}


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   1060 <truncInt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    117a <GenAddrData+0x3a>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
jmp    11b9 <GenAddrData+0x79>
cmpl   $0x2,-0x4(%rbp)
jne    1197 <GenAddrData+0x57>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
jmp    11b4 <GenAddrData+0x74>
cmpl   $0x4,-0x4(%rbp)
jne    11af <GenAddrData+0x6f>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
jmp    11b4 <GenAddrData+0x74>
jmp    11b9 <GenAddrData+0x79>
mov    -0x10(%rbp),%rdi
call   1040 <GenPrintLabel@plt>
cmpl   $0x0,-0x14(%rbp)
je     11dd <GenAddrData+0x9d>
mov    -0x14(%rbp),%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf2@plt>
lea    0xe33(%rip),%rdi
call   1050 <puts2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenAddrData>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %edx,%edi
call   1060 <truncInt@plt>
mov    %eax,%ebx
cmp    $0x1,%ebp
je     116a <GenAddrData+0x2a>
cmp    $0x4,%ebp
je     1173 <GenAddrData+0x33>
cmp    $0x2,%ebp
jne    1181 <GenAddrData+0x41>
lea    0xea0(%rip),%rdi
jmp    117a <GenAddrData+0x3a>
lea    0xe8f(%rip),%rdi
jmp    117a <GenAddrData+0x3a>
lea    0xe96(%rip),%rdi
xor    %eax,%eax
call   1030 <printf2@plt>
mov    %r14,%rdi
call   1040 <GenPrintLabel@plt>
test   %ebx,%ebx
je     119d <GenAddrData+0x5d>
lea    0xe84(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf2@plt>
lea    0xe73(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <puts2@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\09.byte\09\00"
@.str.1 = [8 x i8] c"\09.half\09\00"
@.str.2 = [8 x i8] c"\09.word\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 ([8 x i8], [8 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 ([8 x i8], [8 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 ([8 x i8], [8 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))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\09.byte\09\00"
@.str.1 = [8 x i8] c"\09.half\09\00"
@.str.2 = [8 x i8] c"\09.word\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 ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 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))
ret void
}