#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 *, unsigned int, int /*<<< orphan*/);
int test_unsignedint() {
  int i;
  unsigned int reds[3] = {4096 * (4096 - 1) / 2, 4096 * (4096 - 1) / 2};
#pragma acc parallel loop
  for (i = 0; i < 4096; i++) {
    unsigned int v;
    v = (unsigned int)i;
#pragma acc atomic
    reds[0] -= v;
#pragma acc atomic
    reds[1] = reds[1] - v;
  }
  for (i = 0; i < 2; i++) {
    if (reds[i] != 0) {
      printf("%d, %d\n", reds[i], 0);
      return i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_unsignedint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jge    1168 <test_unsignedint+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <test_unsignedint+0x23>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11bf <test_unsignedint+0xaf>
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0x14(%rbp,%rax,4)
je     11ac <test_unsignedint+0x9c>
movslq -0x8(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%esi
lea    0xe75(%rip),%rdi
xor    %edx,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11c6 <test_unsignedint+0xb6>
jmp    11b1 <test_unsignedint+0xa1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116f <test_unsignedint+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_unsignedint>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @test_unsignedint() {
ret i32 0
}