#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__ GET_GPSET_ADDR(int);
int GPIO_SET_GPSET(int pin) {
  volatile unsigned long *point = 0;
  int bit_num = 0;
  if (pin > 53 || pin < 0) {
    return -1;
  }
  bit_num = pin % 32;
  point = (unsigned long *)GET_GPSET_ADDR(pin);
  if (point == 0) {
    return -1;
  }
  *point |= (1 << bit_num);
}


x86 assembly (clang, -O0):
<GPIO_SET_GPSET>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x35,-0x8(%rbp)
jg     113e <GPIO_SET_GPSET+0x2e>
cmpl   $0x0,-0x8(%rbp)
jge    114a <GPIO_SET_GPSET+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1195 <GPIO_SET_GPSET+0x85>
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <GET_GPSET_ADDR@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <GPIO_SET_GPSET+0x6b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1195 <GPIO_SET_GPSET+0x85>
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_SET_GPSET>:
push   %rbx
cmp    $0x35,%edi
ja     1131 <GPIO_SET_GPSET+0x21>
mov    %edi,%ebx
call   1030 <GET_GPSET_ADDR@plt>
test   %rax,%rax
je     1131 <GPIO_SET_GPSET+0x21>
mov    $0x1,%edx
mov    %ebx,%ecx
shl    %cl,%edx
movslq %edx,%rcx
or     %rcx,(%rax)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @GPIO_SET_GPSET(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* null, i64** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 53
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8, %1
store i32 -1, i32* %2
br label %28
12: ; preds = %8
%13 = load i32, i32* %3
%14 = srem i32 %13, 32
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = call i64 @GET_GPSET_ADDR(i32 %15)
%17 = inttoptr i64 %16 to i64*
store i64* %17, i64** %4
%18 = load i64*, i64** %4
%19 = icmp eq i64* %18, null
br i1 %19, label %20, label %21
20: ; preds = %12
store i32 -1, i32* %2
br label %28
21: ; preds = %12
%22 = load i32, i32* %5
%23 = shl i32 1, %22
%24 = sext i32 %23 to i64
%25 = load i64*, i64** %4
%26 = load volatile i64, i64* %25
%27 = or i64 %26, %24
store volatile i64 %27, i64* %25
br label %28
28: ; preds = %21, %20, %11
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @GPIO_SET_GPSET(i32 %0) {
%2 = icmp ugt i32 %0, 53
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call i64 @GET_GPSET_ADDR(i32 %0)
%5 = inttoptr i64 %4 to i64*
%6 = icmp eq i64 %4, 0
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = and i32 %0, 31
%9 = shl nuw i32 1, %8
%10 = sext i32 %9 to i64
%11 = load volatile i64, i64* %5
%12 = or i64 %11, %10
store volatile i64 %12, i64* %5
br label %13
13: ; preds = %3, %1, %7
ret i32 -1
}