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

/* Variables and functions */
int /*<<< orphan*/ rd1_3_wr2_4(char const *, char *, int const, int);
int signed_range(int, int);
void test_rd1_3_wr2_4(const void *s, void *d, int n1, int n2) {
  rd1_3_wr2_4(s, d, 1, 2);
  rd1_3_wr2_4(s, d, 123, 456);
  rd1_3_wr2_4(s, d, 0x7fffffff, 0x7fffffff);
  rd1_3_wr2_4(s, d, -1, 2);
  const int ir_min_m1 = signed_range(((-0x7fffffff - 1)), (-1));
  rd1_3_wr2_4(s, d, ir_min_m1, 2);
  rd1_3_wr2_4(s, d, signed_range((-1), (0)), 2);
  rd1_3_wr2_4(s, d, signed_range(((-0x7fffffff - 1)), (0x7fffffff)), 2);
  rd1_3_wr2_4(s, d, n1, n2);
  const char s11[11] = "0123456789";
  rd1_3_wr2_4(s11, d, 11, n2);
  rd1_3_wr2_4(s11, d, 12, n2);
  rd1_3_wr2_4(s11, d, signed_range((0), (11)), n2);
  rd1_3_wr2_4(s11, d, signed_range((0), (12)), n2);
  rd1_3_wr2_4(s11, d, signed_range((11), (12)), n2);
  rd1_3_wr2_4(s11, d, signed_range((11), (0x7fffffff)), n2);
  rd1_3_wr2_4(s11, d, signed_range((12), (13)), n2);
  char d4[4];
  rd1_3_wr2_4(s, d4, n1, 4);
  rd1_3_wr2_4(s, d4, n1, 5);
  rd1_3_wr2_4(s11, d4, signed_range((12), (13)), signed_range((5), (6)));
}


x86 assembly (clang, -O0):
<test_rd1_3_wr2_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x7b,%edx
mov    $0x1c8,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x7fffffff,%ecx
mov    %ecx,%edx
call   1040 <rd1_3_wr2_4@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    $0x80000000,%edi
mov    $0xffffffff,%esi
call   1030 <signed_range@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <signed_range@plt>
mov    -0xb0(%rbp),%rdi
mov    -0xa8(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    $0x80000000,%edi
mov    $0x7fffffff,%esi
call   1030 <signed_range@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x98(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    0xdb2(%rip),%rax
mov    %rax,-0x27(%rbp)
mov    0xdaf(%rip),%ax
mov    %ax,-0x1f(%rbp)
mov    0xda7(%rip),%al
mov    %al,-0x1d(%rbp)
lea    -0x27(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%ecx
mov    $0xb,%edx
call   1040 <rd1_3_wr2_4@plt>
lea    -0x27(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%ecx
mov    $0xc,%edx
call   1040 <rd1_3_wr2_4@plt>
lea    -0x27(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x88(%rbp)
xor    %edi,%edi
mov    $0xb,%esi
call   1030 <signed_range@plt>
mov    -0x90(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%ecx
call   1040 <rd1_3_wr2_4@plt>
lea    -0x27(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
xor    %edi,%edi
mov    $0xc,%esi
call   1030 <signed_range@plt>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%ecx
call   1040 <rd1_3_wr2_4@plt>
lea    -0x27(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    $0xb,%edi
mov    $0xc,%esi
call   1030 <signed_range@plt>
mov    -0x70(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%ecx
call   1040 <rd1_3_wr2_4@plt>
lea    -0x27(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    $0xb,%edi
mov    $0x7fffffff,%esi
call   1030 <signed_range@plt>
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%ecx
call   1040 <rd1_3_wr2_4@plt>
lea    -0x27(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    $0xc,%edi
mov    $0xd,%esi
call   1030 <signed_range@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    -0x8(%rbp),%rdi
lea    -0x2b(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x4,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    -0x8(%rbp),%rdi
lea    -0x2b(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x5,%ecx
call   1040 <rd1_3_wr2_4@plt>
lea    -0x27(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x2b(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0xc,%edi
mov    $0xd,%esi
call   1030 <signed_range@plt>
mov    %eax,-0x30(%rbp)
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <signed_range@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%edx
mov    %eax,%ecx
call   1040 <rd1_3_wr2_4@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rd1_3_wr2_4>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    $0x1,%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x7b,%edx
mov    $0x1c8,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x7fffffff,%edx
mov    $0x7fffffff,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xffffffff,%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    $0x80000000,%edi
mov    $0xffffffff,%esi
call   1030 <signed_range@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <signed_range@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    $0x80000000,%edi
mov    $0x7fffffff,%esi
call   1030 <signed_range@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
mov    $0x2,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
mov    %r15d,%ecx
call   1040 <rd1_3_wr2_4@plt>
movabs $0x3736353433323130,%rax
35 36 37
mov    %rax,(%rsp)
movl   $0x393837,0x7(%rsp)
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0xb,%edx
mov    %r15d,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0xc,%edx
mov    %r15d,%ecx
call   1040 <rd1_3_wr2_4@plt>
xor    %edi,%edi
mov    $0xb,%esi
call   1030 <signed_range@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
mov    %r15d,%ecx
call   1040 <rd1_3_wr2_4@plt>
xor    %edi,%edi
mov    $0xc,%esi
call   1030 <signed_range@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
mov    %r15d,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    $0xb,%edi
mov    $0xc,%esi
call   1030 <signed_range@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
mov    %r15d,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    $0xb,%edi
mov    $0x7fffffff,%esi
call   1030 <signed_range@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
mov    %r15d,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    $0xc,%edi
mov    $0xd,%esi
call   1030 <signed_range@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
mov    %r15d,%ecx
call   1040 <rd1_3_wr2_4@plt>
lea    0xc(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
mov    $0x4,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
mov    $0x5,%ecx
call   1040 <rd1_3_wr2_4@plt>
mov    $0xc,%edi
mov    $0xd,%esi
call   1030 <signed_range@plt>
mov    %eax,%ebx
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <signed_range@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <rd1_3_wr2_4@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.test_rd1_3_wr2_4.s11 = [11 x i8] c"0123456789\00"
define void @test_rd1_3_wr2_4(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [11 x i8]
%11 = alloca [4 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i32 @rd1_3_wr2_4(i8* %12, i8* %13, i32 1, i32 2)
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i32 @rd1_3_wr2_4(i8* %15, i8* %16, i32 123, i32 456)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = call i32 @rd1_3_wr2_4(i8* %18, i8* %19, i32 2147483647, i32 2147483647)
%21 = load i8*, i8** %5
%22 = load i8*, i8** %6
%23 = call i32 @rd1_3_wr2_4(i8* %21, i8* %22, i32 -1, i32 2)
%24 = call i32 @signed_range(i32 -2147483648, i32 -1)
store i32 %24, i32* %9
%25 = load i8*, i8** %5
%26 = load i8*, i8** %6
%27 = load i32, i32* %9
%28 = call i32 @rd1_3_wr2_4(i8* %25, i8* %26, i32 %27, i32 2)
%29 = load i8*, i8** %5
%30 = load i8*, i8** %6
%31 = call i32 @signed_range(i32 -1, i32 0)
%32 = call i32 @rd1_3_wr2_4(i8* %29, i8* %30, i32 %31, i32 2)
%33 = load i8*, i8** %5
%34 = load i8*, i8** %6
%35 = call i32 @signed_range(i32 -2147483648, i32 2147483647)
%36 = call i32 @rd1_3_wr2_4(i8* %33, i8* %34, i32 %35, i32 2)
%37 = load i8*, i8** %5
%38 = load i8*, i8** %6
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = call i32 @rd1_3_wr2_4(i8* %37, i8* %38, i32 %39, i32 %40)
%42 = bitcast [11 x i8]* %10 to i8*
%43 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%44 = load i8*, i8** %6
%45 = load i32, i32* %8
%46 = call i32 @rd1_3_wr2_4(i8* %43, i8* %44, i32 11, i32 %45)
%47 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%48 = load i8*, i8** %6
%49 = load i32, i32* %8
%50 = call i32 @rd1_3_wr2_4(i8* %47, i8* %48, i32 12, i32 %49)
%51 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%52 = load i8*, i8** %6
%53 = call i32 @signed_range(i32 0, i32 11)
%54 = load i32, i32* %8
%55 = call i32 @rd1_3_wr2_4(i8* %51, i8* %52, i32 %53, i32 %54)
%56 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%57 = load i8*, i8** %6
%58 = call i32 @signed_range(i32 0, i32 12)
%59 = load i32, i32* %8
%60 = call i32 @rd1_3_wr2_4(i8* %56, i8* %57, i32 %58, i32 %59)
%61 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%62 = load i8*, i8** %6
%63 = call i32 @signed_range(i32 11, i32 12)
%64 = load i32, i32* %8
%65 = call i32 @rd1_3_wr2_4(i8* %61, i8* %62, i32 %63, i32 %64)
%66 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%67 = load i8*, i8** %6
%68 = call i32 @signed_range(i32 11, i32 2147483647)
%69 = load i32, i32* %8
%70 = call i32 @rd1_3_wr2_4(i8* %66, i8* %67, i32 %68, i32 %69)
%71 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%72 = load i8*, i8** %6
%73 = call i32 @signed_range(i32 12, i32 13)
%74 = load i32, i32* %8
%75 = call i32 @rd1_3_wr2_4(i8* %71, i8* %72, i32 %73, i32 %74)
%76 = load i8*, i8** %5
%77 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%78 = load i32, i32* %7
%79 = call i32 @rd1_3_wr2_4(i8* %76, i8* %77, i32 %78, i32 4)
%80 = load i8*, i8** %5
%81 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%82 = load i32, i32* %7
%83 = call i32 @rd1_3_wr2_4(i8* %80, i8* %81, i32 %82, i32 5)
%84 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%85 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%86 = call i32 @signed_range(i32 12, i32 13)
%87 = call i32 @signed_range(i32 5, i32 6)
%88 = call i32 @rd1_3_wr2_4(i8* %84, i8* %85, i32 %86, i32 %87)
ret void
}

LLVM IR (-O2):
@__const.test_rd1_3_wr2_4.s11 = [11 x i8] c"0123456789\00"
define void @test_rd1_3_wr2_4(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [11 x i8]
%6 = alloca [4 x i8]
%7 = tail call i32 @rd1_3_wr2_4(i8* %0, i8* %1, i32 1, i32 2)
%8 = tail call i32 @rd1_3_wr2_4(i8* %0, i8* %1, i32 123, i32 456)
%9 = tail call i32 @rd1_3_wr2_4(i8* %0, i8* %1, i32 2147483647, i32 2147483647)
%10 = tail call i32 @rd1_3_wr2_4(i8* %0, i8* %1, i32 -1, i32 2)
%11 = tail call i32 @signed_range(i32 -2147483648, i32 -1)
%12 = tail call i32 @rd1_3_wr2_4(i8* %0, i8* %1, i32 %11, i32 2)
%13 = tail call i32 @signed_range(i32 -1, i32 0)
%14 = tail call i32 @rd1_3_wr2_4(i8* %0, i8* %1, i32 %13, i32 2)
%15 = tail call i32 @signed_range(i32 -2147483648, i32 2147483647)
%16 = tail call i32 @rd1_3_wr2_4(i8* %0, i8* %1, i32 %15, i32 2)
%17 = tail call i32 @rd1_3_wr2_4(i8* %0, i8* %1, i32 %2, i32 %3)
%18 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 0
%19 = call i32 @rd1_3_wr2_4(i8* %18, i8* %1, i32 11, i32 %3)
%20 = call i32 @rd1_3_wr2_4(i8* %18, i8* %1, i32 12, i32 %3)
%21 = call i32 @signed_range(i32 0, i32 11)
%22 = call i32 @rd1_3_wr2_4(i8* %18, i8* %1, i32 %21, i32 %3)
%23 = call i32 @signed_range(i32 0, i32 12)
%24 = call i32 @rd1_3_wr2_4(i8* %18, i8* %1, i32 %23, i32 %3)
%25 = call i32 @signed_range(i32 11, i32 12)
%26 = call i32 @rd1_3_wr2_4(i8* %18, i8* %1, i32 %25, i32 %3)
%27 = call i32 @signed_range(i32 11, i32 2147483647)
%28 = call i32 @rd1_3_wr2_4(i8* %18, i8* %1, i32 %27, i32 %3)
%29 = call i32 @signed_range(i32 12, i32 13)
%30 = call i32 @rd1_3_wr2_4(i8* %18, i8* %1, i32 %29, i32 %3)
%31 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%32 = call i32 @rd1_3_wr2_4(i8* %0, i8* %31, i32 %2, i32 4)
%33 = call i32 @rd1_3_wr2_4(i8* %0, i8* %31, i32 %2, i32 5)
%34 = call i32 @signed_range(i32 12, i32 13)
%35 = call i32 @signed_range(i32 5, i32 6)
%36 = call i32 @rd1_3_wr2_4(i8* %18, i8* %31, i32 %34, i32 %35)
ret void
}