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

/* Variables and functions */
int count(int *, int *, int, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a[] = {168120222, 756, 408, 194, 681, 856, 964, 677, 250, 845};
  int b[] = {809, 652, 204, 532, 420, 10, 640688057, 55, 174076738, 318};
  int len = sizeof(a) / sizeof(a[0]);
  int N = 1000000000;
  int res = count(a, b, len, N);
  printf("Min count is %d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0xa,-0x64(%rbp)
movl   $0x3b9aca00,-0x68(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x64(%rbp),%edx
mov    -0x68(%rbp),%ecx
call   1030 <count@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xf01(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
mov    $0x3b9aca00,%ecx
call   1030 <count@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 168120222, i32 756, i32 408, i32 194, i32 681, i32 856, i32 964, i32 677, i32 250, i32 845]
@__const.main.b = [10 x i32] [i32 809, i32 652, i32 204, i32 532, i32 420, i32 10, i32 640688057, i32 55, i32 174076738, i32 318]
@.str = [16 x i8] c"Min count is %d\00"
define void @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [10 x i32]* %1 to i8*
%7 = bitcast [10 x i32]* %2 to i8*
store i32 10, i32* %3
store i32 1000000000, i32* %4
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @count(i32* %8, i32* %9, i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 168120222, i32 756, i32 408, i32 194, i32 681, i32 856, i32 964, i32 677, i32 250, i32 845]
@__const.main.b = [10 x i32] [i32 809, i32 652, i32 204, i32 532, i32 420, i32 10, i32 640688057, i32 55, i32 174076738, i32 318]
@.str = [16 x i8] c"Min count is %d\00"
define void @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @count(i32* %5, i32* %6, i32 10, i32 1000000000)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}