#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 */
scalar_t__ atoi(char *);
int has_dup_channel(int argc, char *argv[]) {
  int i, j;
  for (i = 0; i < (argc - 1); i++) {
    for (j = i + 1; j < argc; j++) {
      if (atoi(argv[i]) == atoi(argv[j])) {
        return 0;
      }
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<has_dup_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11b4 <has_dup_channel+0xa4>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a1 <has_dup_channel+0x91>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atoi@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atoi@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jne    118e <has_dup_channel+0x7e>
movl   $0x0,-0x4(%rbp)
jmp    11bb <has_dup_channel+0xab>
jmp    1193 <has_dup_channel+0x83>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1140 <has_dup_channel+0x30>
jmp    11a6 <has_dup_channel+0x96>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <has_dup_channel+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_dup_channel>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x1,%eax
cmp    $0x2,%edi
jl     11ab <has_dup_channel+0x9b>
mov    %edi,%r13d
mov    %edi,%ebp
add    $0xffffffff,%r13d
xor    %r14d,%r14d
mov    %rbp,0x10(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rsi,%r15
jmp    115d <has_dup_channel+0x4d>
nopw   0x0(%rax,%rax,1)
add    $0x8,%r15
add    $0xffffffffffffffff,%rbp
cmp    %r13,%r14
je     11ba <has_dup_channel+0xaa>
mov    %r14,%rax
add    $0x1,%r14
cmp    0x10(%rsp),%r14
jae    1150 <has_dup_channel+0x40>
mov    0x8(%rsp),%rcx
mov    (%rcx,%rax,8),%rdi
call   1030 <atoi@plt>
mov    %rax,%rbx
mov    $0x1,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%r12,8),%rdi
call   1030 <atoi@plt>
cmp    %rax,%rbx
je     11a9 <has_dup_channel+0x99>
add    $0x1,%r12
cmp    %r12,%rbp
jne    1190 <has_dup_channel+0x80>
jmp    1150 <has_dup_channel+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%eax
jmp    11ab <has_dup_channel+0x9b>

LLVM IR (-O0):
define i32 @has_dup_channel(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %40, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %43
13: ; preds = %8
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %7
br label %16
16: ; preds = %36, %13
%17 = load i32, i32* %7
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %39
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i64 @atoi(i8* %25)
%27 = load i8**, i8*** %5
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = call i64 @atoi(i8* %31)
%33 = icmp eq i64 %26, %32
br i1 %33, label %34, label %35
34: ; preds = %20
store i32 0, i32* %3
br label %44
35: ; preds = %20
br label %36
36: ; preds = %35
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
br label %16
39: ; preds = %16
br label %40
40: ; preds = %39
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %8
43: ; preds = %8
store i32 1, i32* %3
br label %44
44: ; preds = %43, %34
%45 = load i32, i32* %3
ret i32 %45
}

LLVM IR (-O2):
define i32 @has_dup_channel(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %30
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = zext i32 %0 to i64
%7 = zext i32 %5 to i64
%8 = zext i32 %0 to i64
br label %12
9: ; preds = %21, %12
%10 = add nuw nsw i64 %14, 1
%11 = icmp eq i64 %15, %7
br i1 %11, label %30, label %12
12: ; preds = %4, %9
%13 = phi i64 [ 0, %4 ], [ %15, %9 ]
%14 = phi i64 [ 1, %4 ], [ %10, %9 ]
%15 = add nuw nsw i64 %13, 1
%16 = icmp ult i64 %15, %6
br i1 %16, label %17, label %9
17: ; preds = %12
%18 = getelementptr inbounds i8*, i8** %1, i64 %13
%19 = load i8*, i8** %18
%20 = tail call i64 @atoi(i8* %19)
br label %23
21: ; preds = %23
%22 = icmp eq i64 %29, %8
br i1 %22, label %9, label %23
23: ; preds = %17, %21
%24 = phi i64 [ %14, %17 ], [ %29, %21 ]
%25 = getelementptr inbounds i8*, i8** %1, i64 %24
%26 = load i8*, i8** %25
%27 = tail call i64 @atoi(i8* %26)
%28 = icmp eq i64 %20, %27
%29 = add nuw nsw i64 %24, 1
br i1 %28, label %30, label %21
30: ; preds = %9, %23, %2
%31 = phi i32 [ 1, %2 ], [ 0, %23 ], [ 1, %9 ]
ret i32 %31
}