#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*/ array1;
typedef int /*<<< orphan*/ array0;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ find_two_repeating_numbers_in_array(int *, int, int, int *,
                                                       int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int array0[] = {4, 2, 4, 5, 2, 3, 1};
  int len0 = sizeof(array0) / sizeof(int);
  int num0 = 5;
  int exp_num01 = 2, exp_num02 = 4;
  int act_num01, act_num02;
  find_two_repeating_numbers_in_array(array0, len0, num0, &act_num01,
                                      &act_num02);
  printf("num1 = %d, num2 = %d\n", act_num01, act_num02);
  assert((exp_num01 == act_num01) && (exp_num02 == act_num02));
  int array1[] = {2, 1, 2, 1};
  int len1 = sizeof(array1) / sizeof(int);
  int num1 = 2;
  int exp_num11 = 1, exp_num12 = 2;
  int act_num11, act_num12;
  find_two_repeating_numbers_in_array(array1, len1, num1, &act_num11,
                                      &act_num12);
  assert((exp_num11 == act_num11) && (exp_num12 == act_num12));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
movl   $0x5,-0x28(%rbp)
movl   $0x2,-0x2c(%rbp)
movl   $0x4,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
call   1040 <find_two_repeating_numbers_in_array@plt>
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x34(%rbp),%ecx
mov    %al,-0x69(%rbp)
jne    11cb <main+0x9b>
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
sete   %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0xe61(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe5e(%rip),%rax
mov    %rax,-0x48(%rbp)
movl   $0x4,-0x54(%rbp)
movl   $0x2,-0x58(%rbp)
movl   $0x1,-0x5c(%rbp)
movl   $0x2,-0x60(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
lea    -0x64(%rbp),%rcx
lea    -0x68(%rbp),%r8
call   1040 <find_two_repeating_numbers_in_array@plt>
mov    -0x5c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x64(%rbp),%ecx
mov    %al,-0x6a(%rbp)
jne    123e <main+0x10e>
mov    -0x60(%rbp),%eax
cmp    -0x68(%rbp),%eax
sete   %al
mov    %al,-0x6a(%rbp)
mov    -0x6a(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xed1(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
mov    $0x7,%esi
mov    $0x5,%edx
call   1040 <find_two_repeating_numbers_in_array@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
xor    $0x2,%eax
mov    (%rsp),%ecx
xor    $0x4,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1050 <assert@plt>
movaps 0xea4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x4,%esi
mov    $0x2,%edx
call   1040 <find_two_repeating_numbers_in_array@plt>
mov    0xc(%rsp),%eax
xor    $0x1,%eax
mov    0x8(%rsp),%ecx
xor    $0x2,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.array0 = [7 x i32] [i32 4, i32 2, i32 4, i32 5, i32 2, i32 3, i32 1]
@.str = [22 x i8] c"num1 = %d, num2 = %d\0A\00"
@__const.main.array1 = [4 x i32] [i32 2, i32 1, i32 2, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %1
%16 = bitcast [7 x i32]* %2 to i8*
store i32 7, i32* %3
store i32 5, i32* %4
store i32 2, i32* %5
store i32 4, i32* %6
%17 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @find_two_repeating_numbers_in_array(i32* %17, i32 %18, i32 %19, i32* %7, i32* %8)
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22)
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %31
27: ; preds = %0
%28 = load i32, i32* %6
%29 = load i32, i32* %8
%30 = icmp eq i32 %28, %29
br label %31
31: ; preds = %27, %0
%32 = phi i1 [ false, %0 ], [ %30, %27 ]
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = bitcast [4 x i32]* %9 to i8*
store i32 4, i32* %10
store i32 2, i32* %11
store i32 1, i32* %12
store i32 2, i32* %13
%36 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%37 = load i32, i32* %10
%38 = load i32, i32* %11
%39 = call i32 @find_two_repeating_numbers_in_array(i32* %36, i32 %37, i32 %38, i32* %14, i32* %15)
%40 = load i32, i32* %12
%41 = load i32, i32* %14
%42 = icmp eq i32 %40, %41
br i1 %42, label %43, label %47
43: ; preds = %31
%44 = load i32, i32* %13
%45 = load i32, i32* %15
%46 = icmp eq i32 %44, %45
br label %47
47: ; preds = %43, %31
%48 = phi i1 [ false, %31 ], [ %46, %43 ]
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array0 = [7 x i32] [i32 4, i32 2, i32 4, i32 5, i32 2, i32 3, i32 1]
@.str = [22 x i8] c"num1 = %d, num2 = %d\0A\00"
@__const.main.array1 = [4 x i32] [i32 2, i32 1, i32 2, i32 1]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = bitcast [7 x i32]* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%11 = call i32 @find_two_repeating_numbers_in_array(i32* %10, i32 7, i32 5, i32* %2, i32* %3)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 2
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 4
%19 = select i1 %16, i1 %18, i1 false
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = bitcast [4 x i32]* %4 to i8*
%23 = bitcast i32* %5 to i8*
%24 = bitcast i32* %6 to i8*
%25 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%26 = call i32 @find_two_repeating_numbers_in_array(i32* %25, i32 4, i32 2, i32* %5, i32* %6)
%27 = load i32, i32* %5
%28 = icmp eq i32 %27, 1
%29 = load i32, i32* %6
%30 = icmp eq i32 %29, 2
%31 = select i1 %28, i1 %30, i1 false
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
ret i32 0
}