#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
int /*<<< orphan*/ stderr;
main(int argc, char **argv) {
  unsigned int n, m, i;
  if (argc == 1) {
    fprintf(stderr, "usage: gf_xor n1 n2 ...\n");
    exit(1);
  }
  m = 0;
  for (i = 1; i < argc; i++) {
    sscanf(argv[i], "%u", &n);
    m = m ^ n;
  }
  printf("%u\n", m);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    117f <main+0x3f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    11cb <main+0x8b>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
lea    0xe6e(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x18(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    118d <main+0x4d>
mov    -0x18(%rbp),%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
je     11ac <main+0x6c>
cmp    $0x1,%ebx
jne    1175 <main+0x35>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    %rsi,%r14
mov    %ebx,%r13d
xor    %ebx,%ebx
mov    $0x1,%ebp
lea    0xe90(%rip),%r15
lea    0x4(%rsp),%r12
xchg   %ax,%ax
mov    (%r14,%rbp,8),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <sscanf@plt>
xor    0x4(%rsp),%ebx
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1190 <main+0x50>
lea    0xe69(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"usage: gf_xor n1 n2 ...\0A\00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [4 x i8] c"%u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
store i32 0, i32* %7
store i32 1, i32* %8
br label %16
16: ; preds = %30, %15
%17 = load i32, i32* %8
%18 = load i32, i32* %4
%19 = icmp ult i32 %17, %18
br i1 %19, label %20, label %33
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i32, i32* %8
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 @sscanf(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%27 = load i32, i32* %7
%28 = load i32, i32* %6
%29 = xor i32 %27, %28
store i32 %29, i32* %7
br label %30
30: ; preds = %20
%31 = load i32, i32* %8
%32 = add i32 %31, 1
store i32 %32, i32* %8
br label %16
33: ; preds = %16
%34 = load i32, i32* %7
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %34)
%36 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"usage: gf_xor n1 n2 ...\0A\00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [4 x i8] c"%u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
switch i32 %0, label %5 [
i32 1, label %7
i32 0, label %21
]
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5, %11
%12 = phi i64 [ 1, %5 ], [ %19, %11 ]
%13 = phi i32 [ 0, %5 ], [ %18, %11 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %12
%15 = load i8*, i8** %14
%16 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = xor i32 %17, %13
%19 = add nuw nsw i64 %12, 1
%20 = icmp eq i64 %19, %6
br i1 %20, label %21, label %11
21: ; preds = %11, %2
%22 = phi i32 [ %0, %2 ], [ %18, %11 ]
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = call i32 @exit(i32 0)
unreachable
}