#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 int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ r4k_disassemble_split_quick(int /*<<< orphan*/,
                                               int /*<<< orphan*/, char **,
                                               char **);
int /*<<< orphan*/ strcpy(char *, char *);
void r4300_decode_op(uint32_t instr, char *opcode, char *arguments,
                     uint32_t counter) {
  char *_op, *_args;
  _op = NULL;
  _args = NULL;
  r4k_disassemble_split_quick(instr, counter, &_op, &_args);
  strcpy(opcode, _op);
  strcpy(arguments, _args);
  free(_op);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%esi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1050 <r4k_disassemble_split_quick@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rax
mov    %ecx,%esi
mov    %rax,%rcx
call   1050 <r4k_disassemble_split_quick@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1040 <strcpy@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @r4300_decode_op(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
store i8* null, i8** %9
store i8* null, i8** %10
%11 = load i32, i32* %5
%12 = load i32, i32* %8
%13 = call i32 @r4k_disassemble_split_quick(i32 %11, i32 %12, i8** %9, i8** %10)
%14 = load i8*, i8** %6
%15 = load i8*, i8** %9
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %7
%18 = load i8*, i8** %10
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %9
%21 = call i32 @free(i8* %20)
ret void
}

LLVM IR (-O2):
define void @r4300_decode_op(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = bitcast i8** %5 to i8*
%8 = bitcast i8** %6 to i8*
store i8* null, i8** %5
store i8* null, i8** %6
%9 = call i32 @r4k_disassemble_split_quick(i32 %0, i32 %3, i8** %5, i8** %6)
%10 = load i8*, i8** %5
%11 = call i32 @strcpy(i8* %1, i8* %10)
%12 = load i8*, i8** %6
%13 = call i32 @strcpy(i8* %2, i8* %12)
%14 = load i8*, i8** %5
%15 = call i32 @free(i8* %14)
ret void
}