#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*/ dissect_packed_decimal_sign(int);
int extract_packed_decimal_sign(unsigned long, unsigned long);
int /*<<< orphan*/ printf(char *, ...);
void dissect_packed_decimal(unsigned long dword1, unsigned long dword0) {
  int i;
  int local_sign;
  int nibble;
  local_sign = extract_packed_decimal_sign(dword1, dword0);
  printf("packed_decimal: [");
  for (i = 60; i >= 0; i -= 4) {
    nibble = (dword1 >> (i)) & 0xf;
    printf(" %x", nibble);
  }
  for (i = 60; i >= 0; i -= 4) {
    nibble = (dword0 >> (i)) & 0xf;
    printf(" %x", nibble);
  }
  printf(" ");
  dissect_packed_decimal_sign(local_sign);
  printf(" ] ");
}


x86 assembly (clang, -O0):
<dissect_packed_decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <extract_packed_decimal_sign@plt>
mov    %eax,-0x18(%rbp)
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3c,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     119f <dissect_packed_decimal+0x6f>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shr    %cl,%rax
and    $0xf,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    1165 <dissect_packed_decimal+0x35>
movl   $0x3c,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     11e0 <dissect_packed_decimal+0xb0>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shr    %cl,%rax
and    $0xf,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    11a6 <dissect_packed_decimal+0x76>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%edi
call   1040 <dissect_packed_decimal_sign@plt>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dissect_packed_decimal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1060 <extract_packed_decimal_sign@plt>
mov    %eax,%r14d
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rsi
shr    $0x3c,%rsi
lea    0xea1(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rsi
shr    $0x38,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rsi
shr    $0x34,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rsi
shr    $0x30,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rsi
shr    $0x2c,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rsi
shr    $0x28,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rsi
shr    $0x24,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rsi
shr    $0x20,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%esi
shr    $0x1c,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%esi
shr    $0x18,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%esi
shr    $0x14,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%esi
shr    $0x10,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%esi
shr    $0xc,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%esi
shr    $0x8,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%esi
shr    $0x4,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
and    $0xf,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rsi
shr    $0x3c,%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rsi
shr    $0x38,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rsi
shr    $0x34,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rsi
shr    $0x30,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rsi
shr    $0x2c,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rsi
shr    $0x28,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rsi
shr    $0x24,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rsi
shr    $0x20,%rsi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    $0x1c,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    $0x18,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    $0x14,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    $0x10,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    $0xc,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    $0x8,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    $0x4,%esi
and    $0xf,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
and    $0xf,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r14d,%edi
call   1050 <dissect_packed_decimal_sign@plt>
lea    0xc45(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"packed_decimal: [\00"
@.str.1 = [4 x i8] c" %x\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [4 x i8] c" ] \00"
define void @dissect_packed_decimal(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @extract_packed_decimal_sign(i64 %8, i64 %9)
store i32 %10, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 60, i32* %5
br label %12
12: ; preds = %24, %2
%13 = load i32, i32* %5
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i64, i64* %3
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = lshr i64 %16, %18
%20 = and i64 %19, 15
%21 = trunc i64 %20 to i32
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %15
%25 = load i32, i32* %5
%26 = sub nsw i32 %25, 4
store i32 %26, i32* %5
br label %12
27: ; preds = %12
store i32 60, i32* %5
br label %28
28: ; preds = %40, %27
%29 = load i32, i32* %5
%30 = icmp sge i32 %29, 0
br i1 %30, label %31, label %43
31: ; preds = %28
%32 = load i64, i64* %4
%33 = load i32, i32* %5
%34 = zext i32 %33 to i64
%35 = lshr i64 %32, %34
%36 = and i64 %35, 15
%37 = trunc i64 %36 to i32
store i32 %37, i32* %7
%38 = load i32, i32* %7
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %31
%41 = load i32, i32* %5
%42 = sub nsw i32 %41, 4
store i32 %42, i32* %5
br label %28
43: ; preds = %28
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%45 = load i32, i32* %6
%46 = call i32 @dissect_packed_decimal_sign(i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"packed_decimal: [\00"
@.str.1 = [4 x i8] c" %x\00"
@.str.3 = [4 x i8] c" ] \00"
define void @dissect_packed_decimal(i64 %0, i64 %1) {
%3 = tail call i32 @extract_packed_decimal_sign(i64 %0, i64 %1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = lshr i64 %0, 60
%6 = trunc i64 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = lshr i64 %0, 56
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 15
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = lshr i64 %0, 52
%13 = trunc i64 %12 to i32
%14 = and i32 %13, 15
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = lshr i64 %0, 48
%17 = trunc i64 %16 to i32
%18 = and i32 %17, 15
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = lshr i64 %0, 44
%21 = trunc i64 %20 to i32
%22 = and i32 %21, 15
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = lshr i64 %0, 40
%25 = trunc i64 %24 to i32
%26 = and i32 %25, 15
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = lshr i64 %0, 36
%29 = trunc i64 %28 to i32
%30 = and i32 %29, 15
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = lshr i64 %0, 32
%33 = trunc i64 %32 to i32
%34 = and i32 %33, 15
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%36 = trunc i64 %0 to i32
%37 = lshr i32 %36, 28
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = trunc i64 %0 to i32
%40 = lshr i32 %39, 24
%41 = and i32 %40, 15
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = trunc i64 %0 to i32
%44 = lshr i32 %43, 20
%45 = and i32 %44, 15
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = trunc i64 %0 to i32
%48 = lshr i32 %47, 16
%49 = and i32 %48, 15
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = trunc i64 %0 to i32
%52 = lshr i32 %51, 12
%53 = and i32 %52, 15
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %53)
%55 = trunc i64 %0 to i32
%56 = lshr i32 %55, 8
%57 = and i32 %56, 15
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = trunc i64 %0 to i32
%60 = lshr i32 %59, 4
%61 = and i32 %60, 15
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %61)
%63 = trunc i64 %0 to i32
%64 = and i32 %63, 15
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %64)
%66 = lshr i64 %1, 60
%67 = trunc i64 %66 to i32
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %67)
%69 = lshr i64 %1, 56
%70 = trunc i64 %69 to i32
%71 = and i32 %70, 15
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %71)
%73 = lshr i64 %1, 52
%74 = trunc i64 %73 to i32
%75 = and i32 %74, 15
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %75)
%77 = lshr i64 %1, 48
%78 = trunc i64 %77 to i32
%79 = and i32 %78, 15
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %79)
%81 = lshr i64 %1, 44
%82 = trunc i64 %81 to i32
%83 = and i32 %82, 15
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %83)
%85 = lshr i64 %1, 40
%86 = trunc i64 %85 to i32
%87 = and i32 %86, 15
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %87)
%89 = lshr i64 %1, 36
%90 = trunc i64 %89 to i32
%91 = and i32 %90, 15
%92 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %91)
%93 = lshr i64 %1, 32
%94 = trunc i64 %93 to i32
%95 = and i32 %94, 15
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %95)
%97 = trunc i64 %1 to i32
%98 = lshr i32 %97, 28
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %98)
%100 = trunc i64 %1 to i32
%101 = lshr i32 %100, 24
%102 = and i32 %101, 15
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %102)
%104 = trunc i64 %1 to i32
%105 = lshr i32 %104, 20
%106 = and i32 %105, 15
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %106)
%108 = trunc i64 %1 to i32
%109 = lshr i32 %108, 16
%110 = and i32 %109, 15
%111 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %110)
%112 = trunc i64 %1 to i32
%113 = lshr i32 %112, 12
%114 = and i32 %113, 15
%115 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %114)
%116 = trunc i64 %1 to i32
%117 = lshr i32 %116, 8
%118 = and i32 %117, 15
%119 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %118)
%120 = trunc i64 %1 to i32
%121 = lshr i32 %120, 4
%122 = and i32 %121, 15
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %122)
%124 = trunc i64 %1 to i32
%125 = and i32 %124, 15
%126 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %125)
%127 = tail call i32 @putchar(i32 32)
%128 = tail call i32 @dissect_packed_decimal_sign(i32 %3)
%129 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}