#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 configureBt5Patch(void) {
  uint8_t *pParserPatchTab = (uint8_t *)(0x21000000 + 0x0390);
  uint8_t *pPatchTab = (uint8_t *)(0x21000000 + 0x0398);
  uint32_t *pIrqPatch = (uint32_t *)(0x21000000 + 0x0434);
  pPatchTab[142] = 0;
  pPatchTab[66] = 1;
  pParserPatchTab[1] = 2;
  pPatchTab[1] = 3;
  pPatchTab[18] = 4;
  pPatchTab[112] = 5;
  pPatchTab[115] = 6;
  pPatchTab[22] = 7;
  pPatchTab[10] = 8;
  pPatchTab[36] = 9;
  pPatchTab[73] = 10;
  pPatchTab[117] = 11;
  pPatchTab[28] = 12;
  pPatchTab[105] = 13;
  pPatchTab[106] = 14;
  pPatchTab[70] = 15;
  pParserPatchTab[0] = 16;
  pIrqPatch[21] = 0x210045ad;
}


x86 assembly (clang, -O0):
<configureBt5Patch>:
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,0x238(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x108(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x4,0x48(%rax)
mov    -0x10(%rbp),%rax
movl   $0x5,0x1c0(%rax)
mov    -0x10(%rbp),%rax
movl   $0x6,0x1cc(%rax)
mov    -0x10(%rbp),%rax
movl   $0x7,0x58(%rax)
mov    -0x10(%rbp),%rax
movl   $0x8,0x28(%rax)
mov    -0x10(%rbp),%rax
movl   $0x9,0x90(%rax)
mov    -0x10(%rbp),%rax
movl   $0xa,0x124(%rax)
mov    -0x10(%rbp),%rax
movl   $0xb,0x1d4(%rax)
mov    -0x10(%rbp),%rax
movl   $0xc,0x70(%rax)
mov    -0x10(%rbp),%rax
movl   $0xd,0x1a4(%rax)
mov    -0x10(%rbp),%rax
movl   $0xe,0x1a8(%rax)
mov    -0x10(%rbp),%rax
movl   $0xf,0x118(%rax)
mov    -0x8(%rbp),%rax
movl   $0x10,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x210045ad,0x54(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<configureBt5Patch>:
movl   $0x0,0x210005d0
movl   $0x1,0x210004a0
movl   $0x2,0x21000394
movl   $0x3,0x2100039c
movl   $0x4,0x210003e0
movl   $0x5,0x21000558
movl   $0x6,0x21000564
movl   $0x7,0x210003f0
movl   $0x8,0x210003c0
movl   $0x9,0x21000428
movl   $0xa,0x210004bc
movl   $0xb,0x2100056c
movl   $0xc,0x21000408
movl   $0xd,0x2100053c
movl   $0xe,0x21000540
movl   $0xf,0x210004b0
movl   $0x10,0x21000390
movl   $0x210045ad,0x21000488
ret

LLVM IR (-O0):
define void @configureBt5Patch() {
%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 142
store i32 0, i32* %5
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 66
store i32 1, i32* %7
%8 = load i32*, i32** %1
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 2, i32* %9
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 3, i32* %11
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 18
store i32 4, i32* %13
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 112
store i32 5, i32* %15
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 115
store i32 6, i32* %17
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 22
store i32 7, i32* %19
%20 = load i32*, i32** %2
%21 = getelementptr inbounds i32, i32* %20, i64 10
store i32 8, i32* %21
%22 = load i32*, i32** %2
%23 = getelementptr inbounds i32, i32* %22, i64 36
store i32 9, i32* %23
%24 = load i32*, i32** %2
%25 = getelementptr inbounds i32, i32* %24, i64 73
store i32 10, i32* %25
%26 = load i32*, i32** %2
%27 = getelementptr inbounds i32, i32* %26, i64 117
store i32 11, i32* %27
%28 = load i32*, i32** %2
%29 = getelementptr inbounds i32, i32* %28, i64 28
store i32 12, i32* %29
%30 = load i32*, i32** %2
%31 = getelementptr inbounds i32, i32* %30, i64 105
store i32 13, i32* %31
%32 = load i32*, i32** %2
%33 = getelementptr inbounds i32, i32* %32, i64 106
store i32 14, i32* %33
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 70
store i32 15, i32* %35
%36 = load i32*, i32** %1
%37 = getelementptr inbounds i32, i32* %36, i64 0
store i32 16, i32* %37
%38 = load i32*, i32** %3
%39 = getelementptr inbounds i32, i32* %38, i64 21
store i32 553665965, i32* %39
ret void
}

LLVM IR (-O2):
define void @configureBt5Patch() {
store i32 0, i32* inttoptr (i64 553649616 to i32*)
store i32 1, i32* inttoptr (i64 553649312 to i32*)
store i32 2, i32* inttoptr (i64 553649044 to i32*)
store i32 3, i32* inttoptr (i64 553649052 to i32*)
store i32 4, i32* inttoptr (i64 553649120 to i32*)
store i32 5, i32* inttoptr (i64 553649496 to i32*)
store i32 6, i32* inttoptr (i64 553649508 to i32*)
store i32 7, i32* inttoptr (i64 553649136 to i32*)
store i32 8, i32* inttoptr (i64 553649088 to i32*)
store i32 9, i32* inttoptr (i64 553649192 to i32*)
store i32 10, i32* inttoptr (i64 553649340 to i32*)
store i32 11, i32* inttoptr (i64 553649516 to i32*)
store i32 12, i32* inttoptr (i64 553649160 to i32*)
store i32 13, i32* inttoptr (i64 553649468 to i32*)
store i32 14, i32* inttoptr (i64 553649472 to i32*)
store i32 15, i32* inttoptr (i64 553649328 to i32*)
store i32 16, i32* inttoptr (i64 553649040 to i32*)
store i32 553665965, i32* inttoptr (i64 553649288 to i32*)
ret void
}