#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 */
typedef unsigned long op_code;

/* Variables and functions */
char *_regname(unsigned long);
int /*<<< orphan*/ decode_indirect_address(unsigned long, unsigned long, int);
int /*<<< orphan*/ myprint(char *, char *, ...);
int /*<<< orphan*/ new_line();
int /*<<< orphan*/ pad_to(int);
void decode_triadic_parallel_addressing(long int op_code, char *first_op,
                                        char *second_op) {
  unsigned long src1;
  unsigned long src2;
  unsigned long src3;
  unsigned long dst1;
  unsigned long dst2;
  src2 = (op_code)&0xff;
  dst2 = (op_code >> 8) & 0xff;
  src3 = (op_code >> 16) & 0x07;
  src1 = (op_code >> 19) & 0x07;
  dst1 = (op_code >> 22) & 0x07;
  myprint("%s ", first_op);
  pad_to(10);
  decode_indirect_address(src2 >> 3, src2 & 7, 1);
  myprint(", %s, %s", _regname(src1), _regname(dst1));
  new_line();
  pad_to(39);
  myprint("|| %s", second_op);
  pad_to(39 + 10);
  myprint("%s, ", _regname(src3));
  decode_indirect_address(dst2 >> 3, dst2 & 7, 1);
  return;
}


x86 assembly (clang, -O0):
<decode_triadic_parallel_addressing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
and    $0x7,%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x13,%rax
and    $0x7,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x16,%rax
and    $0x7,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1040 <myprint@plt>
mov    $0xa,%edi
call   1060 <pad_to@plt>
mov    -0x28(%rbp),%rdi
shr    $0x3,%rdi
mov    -0x28(%rbp),%rsi
and    $0x7,%rsi
mov    $0x1,%edx
call   1070 <decode_indirect_address@plt>
mov    -0x20(%rbp),%rdi
call   1050 <_regname@plt>
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rdi
call   1050 <_regname@plt>
mov    -0x48(%rbp),%rsi
mov    %rax,%rdx
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1040 <myprint@plt>
mov    $0x0,%al
call   1030 <new_line@plt>
mov    $0x27,%edi
call   1060 <pad_to@plt>
mov    -0x18(%rbp),%rsi
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <myprint@plt>
mov    $0x31,%edi
call   1060 <pad_to@plt>
mov    -0x30(%rbp),%rdi
call   1050 <_regname@plt>
mov    %rax,%rsi
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <myprint@plt>
mov    -0x40(%rbp),%rdi
shr    $0x3,%rdi
mov    -0x40(%rbp),%rsi
and    $0x7,%rsi
mov    $0x1,%edx
call   1070 <decode_indirect_address@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_triadic_parallel_addressing>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rdi,%r13
mov    %r13d,%r14d
shr    $0x8,%r14d
and    $0x7,%r14d
mov    %r13d,%r15d
shr    $0x10,%r15d
and    $0x7,%r15d
mov    %r13d,%ebx
shr    $0x13,%ebx
and    $0x7,%ebx
mov    %r13d,%ebp
shr    $0x16,%ebp
and    $0x7,%ebp
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1040 <myprint@plt>
mov    $0xa,%edi
call   1060 <pad_to@plt>
mov    %r13d,%edi
shr    $0x3,%edi
and    $0x1f,%edi
mov    %r13d,%esi
and    $0x7,%esi
mov    $0x1,%edx
call   1070 <decode_indirect_address@plt>
mov    %rbx,%rdi
call   1050 <_regname@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1050 <_regname@plt>
lea    0xe30(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <myprint@plt>
xor    %eax,%eax
call   1030 <new_line@plt>
mov    $0x27,%edi
call   1060 <pad_to@plt>
lea    0xe14(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <myprint@plt>
mov    $0x31,%edi
call   1060 <pad_to@plt>
mov    %r15,%rdi
call   1050 <_regname@plt>
lea    0xdf7(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <myprint@plt>
shr    $0xb,%r13d
and    $0x1f,%r13d
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <decode_indirect_address@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [9 x i8] c", %s, %s\00"
@.str.2 = [6 x i8] c"|| %s\00"
@.str.3 = [5 x i8] c"%s, \00"
define void @decode_triadic_parallel_addressing(i64 %0, i8* %1, i8* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i64, i64* %4
%13 = and i64 %12, 255
store i64 %13, i64* %8
%14 = load i64, i64* %4
%15 = ashr i64 %14, 8
%16 = and i64 %15, 255
store i64 %16, i64* %11
%17 = load i64, i64* %4
%18 = ashr i64 %17, 16
%19 = and i64 %18, 7
store i64 %19, i64* %9
%20 = load i64, i64* %4
%21 = ashr i64 %20, 19
%22 = and i64 %21, 7
store i64 %22, i64* %7
%23 = load i64, i64* %4
%24 = ashr i64 %23, 22
%25 = and i64 %24, 7
store i64 %25, i64* %10
%26 = load i8*, i8** %5
%27 = call i32 (i8*, i8*, ...) @myprint(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = call i32 @pad_to(i32 10)
%29 = load i64, i64* %8
%30 = lshr i64 %29, 3
%31 = load i64, i64* %8
%32 = and i64 %31, 7
%33 = call i32 @decode_indirect_address(i64 %30, i64 %32, i32 1)
%34 = load i64, i64* %7
%35 = call i8* @_regname(i64 %34)
%36 = load i64, i64* %10
%37 = call i8* @_regname(i64 %36)
%38 = call i32 (i8*, i8*, ...) @myprint(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %35, i8* %37)
%39 = call i32 (...) @new_line()
%40 = call i32 @pad_to(i32 39)
%41 = load i8*, i8** %6
%42 = call i32 (i8*, i8*, ...) @myprint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %41)
%43 = call i32 @pad_to(i32 49)
%44 = load i64, i64* %9
%45 = call i8* @_regname(i64 %44)
%46 = call i32 (i8*, i8*, ...) @myprint(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %45)
%47 = load i64, i64* %11
%48 = lshr i64 %47, 3
%49 = load i64, i64* %11
%50 = and i64 %49, 7
%51 = call i32 @decode_indirect_address(i64 %48, i64 %50, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.1 = [9 x i8] c", %s, %s\00"
@.str.2 = [6 x i8] c"|| %s\00"
@.str.3 = [5 x i8] c"%s, \00"
define void @decode_triadic_parallel_addressing(i64 %0, i8* %1, i8* %2) {
%4 = lshr i64 %0, 8
%5 = lshr i64 %0, 16
%6 = and i64 %5, 7
%7 = lshr i64 %0, 19
%8 = and i64 %7, 7
%9 = lshr i64 %0, 22
%10 = and i64 %9, 7
%11 = tail call i32 (i8*, i8*, ...) @myprint(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%12 = tail call i32 @pad_to(i32 10)
%13 = lshr i64 %0, 3
%14 = and i64 %13, 31
%15 = and i64 %0, 7
%16 = tail call i32 @decode_indirect_address(i64 %14, i64 %15, i32 1)
%17 = tail call i8* @_regname(i64 %8)
%18 = tail call i8* @_regname(i64 %10)
%19 = tail call i32 (i8*, i8*, ...) @myprint(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %18)
%20 = tail call i32 (...) @new_line()
%21 = tail call i32 @pad_to(i32 39)
%22 = tail call i32 (i8*, i8*, ...) @myprint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%23 = tail call i32 @pad_to(i32 49)
%24 = tail call i8* @_regname(i64 %6)
%25 = tail call i32 (i8*, i8*, ...) @myprint(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%26 = lshr i64 %0, 11
%27 = and i64 %26, 31
%28 = and i64 %4, 7
%29 = tail call i32 @decode_indirect_address(i64 %27, i64 %28, i32 1)
ret void
}