#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 min(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sub(int *, int *, int *, int);
int main(void) {
  int arr1[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 3};
  int arr2[10] = {23, 5, 6, 2, 86, 23, 23, 5, 1, 4};
  int res[10];
  sub(arr1, arr2, res, 10);
  puts("Arr1");
  for (int i = 0; i < 10; i++)
    printf("%d ", arr1[i]);
  puts("\nArr2");
  for (int i = 0; i < 10; i++)
    printf("%d ", arr2[i]);
  puts("\nDiff");
  for (int i = 0; i < 10; i++)
    printf("%d ", res[i]);
  printf("\nMin diff: %d\n", min(res, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xeae(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x90(%rbp),%rdx
mov    $0xa,%ecx
call   1070 <sub@plt>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0xa,-0x94(%rbp)
jge    11f3 <main+0xa3>
movslq -0x94(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11bb <main+0x6b>
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x98(%rbp)
cmpl   $0xa,-0x98(%rbp)
jge    1241 <main+0xf1>
movslq -0x98(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1209 <main+0xb9>
lea    0xe1f(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x9c(%rbp)
cmpl   $0xa,-0x9c(%rbp)
jge    1292 <main+0x142>
movslq -0x9c(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%esi
lea    0xde4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1257 <main+0x107>
lea    -0x90(%rbp),%rdi
mov    $0xa,%esi
call   1050 <min@plt>
mov    %eax,%esi
lea    0xdc1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    0xecf(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
lea    0x60(%rsp),%r14
mov    %r14,%rdx
mov    $0xa,%ecx
call   1060 <sub@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    0x30(%rsp),%esi
lea    0xe9b(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x3c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x40(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x44(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x48(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x50(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x54(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xe24(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xda7(%rip),%rdi
call   1030 <puts@plt>
mov    0x60(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x64(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x68(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x6c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x70(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x74(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x78(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x7c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x80(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x84(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0xa,%esi
call   1050 <min@plt>
lea    0xd16(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.arr1 = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 3]
@__const.main.arr2 = [10 x i32] [i32 23, i32 5, i32 6, i32 2, i32 86, i32 23, i32 23, i32 5, i32 1, i32 4]
@.str = [5 x i8] c"Arr1\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [6 x i8] c"\0AArr2\00"
@.str.3 = [6 x i8] c"\0ADiff\00"
@.str.4 = [15 x i8] c"\0AMin diff: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = alloca [10 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [10 x i32]* %2 to i8*
%9 = bitcast [10 x i32]* %3 to i8*
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%13 = call i32 @sub(i32* %10, i32* %11, i32* %12, i32 10)
%14 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %15
15: ; preds = %24, %0
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %18
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %15
27: ; preds = %15
%28 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %29
29: ; preds = %38, %27
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 10
br i1 %31, label %32, label %41
32: ; preds = %29
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %32
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %29
41: ; preds = %29
%42 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %7
br label %43
43: ; preds = %52, %41
%44 = load i32, i32* %7
%45 = icmp slt i32 %44, 10
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = load i32, i32* %7
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %46
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 1
store i32 %54, i32* %7
br label %43
55: ; preds = %43
%56 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%57 = call i32 @min(i32* %56, i32 10)
%58 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %57)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr1 = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 3]
@__const.main.arr2 = [10 x i32] [i32 23, i32 5, i32 6, i32 2, i32 86, i32 23, i32 23, i32 5, i32 1, i32 4]
@.str = [5 x i8] c"Arr1\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [6 x i8] c"\0AArr2\00"
@.str.3 = [6 x i8] c"\0ADiff\00"
@.str.4 = [15 x i8] c"\0AMin diff: %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast [10 x i32]* %3 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%10 = call i32 @sub(i32* %7, i32* %8, i32* %9, i32 10)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%30 = load i32, i32* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %39)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%42 = load i32, i32* %8
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%45 = load i32, i32* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%48 = load i32, i32* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%51 = load i32, i32* %50
%52 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %51)
%53 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%54 = load i32, i32* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%57 = load i32, i32* %56
%58 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%60 = load i32, i32* %59
%61 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %60)
%62 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%63 = load i32, i32* %62
%64 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %63)
%65 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%66 = load i32, i32* %65
%67 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %66)
%68 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%69 = load i32, i32* %68
%70 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %69)
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%72 = load i32, i32* %9
%73 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %72)
%74 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%75 = load i32, i32* %74
%76 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %75)
%77 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
%78 = load i32, i32* %77
%79 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %78)
%80 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%81 = load i32, i32* %80
%82 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %81)
%83 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%84 = load i32, i32* %83
%85 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %84)
%86 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
%87 = load i32, i32* %86
%88 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %87)
%89 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 6
%90 = load i32, i32* %89
%91 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %90)
%92 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 7
%93 = load i32, i32* %92
%94 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %93)
%95 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 8
%96 = load i32, i32* %95
%97 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %96)
%98 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
%99 = load i32, i32* %98
%100 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %99)
%101 = call i32 @min(i32* %9, i32 10)
%102 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %101)
ret i32 0
}