#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*/ patch_ret;

/* Variables and functions */
int /*<<< orphan*/ merge_rom(unsigned char const *, char *, int, int);
int main(int argc, char *argv[]) {
  static const unsigned char patch_ret[] = {
      0x06, 0x03, 0x00, 0x3d, 0xf0, 0x3d, 0xf0, 0xff, 0x91, 0xfc,
      0xff, 0x81, 0xfc, 0xff, 0x99, 0x08, 0xc,  0x2,  0x1d, 0xf0};
  merge_rom(patch_ret, "s2rom.bin", 0x0001810c + 3, sizeof(patch_ret));
  merge_rom(patch_ret, "s2rom.bin", 0x000181b8 + 3, sizeof(patch_ret));
  merge_rom(patch_ret, "s2rom.bin", 0x00018ca4 + 3, sizeof(patch_ret));
  merge_rom(patch_ret, "s2rom.bin", 0x00016e88 + 3, sizeof(patch_ret));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x1810f,%edx
mov    $0x14,%ecx
call   1030 <merge_rom@plt>
lea    0xebd(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x181bb,%edx
mov    $0x14,%ecx
call   1030 <merge_rom@plt>
lea    0xea0(%rip),%rdi
lea    0xead(%rip),%rsi
mov    $0x18ca7,%edx
mov    $0x14,%ecx
call   1030 <merge_rom@plt>
lea    0xe83(%rip),%rdi
lea    0xe90(%rip),%rsi
mov    $0x16e8b,%edx
mov    $0x14,%ecx
call   1030 <merge_rom@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
lea    0xef2(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1810f,%edx
mov    $0x14,%ecx
call   1030 <merge_rom@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x181bb,%edx
mov    $0x14,%ecx
call   1030 <merge_rom@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x18ca7,%edx
mov    $0x14,%ecx
call   1030 <merge_rom@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x16e8b,%edx
mov    $0x14,%ecx
call   1030 <merge_rom@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@main.patch_ret = internal constant [20 x i8] c"\06\03\00=\F0=\F0\FF\91\FC\FF\81\FC\FF\99\08\0C\02\1D\F0"
@.str = [10 x i8] c"s2rom.bin\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @merge_rom(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @main.patch_ret, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 98575, i32 20)
%6 = call i32 @merge_rom(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @main.patch_ret, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 98747, i32 20)
%7 = call i32 @merge_rom(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @main.patch_ret, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 101543, i32 20)
%8 = call i32 @merge_rom(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @main.patch_ret, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 93835, i32 20)
ret i32 0
}

LLVM IR (-O2):
@main.patch_ret = internal constant [20 x i8] c"\06\03\00=\F0=\F0\FF\91\FC\FF\81\FC\FF\99\08\0C\02\1D\F0"
@.str = [10 x i8] c"s2rom.bin\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @merge_rom(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @main.patch_ret, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 98575, i32 20)
%4 = tail call i32 @merge_rom(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @main.patch_ret, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 98747, i32 20)
%5 = tail call i32 @merge_rom(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @main.patch_ret, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 101543, i32 20)
%6 = tail call i32 @merge_rom(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @main.patch_ret, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 93835, i32 20)
ret i32 0
}