#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*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int limit = 2 * 10;
  int a_array[10];
  int b_array[10];
  int j = 0;
  int k = 0;
  int n = 0;
  printf("Unesite velicinu individualnih nizova: ");
  scanf("%d", &n);
  if (n <= 0 || n > 10) {
    perror("N out of range.");
    exit(1);
  }
  for (int i = 0; i < n * 2; i++) {
    printf("Unesite %d. element : ", i + 1);
    if ((i % 2) == 0) {
      scanf("%d", &a_array[j++]);
    } else {
      scanf("%d", &b_array[k++]);
    }
  }
  printf("\nNiz A: ");
  for (int i = 0; i < n; i++) {
    printf("\n%d. Element: %d\n", i, a_array[i]);
  }
  printf("\nNiz B: ");
  for (int i = 0; i < n; i++) {
    printf("\n%d. Element: %d\n", i, b_array[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
lea    -0x6c(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x6c(%rbp)
jle    11a0 <main+0x60>
cmpl   $0xa,-0x6c(%rbp)
jle    11b6 <main+0x76>
lea    0xe84(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
mov    -0x6c(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1256 <main+0x116>
mov    -0x70(%rbp),%esi
add    $0x1,%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x70(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    121f <main+0xdf>
mov    -0x64(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x64(%rbp)
cltq
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe13(%rip),%rdi
call   1040 <scanf@plt>
jmp    1243 <main+0x103>
mov    -0x68(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x68(%rbp)
cltq
lea    -0x60(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdea(%rip),%rdi
call   1040 <scanf@plt>
jmp    1248 <main+0x108>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    11bd <main+0x7d>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jge    129e <main+0x15e>
mov    -0x74(%rbp),%esi
movslq -0x74(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    126b <main+0x12b>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jge    12e6 <main+0x1a6>
mov    -0x78(%rbp),%esi
movslq -0x78(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edx
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    12b3 <main+0x173>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
movl   $0x0,0xc(%rsp)
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xfffffff5,%eax
cmp    $0xfffffff6,%eax
jb     127f <main+0x13f>
lea    0xeaf(%rip),%r14
lea    0xe95(%rip),%r13
xor    %ebp,%ebp
xor    %r15d,%r15d
xor    %ebx,%ebx
jmp    11c7 <main+0x87>
nopl   0x0(%rax)
mov    %r15d,%eax
lea    0x1(%r15),%edx
lea    0x10(%rsp),%rcx
mov    %edx,%r15d
cltq
lea    (%rcx,%rax,4),%rsi
mov    %r13,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
add    %eax,%eax
cmp    %eax,%ebp
jge    11ef <main+0xaf>
mov    %ebp,%r12d
lea    0x1(%r12),%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
test   $0x1,%r12b
jne    11a0 <main+0x60>
mov    %ebx,%eax
lea    0x1(%rbx),%edx
lea    0x40(%rsp),%rcx
mov    %edx,%ebx
jmp    11af <main+0x6f>
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    122e <main+0xee>
lea    0xe50(%rip),%rbx
xor    %ebp,%ebp
nopl   (%rax)
mov    0x40(%rsp,%rbp,4),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
cmp    %rax,%rbp
jl     1210 <main+0xd0>
lea    0xe38(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    126e <main+0x12e>
lea    0xe11(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x10(%rsp,%rbp,4),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
cmp    %rax,%rbp
jl     1250 <main+0x110>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xda5(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Unesite velicinu individualnih nizova: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"N out of range.\00"
@.str.3 = [23 x i8] c"Unesite %d. element : \00"
@.str.4 = [9 x i8] c"\0ANiz A: \00"
@.str.5 = [18 x i8] c"\0A%d. Element: %d\0A\00"
@.str.6 = [9 x i8] c"\0ANiz B: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = alloca [10 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%13 = load i32, i32* %7
%14 = icmp sle i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %0
%16 = load i32, i32* %7
%17 = icmp sgt i32 %16, 10
br i1 %17, label %18, label %21
18: ; preds = %15, %0
%19 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %15
store i32 0, i32* %8
br label %22
22: ; preds = %47, %21
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = mul nsw i32 %24, 2
%26 = icmp slt i32 %23, %25
br i1 %26, label %27, label %50
27: ; preds = %22
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %8
%32 = srem i32 %31, 2
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %27
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
%37 = sext i32 %35 to i64
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %37
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %38)
br label %46
40: ; preds = %27
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
%43 = sext i32 %41 to i64
%44 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %43
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %44)
br label %46
46: ; preds = %40, %34
br label %47
47: ; preds = %46
%48 = load i32, i32* %8
%49 = add nsw i32 %48, 1
store i32 %49, i32* %8
br label %22
50: ; preds = %22
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %9
br label %52
52: ; preds = %63, %50
%53 = load i32, i32* %9
%54 = load i32, i32* %7
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %66
56: ; preds = %52
%57 = load i32, i32* %9
%58 = load i32, i32* %9
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %57, i32 %61)
br label %63
63: ; preds = %56
%64 = load i32, i32* %9
%65 = add nsw i32 %64, 1
store i32 %65, i32* %9
br label %52
66: ; preds = %52
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %10
br label %68
68: ; preds = %79, %66
%69 = load i32, i32* %10
%70 = load i32, i32* %7
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %82
72: ; preds = %68
%73 = load i32, i32* %10
%74 = load i32, i32* %10
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %75
%77 = load i32, i32* %76
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %73, i32 %77)
br label %79
79: ; preds = %72
%80 = load i32, i32* %10
%81 = add nsw i32 %80, 1
store i32 %81, i32* %10
br label %68
82: ; preds = %68
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Unesite velicinu individualnih nizova: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"N out of range.\00"
@.str.3 = [23 x i8] c"Unesite %d. element : \00"
@.str.4 = [9 x i8] c"\0ANiz A: \00"
@.str.5 = [18 x i8] c"\0A%d. Element: %d\0A\00"
@.str.6 = [9 x i8] c"\0ANiz B: \00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = add i32 %9, -11
%11 = icmp ult i32 %10, -10
br i1 %11, label %12, label %19
12: ; preds = %0
%13 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %31
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%17 = load i32, i32* %3
%18 = icmp sgt i32 %17, 0
br i1 %18, label %46, label %42
19: ; preds = %0, %31
%20 = phi i32 [ %23, %31 ], [ 0, %0 ]
%21 = phi i32 [ %35, %31 ], [ 0, %0 ]
%22 = phi i32 [ %34, %31 ], [ 0, %0 ]
%23 = add nuw nsw i32 %20, 1
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = and i32 %20, 1
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %19
%28 = add nsw i32 %22, 1
br label %31
29: ; preds = %19
%30 = add nsw i32 %21, 1
br label %31
31: ; preds = %27, %29
%32 = phi i32 [ %22, %27 ], [ %21, %29 ]
%33 = phi [10 x i32]* [ %1, %27 ], [ %2, %29 ]
%34 = phi i32 [ %28, %27 ], [ %22, %29 ]
%35 = phi i32 [ %21, %27 ], [ %30, %29 ]
%36 = sext i32 %32 to i64
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %33, i64 0, i64 %36
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %37)
%39 = load i32, i32* %3
%40 = shl nsw i32 %39, 1
%41 = icmp slt i32 %23, %40
br i1 %41, label %19, label %15
42: ; preds = %46, %15
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%44 = load i32, i32* %3
%45 = icmp sgt i32 %44, 0
br i1 %45, label %57, label %56
46: ; preds = %15, %46
%47 = phi i64 [ %52, %46 ], [ 0, %15 ]
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = trunc i64 %47 to i32
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %50, i32 %49)
%52 = add nuw nsw i64 %47, 1
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = icmp slt i64 %52, %54
br i1 %55, label %46, label %42
56: ; preds = %57, %42
ret i32 0
57: ; preds = %42, %57
%58 = phi i64 [ %63, %57 ], [ 0, %42 ]
%59 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = trunc i64 %58 to i32
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %61, i32 %60)
%63 = add nuw nsw i64 %58, 1
%64 = load i32, i32* %3
%65 = sext i32 %64 to i64
%66 = icmp slt i64 %63, %65
br i1 %66, label %57, label %56
}