#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 *, ...);
void print(int A[], int m, int B[], int n, int small, int large) {
  int i;
  printf("A = {");
  for (i = 0; i < m; i++) {
    printf("%d ", A[i]);
  }
  printf("}, B = {");
  for (i = 0; i < n; i++) {
    printf("%d ", B[i]);
  }
  printf("}\nsmall: %d, large: %d\n", small, large);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <print+0x66>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1143 <print+0x33>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11be <print+0xae>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    118b <print+0x7b>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,0x4(%rsp)
mov    %r8d,(%rsp)
mov    %ecx,%r12d
mov    %rdx,%r13
mov    %esi,%ebx
mov    %rdi,%rbp
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
jle    1168 <print+0x58>
mov    %ebx,%r14d
lea    0xebb(%rip),%rbx
xor    %r15d,%r15d
xchg   %ax,%ax
mov    0x0(%rbp,%r15,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r14
jne    1150 <print+0x40>
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r12d,%r12d
jle    11a8 <print+0x98>
mov    %r12d,%ebp
lea    0xe81(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1190 <print+0x80>
lea    0xe64(%rip),%rdi
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"A = {\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [9 x i8] c"}, B = {\00"
@.str.3 = [24 x i8] c"}\0Asmall: %d, large: %d\0A\00"
define void @print(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %13
br label %15
15: ; preds = %26, %6
%16 = load i32, i32* %13
%17 = load i32, i32* %8
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %29
19: ; preds = %15
%20 = load i32*, i32** %7
%21 = load i32, i32* %13
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %19
%27 = load i32, i32* %13
%28 = add nsw i32 %27, 1
store i32 %28, i32* %13
br label %15
29: ; preds = %15
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %13
br label %31
31: ; preds = %42, %29
%32 = load i32, i32* %13
%33 = load i32, i32* %10
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %45
35: ; preds = %31
%36 = load i32*, i32** %9
%37 = load i32, i32* %13
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %35
%43 = load i32, i32* %13
%44 = add nsw i32 %43, 1
store i32 %44, i32* %13
br label %31
45: ; preds = %31
%46 = load i32, i32* %11
%47 = load i32, i32* %12
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %46, i32 %47)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"A = {\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [9 x i8] c"}, B = {\00"
@.str.3 = [24 x i8] c"}\0Asmall: %d, large: %d\0A\00"
define void @print(i32* nocapture %0, i32 %1, i32* nocapture %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp sgt i32 %1, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = zext i32 %1 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %16, %11 ]
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = add nuw nsw i64 %12, 1
%17 = icmp eq i64 %16, %10
br i1 %17, label %18, label %11
18: ; preds = %11, %6
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp sgt i32 %3, 0
br i1 %20, label %21, label %30
21: ; preds = %18
%22 = zext i32 %3 to i64
br label %23
23: ; preds = %21, %23
%24 = phi i64 [ 0, %21 ], [ %28, %23 ]
%25 = getelementptr inbounds i32, i32* %2, i64 %24
%26 = load i32, i32* %25
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = add nuw nsw i64 %24, 1
%29 = icmp eq i64 %28, %22
br i1 %29, label %30, label %23
30: ; preds = %23, %18
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %4, i32 %5)
ret void
}