#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 */
struct arm_instruction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, ...);
char *strchr(char *, int /*<<< orphan*/);
int t2ev_ldm_stm(unsigned opcode, unsigned address,
                 struct arm_instruction *instruction, char *cp) {
  int rn = (opcode >> 16) & 0xf;
  int op = (opcode >> 22) & 0x6;
  int t = (opcode >> 21) & 1;
  unsigned registers = opcode & 0xffff;
  char *mode = "";
  if (opcode & (1 << 20))
    op |= 1;
  switch (op) {
  case 0:
    mode = "DB";
  case 6:
    sprintf(cp, "SRS%s\tsp%s, #%d", mode, t ? "!" : "",
            (unsigned)(opcode & 0x1f));
    return 0;
  case 1:
    mode = "DB";
  case 7:
    sprintf(cp, "RFE%s\tr%d%s", mode, (unsigned)((opcode >> 16) & 0xf),
            t ? "!" : "");
    return 0;
  case 2:
    sprintf(cp, "STM.W\tr%d%s, ", rn, t ? "!" : "");
    break;
  case 3:
    if (rn == 13 && t)
      sprintf(cp, "POP.W\t");
    else
      sprintf(cp, "LDM.W\tr%d%s, ", rn, t ? "!" : "");
    break;
  case 4:
    if (rn == 13 && t)
      sprintf(cp, "PUSH.W\t");
    else
      sprintf(cp, "STMDB\tr%d%s, ", rn, t ? "!" : "");
    break;
  case 5:
    sprintf(cp, "LDMDB.W\tr%d%s, ", rn, t ? "!" : "");
    break;
  default:
    return -1;
  }
  cp = strchr(cp, 0);
  *cp++ = '{';
  for (t = 0; registers; t++, registers >>= 1) {
    if ((registers & 1) == 0)
      continue;
    registers &= ~1;
    sprintf(cp, "r%d%s", t, registers ? ", " : "");
    cp = strchr(cp, 0);
  }
  *cp++ = '}';
  *cp++ = 0;
  return 0;
}


x86 assembly (clang, -O0):
<t2ev_ldm_stm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
and    $0xf,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x16,%eax
and    $0x6,%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x15,%eax
and    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x30(%rbp)
lea    0xeff(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%eax
and    $0x100000,%eax
cmp    $0x0,%eax
je     118a <t2ev_ldm_stm+0x6a>
mov    -0x28(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %rax,-0x40(%rbp)
sub    $0x7,%rax
ja     1368 <t2ev_ldm_stm+0x248>
mov    -0x40(%rbp),%rax
lea    0xe5a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe6a(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x2c(%rbp),%esi
lea    0xe9f(%rip),%rcx
lea    0xe60(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
mov    -0x8(%rbp),%r8d
and    $0x1f,%r8d
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1441 <t2ev_ldm_stm+0x321>
lea    0xe1d(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
and    $0xf,%ecx
mov    -0x2c(%rbp),%esi
lea    0xe49(%rip),%r8
lea    0xe0a(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r8
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1441 <t2ev_ldm_stm+0x321>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x2c(%rbp),%esi
lea    0xe10(%rip),%rcx
lea    0xdd1(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
lea    0xdd1(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1374 <t2ev_ldm_stm+0x254>
cmpl   $0xd,-0x24(%rbp)
jne    12a7 <t2ev_ldm_stm+0x187>
cmpl   $0x0,-0x2c(%rbp)
je     12a7 <t2ev_ldm_stm+0x187>
mov    -0x20(%rbp),%rdi
lea    0xdb4(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    12d4 <t2ev_ldm_stm+0x1b4>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x2c(%rbp),%esi
lea    0xdb3(%rip),%rcx
lea    0xd74(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
lea    0xd89(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1374 <t2ev_ldm_stm+0x254>
cmpl   $0xd,-0x24(%rbp)
jne    1304 <t2ev_ldm_stm+0x1e4>
cmpl   $0x0,-0x2c(%rbp)
je     1304 <t2ev_ldm_stm+0x1e4>
mov    -0x20(%rbp),%rdi
lea    0xd6c(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1331 <t2ev_ldm_stm+0x211>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x2c(%rbp),%esi
lea    0xd56(%rip),%rcx
lea    0xd17(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
lea    0xd42(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1374 <t2ev_ldm_stm+0x254>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x2c(%rbp),%esi
lea    0xd24(%rip),%rcx
lea    0xce5(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
lea    0xd1e(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1374 <t2ev_ldm_stm+0x254>
movl   $0xffffffff,-0x4(%rbp)
jmp    1441 <t2ev_ldm_stm+0x321>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x7b,(%rax)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     1416 <t2ev_ldm_stm+0x2f6>
mov    -0x30(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    13ba <t2ev_ldm_stm+0x29a>
jmp    13ff <t2ev_ldm_stm+0x2df>
mov    -0x30(%rbp),%eax
and    $0xfffffffe,%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%esi
lea    0xc97(%rip),%rcx
lea    0xc9c(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
lea    0xc52(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x30(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    139c <t2ev_ldm_stm+0x27c>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x7d,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2ev_ldm_stm>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edi,%ebx
mov    %edi,%ebp
shr    $0x10,%ebp
and    $0xf,%ebp
mov    %edi,%eax
shr    $0x16,%eax
and    $0x6,%eax
mov    %edi,%esi
shr    $0x15,%esi
mov    %edi,%ecx
shr    $0x14,%ecx
and    $0x1,%ecx
or     %eax,%ecx
lea    0xeff(%rip),%rdi
lea    0xea3(%rip),%rax
movslq (%rax,%rcx,4),%rcx
add    %rax,%rcx
mov    %rdi,%rdx
mov    %rdi,%rax
jmp    *%rcx
lea    0xead(%rip),%rdx
test   $0x1,%sil
lea    0xeb5(%rip),%rcx
cmove  %rdi,%rcx
and    $0x1f,%ebx
lea    0xe97(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%r8d
xor    %eax,%eax
call   1040 <sprintf@plt>
jmp    1313 <t2ev_ldm_stm+0x1f3>
lea    0xe7b(%rip),%rax
test   $0x1,%sil
lea    0xe83(%rip),%r8
cmove  %rdi,%r8
lea    0xe7a(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <sprintf@plt>
jmp    1313 <t2ev_ldm_stm+0x1f3>
test   $0x1,%sil
lea    0xe7b(%rip),%rax
lea    0xe52(%rip),%rcx
cmove  %rax,%rcx
lea    0xe55(%rip),%rsi
jmp    1287 <t2ev_ldm_stm+0x167>
cmp    $0xd,%ebp
jne    124b <t2ev_ldm_stm+0x12b>
mov    %esi,%eax
and    $0x1,%eax
je     124b <t2ev_ldm_stm+0x12b>
movl   $0x9572e,0x3(%r14)
movl   $0x2e504f50,(%r14)
jmp    1293 <t2ev_ldm_stm+0x173>
cmp    $0xd,%ebp
jne    126a <t2ev_ldm_stm+0x14a>
mov    %esi,%eax
and    $0x1,%eax
je     126a <t2ev_ldm_stm+0x14a>
movabs $0x9572e48535550,%rax
mov    %rax,(%r14)
jmp    1293 <t2ev_ldm_stm+0x173>
test   $0x1,%sil
lea    0xe1e(%rip),%rax
lea    0xdf5(%rip),%rcx
cmove  %rax,%rcx
lea    0xe29(%rip),%rsi
jmp    1287 <t2ev_ldm_stm+0x167>
lea    0xde1(%rip),%rax
lea    0xdfc(%rip),%rcx
test   $0x1,%sil
cmovne %rax,%rcx
lea    0xdee(%rip),%rsi
jmp    1287 <t2ev_ldm_stm+0x167>
lea    0xdc2(%rip),%rax
lea    0xddd(%rip),%rcx
test   $0x1,%sil
cmovne %rax,%rcx
lea    0xddd(%rip),%rsi
mov    %r14,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
movzwl %bx,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r14,%rax,1),%r15
add    $0x1,%r15
movb   $0x7b,(%r14,%rax,1)
test   %ebp,%ebp
je     130d <t2ev_ldm_stm+0x1ed>
lea    0xd9f(%rip),%r12
lea    0xdb2(%rip),%r13
lea    0xd77(%rip),%r14
xor    %ebx,%ebx
jmp    12de <t2ev_ldm_stm+0x1be>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebp,%eax
shr    %eax
cmp    $0x1,%ebp
mov    %eax,%ebp
jbe    130d <t2ev_ldm_stm+0x1ed>
test   $0x1,%bpl
je     12d0 <t2ev_ldm_stm+0x1b0>
and    $0x7ffffffe,%ebp
mov    %r13,%rcx
cmove  %r12,%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %r15,%rdi
call   1030 <strlen@plt>
add    %rax,%r15
jmp    12d0 <t2ev_ldm_stm+0x1b0>
movw   $0x7d,(%r15)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.arm_instruction = type { i32 }
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"DB\00"
@.str.2 = [16 x i8] c"SRS%s\09sp%s, #%d\00"
@.str.3 = [2 x i8] c"!\00"
@.str.4 = [12 x i8] c"RFE%s\09r%d%s\00"
@.str.5 = [14 x i8] c"STM.W\09r%d%s, \00"
@.str.6 = [7 x i8] c"POP.W\09\00"
@.str.7 = [14 x i8] c"LDM.W\09r%d%s, \00"
@.str.8 = [8 x i8] c"PUSH.W\09\00"
@.str.9 = [14 x i8] c"STMDB\09r%d%s, \00"
@.str.10 = [16 x i8] c"LDMDB.W\09r%d%s, \00"
@.str.11 = [6 x i8] c"r%d%s\00"
@.str.12 = [3 x i8] c", \00"
define i32 @t2ev_ldm_stm(i32 %0, i32 %1, %struct.arm_instruction* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.arm_instruction*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store %struct.arm_instruction* %2, %struct.arm_instruction** %8
store i8* %3, i8** %9
%15 = load i32, i32* %6
%16 = lshr i32 %15, 16
%17 = and i32 %16, 15
store i32 %17, i32* %10
%18 = load i32, i32* %6
%19 = lshr i32 %18, 22
%20 = and i32 %19, 6
store i32 %20, i32* %11
%21 = load i32, i32* %6
%22 = lshr i32 %21, 21
%23 = and i32 %22, 1
store i32 %23, i32* %12
%24 = load i32, i32* %6
%25 = and i32 %24, 65535
store i32 %25, i32* %13
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %14
%26 = load i32, i32* %6
%27 = and i32 %26, 1048576
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %4
%30 = load i32, i32* %11
%31 = or i32 %30, 1
store i32 %31, i32* %11
br label %32
32: ; preds = %29, %4
%33 = load i32, i32* %11
switch i32 %33, label %109 [
i32 0, label %34
i32 6, label %35
i32 1, label %45
i32 7, label %46
i32 2, label %57
i32 3, label %65
i32 4, label %83
i32 5, label %101
]
34: ; preds = %32
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %14
br label %35
35: ; preds = %32, %34
%36 = load i8*, i8** %9
%37 = load i8*, i8** %14
%38 = load i32, i32* %12
%39 = icmp ne i32 %38, 0
%40 = zext i1 %39 to i64
%41 = select i1 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%42 = load i32, i32* %6
%43 = and i32 %42, 31
%44 = call i32 (i8*, i8*, ...) @sprintf(i8* %36, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %37, i8* %41, i32 %43)
store i32 0, i32* %5
br label %145
45: ; preds = %32
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %14
br label %46
46: ; preds = %32, %45
%47 = load i8*, i8** %9
%48 = load i8*, i8** %14
%49 = load i32, i32* %6
%50 = lshr i32 %49, 16
%51 = and i32 %50, 15
%52 = load i32, i32* %12
%53 = icmp ne i32 %52, 0
%54 = zext i1 %53 to i64
%55 = select i1 %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%56 = call i32 (i8*, i8*, ...) @sprintf(i8* %47, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %48, i32 %51, i8* %55)
store i32 0, i32* %5
br label %145
57: ; preds = %32
%58 = load i8*, i8** %9
%59 = load i32, i32* %10
%60 = load i32, i32* %12
%61 = icmp ne i32 %60, 0
%62 = zext i1 %61 to i64
%63 = select i1 %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%64 = call i32 (i8*, i8*, ...) @sprintf(i8* %58, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %59, i8* %63)
br label %110
65: ; preds = %32
%66 = load i32, i32* %10
%67 = icmp eq i32 %66, 13
br i1 %67, label %68, label %74
68: ; preds = %65
%69 = load i32, i32* %12
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %68
%72 = load i8*, i8** %9
%73 = call i32 (i8*, i8*, ...) @sprintf(i8* %72, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %82
74: ; preds = %68, %65
%75 = load i8*, i8** %9
%76 = load i32, i32* %10
%77 = load i32, i32* %12
%78 = icmp ne i32 %77, 0
%79 = zext i1 %78 to i64
%80 = select i1 %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%81 = call i32 (i8*, i8*, ...) @sprintf(i8* %75, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %76, i8* %80)
br label %82
82: ; preds = %74, %71
br label %110
83: ; preds = %32
%84 = load i32, i32* %10
%85 = icmp eq i32 %84, 13
br i1 %85, label %86, label %92
86: ; preds = %83
%87 = load i32, i32* %12
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %86
%90 = load i8*, i8** %9
%91 = call i32 (i8*, i8*, ...) @sprintf(i8* %90, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %100
92: ; preds = %86, %83
%93 = load i8*, i8** %9
%94 = load i32, i32* %10
%95 = load i32, i32* %12
%96 = icmp ne i32 %95, 0
%97 = zext i1 %96 to i64
%98 = select i1 %96, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%99 = call i32 (i8*, i8*, ...) @sprintf(i8* %93, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %94, i8* %98)
br label %100
100: ; preds = %92, %89
br label %110
101: ; preds = %32
%102 = load i8*, i8** %9
%103 = load i32, i32* %10
%104 = load i32, i32* %12
%105 = icmp ne i32 %104, 0
%106 = zext i1 %105 to i64
%107 = select i1 %105, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%108 = call i32 (i8*, i8*, ...) @sprintf(i8* %102, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 %103, i8* %107)
br label %110
109: ; preds = %32
store i32 -1, i32* %5
br label %145
110: ; preds = %101, %100, %82, %57
%111 = load i8*, i8** %9
%112 = call i8* @strchr(i8* %111, i32 0)
store i8* %112, i8** %9
%113 = load i8*, i8** %9
%114 = getelementptr inbounds i8, i8* %113, i32 1
store i8* %114, i8** %9
store i8 123, i8* %113
store i32 0, i32* %12
br label %115
115: ; preds = %135, %110
%116 = load i32, i32* %13
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %140
118: ; preds = %115
%119 = load i32, i32* %13
%120 = and i32 %119, 1
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %123
122: ; preds = %118
br label %135
123: ; preds = %118
%124 = load i32, i32* %13
%125 = and i32 %124, -2
store i32 %125, i32* %13
%126 = load i8*, i8** %9
%127 = load i32, i32* %12
%128 = load i32, i32* %13
%129 = icmp ne i32 %128, 0
%130 = zext i1 %129 to i64
%131 = select i1 %129, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%132 = call i32 (i8*, i8*, ...) @sprintf(i8* %126, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %127, i8* %131)
%133 = load i8*, i8** %9
%134 = call i8* @strchr(i8* %133, i32 0)
store i8* %134, i8** %9
br label %135
135: ; preds = %123, %122
%136 = load i32, i32* %12
%137 = add nsw i32 %136, 1
store i32 %137, i32* %12
%138 = load i32, i32* %13
%139 = lshr i32 %138, 1
store i32 %139, i32* %13
br label %115
140: ; preds = %115
%141 = load i8*, i8** %9
%142 = getelementptr inbounds i8, i8* %141, i32 1
store i8* %142, i8** %9
store i8 125, i8* %141
%143 = load i8*, i8** %9
%144 = getelementptr inbounds i8, i8* %143, i32 1
store i8* %144, i8** %9
store i8 0, i8* %143
store i32 0, i32* %5
br label %145
145: ; preds = %140, %109, %46, %35
%146 = load i32, i32* %5
ret i32 %146
}

LLVM IR (-O2):
%struct.arm_instruction = type { i32 }
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"DB\00"
@.str.2 = [16 x i8] c"SRS%s\09sp%s, #%d\00"
@.str.3 = [2 x i8] c"!\00"
@.str.4 = [12 x i8] c"RFE%s\09r%d%s\00"
@.str.5 = [14 x i8] c"STM.W\09r%d%s, \00"
@.str.6 = [7 x i8] c"POP.W\09\00"
@.str.7 = [14 x i8] c"LDM.W\09r%d%s, \00"
@.str.9 = [14 x i8] c"STMDB\09r%d%s, \00"
@.str.10 = [16 x i8] c"LDMDB.W\09r%d%s, \00"
@.str.11 = [6 x i8] c"r%d%s\00"
@.str.12 = [3 x i8] c", \00"
define i32 @t2ev_ldm_stm(i32 %0, i32 %1, %struct.arm_instruction* nocapture readnone %2, i8* nocapture %3) {
%5 = lshr i32 %0, 16
%6 = and i32 %5, 15
%7 = lshr i32 %0, 22
%8 = and i32 %7, 6
%9 = lshr i32 %0, 21
%10 = and i32 %9, 1
%11 = and i32 %0, 65535
%12 = lshr i32 %0, 20
%13 = and i32 %12, 1
%14 = or i32 %13, %8
switch i32 %14, label %80 [
i32 0, label %15
i32 6, label %16
i32 1, label %22
i32 7, label %23
i32 2, label %28
i32 3, label %32
i32 4, label %40
i32 5, label %49
]
15: ; preds = %4
br label %16
16: ; preds = %4, %15
%17 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %15 ]
%18 = icmp eq i32 %10, 0
%19 = select i1 %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%20 = and i32 %0, 31
%21 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %17, i8* %19, i32 %20)
br label %81
22: ; preds = %4
br label %23
23: ; preds = %4, %22
%24 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %22 ]
%25 = icmp eq i32 %10, 0
%26 = select i1 %25, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%27 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %24, i32 %6, i8* %26)
br label %81
28: ; preds = %4
%29 = icmp eq i32 %10, 0
%30 = select i1 %29, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%31 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %6, i8* %30)
br label %53
32: ; preds = %4
%33 = icmp eq i32 %6, 13
%34 = icmp ne i32 %10, 0
%35 = and i1 %33, %34
br i1 %35, label %36, label %37
36: ; preds = %32
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(7) %3, i8* align 1 dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i64 7, i1 false)
br label %53
37: ; preds = %32
%38 = select i1 %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%39 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %6, i8* %38)
br label %53
40: ; preds = %4
%41 = icmp eq i32 %6, 13
%42 = icmp ne i32 %10, 0
%43 = and i1 %41, %42
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = bitcast i8* %3 to i64*
store i64 2629131083928912, i64* %45
br label %53
46: ; preds = %40
%47 = select i1 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%48 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %6, i8* %47)
br label %53
49: ; preds = %4
%50 = icmp eq i32 %10, 0
%51 = select i1 %50, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%52 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 %6, i8* %51)
br label %53
53: ; preds = %44, %46, %36, %37, %49, %28
%54 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%55 = getelementptr i8, i8* %3, i64 %54
%56 = getelementptr inbounds i8, i8* %55, i64 1
store i8 123, i8* %55
%57 = icmp eq i32 %11, 0
br i1 %57, label %77, label %58
58: ; preds = %53, %71
%59 = phi i32 [ %75, %71 ], [ %11, %53 ]
%60 = phi i32 [ %74, %71 ], [ 0, %53 ]
%61 = phi i8* [ %72, %71 ], [ %56, %53 ]
%62 = and i32 %59, 1
%63 = icmp eq i32 %62, 0
br i1 %63, label %71, label %64
64: ; preds = %58
%65 = and i32 %59, 2147483646
%66 = icmp eq i32 %65, 0
%67 = select i1 %66, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0)
%68 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %61, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %60, i8* %67)
%69 = tail call i64 @strlen(i8* dereferenceable(1) %61)
%70 = getelementptr i8, i8* %61, i64 %69
br label %71
71: ; preds = %58, %64
%72 = phi i8* [ %61, %58 ], [ %70, %64 ]
%73 = phi i32 [ %59, %58 ], [ %65, %64 ]
%74 = add nuw nsw i32 %60, 1
%75 = lshr i32 %73, 1
%76 = icmp ult i32 %73, 2
br i1 %76, label %77, label %58
77: ; preds = %71, %53
%78 = phi i8* [ %56, %53 ], [ %72, %71 ]
%79 = getelementptr inbounds i8, i8* %78, i64 1
store i8 125, i8* %78
store i8 0, i8* %79
br label %81
80: ; preds = %4
unreachable
81: ; preds = %77, %23, %16
ret i32 0
}