#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 uint8_t;
typedef int uint32_t;

/* Variables and functions */
void configureMultiProtocolPatch(void) {
  uint8_t *pParserPatchTab = (uint8_t *)(0x21000000 + 0x0390);
  uint8_t *pPatchTab = (uint8_t *)(0x21000000 + 0x0398);
  uint32_t *pIrqPatch = (uint32_t *)(0x21000000 + 0x0434);
  pPatchTab[84] = 0;
  pPatchTab[142] = 1;
  pPatchTab[66] = 2;
  pPatchTab[102] = 3;
  pParserPatchTab[1] = 4;
  pPatchTab[1] = 5;
  pPatchTab[18] = 6;
  pPatchTab[112] = 7;
  pPatchTab[115] = 8;
  pPatchTab[22] = 9;
  pPatchTab[10] = 10;
  pPatchTab[36] = 11;
  pPatchTab[53] = 12;
  pPatchTab[28] = 13;
  pPatchTab[104] = 14;
  pPatchTab[75] = 15;
  pPatchTab[73] = 16;
  pPatchTab[117] = 17;
  pPatchTab[105] = 18;
  pPatchTab[106] = 19;
  pPatchTab[70] = 20;
  pPatchTab[71] = 21;
  pPatchTab[69] = 22;
  pParserPatchTab[0] = 23;
  pPatchTab[60] = 24;
  pIrqPatch[21] = 0x21004799;
}


x86 assembly (clang, -O0):
<configureMultiProtocolPatch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21000390,%eax
mov    %rax,-0x8(%rbp)
mov    $0x21000398,%eax
mov    %rax,-0x10(%rbp)
mov    $0x21000434,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,0x150(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x238(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,0x108(%rax)
mov    -0x10(%rbp),%rax
movl   $0x3,0x198(%rax)
mov    -0x8(%rbp),%rax
movl   $0x4,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x5,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x6,0x48(%rax)
mov    -0x10(%rbp),%rax
movl   $0x7,0x1c0(%rax)
mov    -0x10(%rbp),%rax
movl   $0x8,0x1cc(%rax)
mov    -0x10(%rbp),%rax
movl   $0x9,0x58(%rax)
mov    -0x10(%rbp),%rax
movl   $0xa,0x28(%rax)
mov    -0x10(%rbp),%rax
movl   $0xb,0x90(%rax)
mov    -0x10(%rbp),%rax
movl   $0xc,0xd4(%rax)
mov    -0x10(%rbp),%rax
movl   $0xd,0x70(%rax)
mov    -0x10(%rbp),%rax
movl   $0xe,0x1a0(%rax)
mov    -0x10(%rbp),%rax
movl   $0xf,0x12c(%rax)
mov    -0x10(%rbp),%rax
movl   $0x10,0x124(%rax)
mov    -0x10(%rbp),%rax
movl   $0x11,0x1d4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x12,0x1a4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x13,0x1a8(%rax)
mov    -0x10(%rbp),%rax
movl   $0x14,0x118(%rax)
mov    -0x10(%rbp),%rax
movl   $0x15,0x11c(%rax)
mov    -0x10(%rbp),%rax
movl   $0x16,0x114(%rax)
mov    -0x8(%rbp),%rax
movl   $0x17,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x18,0xf0(%rax)
mov    -0x18(%rbp),%rax
movl   $0x21004799,0x54(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<configureMultiProtocolPatch>:
movl   $0x0,0x210004e8
movl   $0x1,0x210005d0
movl   $0x2,0x210004a0
movl   $0x3,0x21000530
movl   $0x4,0x21000394
movl   $0x5,0x2100039c
movl   $0x6,0x210003e0
movl   $0x7,0x21000558
movl   $0x8,0x21000564
movl   $0x9,0x210003f0
movl   $0xa,0x210003c0
movl   $0xb,0x21000428
movl   $0xc,0x2100046c
movl   $0xd,0x21000408
movl   $0xe,0x21000538
movl   $0xf,0x210004c4
movl   $0x10,0x210004bc
movl   $0x11,0x2100056c
movl   $0x12,0x2100053c
movl   $0x13,0x21000540
movl   $0x14,0x210004b0
movl   $0x15,0x210004b4
movl   $0x16,0x210004ac
movl   $0x17,0x21000390
movl   $0x21004799,0x21000488
ret

LLVM IR (-O0):
define void @configureMultiProtocolPatch() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
store i32* inttoptr (i64 553649040 to i32*), i32** %1
store i32* inttoptr (i64 553649048 to i32*), i32** %2
store i32* inttoptr (i64 553649204 to i32*), i32** %3
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 84
store i32 0, i32* %5
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 142
store i32 1, i32* %7
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 66
store i32 2, i32* %9
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 102
store i32 3, i32* %11
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 4, i32* %13
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 5, i32* %15
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 18
store i32 6, i32* %17
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 112
store i32 7, i32* %19
%20 = load i32*, i32** %2
%21 = getelementptr inbounds i32, i32* %20, i64 115
store i32 8, i32* %21
%22 = load i32*, i32** %2
%23 = getelementptr inbounds i32, i32* %22, i64 22
store i32 9, i32* %23
%24 = load i32*, i32** %2
%25 = getelementptr inbounds i32, i32* %24, i64 10
store i32 10, i32* %25
%26 = load i32*, i32** %2
%27 = getelementptr inbounds i32, i32* %26, i64 36
store i32 11, i32* %27
%28 = load i32*, i32** %2
%29 = getelementptr inbounds i32, i32* %28, i64 53
store i32 12, i32* %29
%30 = load i32*, i32** %2
%31 = getelementptr inbounds i32, i32* %30, i64 28
store i32 13, i32* %31
%32 = load i32*, i32** %2
%33 = getelementptr inbounds i32, i32* %32, i64 104
store i32 14, i32* %33
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 75
store i32 15, i32* %35
%36 = load i32*, i32** %2
%37 = getelementptr inbounds i32, i32* %36, i64 73
store i32 16, i32* %37
%38 = load i32*, i32** %2
%39 = getelementptr inbounds i32, i32* %38, i64 117
store i32 17, i32* %39
%40 = load i32*, i32** %2
%41 = getelementptr inbounds i32, i32* %40, i64 105
store i32 18, i32* %41
%42 = load i32*, i32** %2
%43 = getelementptr inbounds i32, i32* %42, i64 106
store i32 19, i32* %43
%44 = load i32*, i32** %2
%45 = getelementptr inbounds i32, i32* %44, i64 70
store i32 20, i32* %45
%46 = load i32*, i32** %2
%47 = getelementptr inbounds i32, i32* %46, i64 71
store i32 21, i32* %47
%48 = load i32*, i32** %2
%49 = getelementptr inbounds i32, i32* %48, i64 69
store i32 22, i32* %49
%50 = load i32*, i32** %1
%51 = getelementptr inbounds i32, i32* %50, i64 0
store i32 23, i32* %51
%52 = load i32*, i32** %2
%53 = getelementptr inbounds i32, i32* %52, i64 60
store i32 24, i32* %53
%54 = load i32*, i32** %3
%55 = getelementptr inbounds i32, i32* %54, i64 21
store i32 553666457, i32* %55
ret void
}

LLVM IR (-O2):
define void @configureMultiProtocolPatch() {
store i32 0, i32* inttoptr (i64 553649384 to i32*)
store i32 1, i32* inttoptr (i64 553649616 to i32*)
store i32 2, i32* inttoptr (i64 553649312 to i32*)
store i32 3, i32* inttoptr (i64 553649456 to i32*)
store i32 4, i32* inttoptr (i64 553649044 to i32*)
store i32 5, i32* inttoptr (i64 553649052 to i32*)
store i32 6, i32* inttoptr (i64 553649120 to i32*)
store i32 7, i32* inttoptr (i64 553649496 to i32*)
store i32 8, i32* inttoptr (i64 553649508 to i32*)
store i32 9, i32* inttoptr (i64 553649136 to i32*)
store i32 10, i32* inttoptr (i64 553649088 to i32*)
store i32 11, i32* inttoptr (i64 553649192 to i32*)
store i32 12, i32* inttoptr (i64 553649260 to i32*)
store i32 13, i32* inttoptr (i64 553649160 to i32*)
store i32 14, i32* inttoptr (i64 553649464 to i32*)
store i32 15, i32* inttoptr (i64 553649348 to i32*)
store i32 16, i32* inttoptr (i64 553649340 to i32*)
store i32 17, i32* inttoptr (i64 553649516 to i32*)
store i32 18, i32* inttoptr (i64 553649468 to i32*)
store i32 19, i32* inttoptr (i64 553649472 to i32*)
store i32 20, i32* inttoptr (i64 553649328 to i32*)
store i32 21, i32* inttoptr (i64 553649332 to i32*)
store i32 22, i32* inttoptr (i64 553649324 to i32*)
store i32 23, i32* inttoptr (i64 553649040 to i32*)
store i32 553666457, i32* inttoptr (i64 553649288 to i32*)
ret void
}