#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*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int main() {
  int c;
  int i;
  int j;
  int v1[] = {2, 3, 4};
  int v2[] = {5, 10};
  int v3[5];
  c = 0;
  j = 0;
  for (i = 0; i < 5; i++) {
    if (v1[c] > v2[j] || c > 2) {
      v3[i] = v2[j];
      j = j + 1;
    } else {
      v3[i] = v1[c];
      c = c + 1;
    }
  }
  for (i = 0; i < 5; i++) {
    printf("Il risultato e':  %d \n", v3[i]);
  }
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x24(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11d7 <main+0xb7>
movslq -0x8(%rbp),%rax
mov    -0x1c(%rbp,%rax,4),%eax
movslq -0x10(%rbp),%rcx
cmp    -0x24(%rbp,%rcx,4),%eax
jg     118d <main+0x6d>
cmpl   $0x2,-0x8(%rbp)
jle    11ab <main+0x8b>
movslq -0x10(%rbp),%rax
mov    -0x24(%rbp,%rax,4),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11c4 <main+0xa4>
movslq -0x8(%rbp),%rax
mov    -0x1c(%rbp,%rax,4),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c9 <main+0xa9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1163 <main+0x43>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    120a <main+0xea>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xe1d(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11de <main+0xbe>
lea    0xe1a(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"Il risultato e': %d \0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 10)
%6 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}