#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 */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_nanosleep(int /*<<< orphan*/, int /*<<< orphan*/,
                                   struct timespec *, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int _config_GC314FS(char *BASE1, int clock_source, int cardnumber) {
  int temp;
  struct timespec sleep;
  int version = 1;
  int value;
  sleep.tv_sec = 0;
  sleep.tv_nsec = 10000;
  *((unsigned int *)(BASE1 + 0x100)) &= 0xffffffef;
  *((unsigned int *)(BASE1 + 0x100)) &= 0xfffff8ff;
  *((unsigned int *)(BASE1 + 0x114)) = 3000;
  *((unsigned int *)(BASE1 + 0x100)) |= 0x00000040;
  *((unsigned int *)(BASE1 + 0x100)) |= 0x00000020;
  if ((cardnumber == -1 || -1 == -1))
    *((unsigned int *)(BASE1 + 0x100)) |= 0x00800000;
  else
    *((unsigned int *)(BASE1 + 0x100)) &= 0xff7fffff;
  if ((cardnumber == -1) || (-1 == -1))
    *((unsigned int *)(BASE1 + 0x100)) |= 0x01000000;
  else
    *((unsigned int *)(BASE1 + 0x100)) &= 0xfeffffff;
  value = 0x15;
  *((unsigned int *)(BASE1 + 0x130)) = value;
  temp = *((unsigned int *)(BASE1 + 0x130));
  if (value == temp) {
    version = 316;
    printf("This appears to be a GC316\n");
  } else {
    version = 314;
    printf("This appears to be a GC314\n");
  }
  printf("ADC Register Value 0x%x\n", temp);
  *((unsigned int *)(BASE1 + 0x100)) &= 0xfff7ffff;
  *((unsigned int *)(BASE1 + 0x200)) &= 0xffffffdf;
  *((unsigned int *)(BASE1 + 0x100)) |= 0x00000f00;
  *((unsigned int *)(BASE1 + 0x310)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x350)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x390)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x3d0)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x410)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x450)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x490)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x4d0)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x510)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x550)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x590)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x5d0)) = 0x000002a0;
  *((unsigned int *)(BASE1 + 0x100)) |= 0x00400000;
  if (clock_source == 0x10) {
    *((unsigned int *)(BASE1 + 0x100)) |= 0x00000004;
    sleep.tv_nsec = 20000000;
    clock_nanosleep(CLOCK_REALTIME, 0, &sleep, 0);
    *((unsigned int *)(BASE1 + 0x100)) &= 0xfffffff7;
  } else if (clock_source == 0x20) {
    *((unsigned int *)(BASE1 + 0x100)) &= 0xfffffffb;
    sleep.tv_nsec = 20000000;
    clock_nanosleep(CLOCK_REALTIME, 0, &sleep, 0);
    *((unsigned int *)(BASE1 + 0x100)) |= 0x00000008;
  } else {
    fprintf(stderr, "	Clock source not properly defined");
    return -1;
  }
  *((unsigned int *)(BASE1 + 0x100)) &= 0xfffff8ff;
  return version;
}


x86 assembly (clang, -O0):
<_config_GC314FS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x1,-0x34(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x2710,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,0x100(%rax)
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
and    $0xfffff8ff,%ecx
mov    %ecx,0x100(%rax)
mov    -0x10(%rbp),%rax
movl   $0xbb8,0x114(%rax)
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
or     $0x40,%ecx
mov    %ecx,0x100(%rax)
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
or     $0x20,%ecx
mov    %ecx,0x100(%rax)
cmpl   $0xffffffff,-0x18(%rbp)
je     11ce <_config_GC314FS+0x9e>
mov    $0x1,%al
test   $0x1,%al
jne    11ce <_config_GC314FS+0x9e>
jmp    11e9 <_config_GC314FS+0xb9>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
or     $0x800000,%ecx
mov    %ecx,0x100(%rax)
jmp    11ff <_config_GC314FS+0xcf>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
and    $0xff7fffff,%ecx
mov    %ecx,0x100(%rax)
cmpl   $0xffffffff,-0x18(%rbp)
je     1218 <_config_GC314FS+0xe8>
mov    $0x1,%al
test   $0x1,%al
jne    1218 <_config_GC314FS+0xe8>
jmp    1233 <_config_GC314FS+0x103>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
or     $0x1000000,%ecx
mov    %ecx,0x100(%rax)
jmp    1249 <_config_GC314FS+0x119>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
and    $0xfeffffff,%ecx
mov    %ecx,0x100(%rax)
movl   $0x15,-0x38(%rbp)
mov    -0x38(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x130(%rax)
mov    -0x10(%rbp),%rax
mov    0x130(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1290 <_config_GC314FS+0x160>
movl   $0x13c,-0x34(%rbp)
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a5 <_config_GC314FS+0x175>
movl   $0x13a,-0x34(%rbp)
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
and    $0xfff7ffff,%ecx
mov    %ecx,0x100(%rax)
mov    -0x10(%rbp),%rax
mov    0x200(%rax),%ecx
and    $0xffffffdf,%ecx
mov    %ecx,0x200(%rax)
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
or     $0xf00,%ecx
mov    %ecx,0x100(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x310(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x350(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x390(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x3d0(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x410(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x450(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x490(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x4d0(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x510(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x550(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x590(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2a0,0x5d0(%rax)
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
or     $0x400000,%ecx
mov    %ecx,0x100(%rax)
cmpl   $0x10,-0x14(%rbp)
jne    1405 <_config_GC314FS+0x2d5>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
or     $0x4,%ecx
mov    %ecx,0x100(%rax)
movl   $0x1312d00,-0x30(%rbp)
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
lea    -0x30(%rbp),%rdx
mov    %ecx,%esi
call   1050 <clock_nanosleep@plt>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
and    $0xfffffff7,%ecx
mov    %ecx,0x100(%rax)
jmp    147d <_config_GC314FS+0x34d>
cmpl   $0x20,-0x14(%rbp)
jne    1457 <_config_GC314FS+0x327>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,0x100(%rax)
movl   $0x1312d00,-0x30(%rbp)
mov    0x2ba8(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
lea    -0x30(%rbp),%rdx
mov    %ecx,%esi
call   1050 <clock_nanosleep@plt>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
or     $0x8,%ecx
mov    %ecx,0x100(%rax)
jmp    1478 <_config_GC314FS+0x348>
mov    0x2b82(%rip),%rax
mov    (%rax),%edi
lea    0xbea(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1499 <_config_GC314FS+0x369>
jmp    147d <_config_GC314FS+0x34d>
mov    -0x10(%rbp),%rax
mov    0x100(%rax),%ecx
and    $0xfffff8ff,%ecx
mov    %ecx,0x100(%rax)
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_config_GC314FS>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
movq   $0x0,0x10(%rsp)
movl   $0x2710,0x8(%rsp)
mov    $0xfe7ff88f,%eax
and    0x100(%rdi),%eax
movl   $0xbb8,0x114(%rdi)
or     $0x1800060,%eax
mov    %eax,0x100(%rdi)
movl   $0x15,0x130(%rdi)
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
lea    0xe67(%rip),%rdi
mov    $0x15,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfff7ffff,%eax
and    0x100(%rbx),%eax
andb   $0xdf,0x200(%rbx)
movl   $0x2a0,0x310(%rbx)
movl   $0x2a0,0x350(%rbx)
movl   $0x2a0,0x390(%rbx)
movl   $0x2a0,0x3d0(%rbx)
movl   $0x2a0,0x410(%rbx)
movl   $0x2a0,0x450(%rbx)
movl   $0x2a0,0x490(%rbx)
movl   $0x2a0,0x4d0(%rbx)
movl   $0x2a0,0x510(%rbx)
movl   $0x2a0,0x550(%rbx)
movl   $0x2a0,0x590(%rbx)
movl   $0x2a0,0x5d0(%rbx)
mov    %eax,%ecx
or     $0x400f00,%ecx
mov    %ecx,0x100(%rbx)
cmp    $0x20,%ebp
je     127c <_config_GC314FS+0x13c>
cmp    $0x10,%ebp
jne    12c2 <_config_GC314FS+0x182>
or     $0x400f04,%eax
mov    %eax,0x100(%rbx)
movl   $0x1312d00,0x8(%rsp)
01
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rdx
xor    %esi,%esi
xor    %ecx,%ecx
call   1060 <clock_nanosleep@plt>
mov    0x100(%rbx),%eax
and    $0xfffffff7,%eax
jmp    12b0 <_config_GC314FS+0x170>
and    $0xfff7fffb,%ecx
mov    %ecx,0x100(%rbx)
movl   $0x1312d00,0x8(%rsp)
01
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rdx
xor    %esi,%esi
xor    %ecx,%ecx
call   1060 <clock_nanosleep@plt>
mov    0x100(%rbx),%eax
or     $0x8,%eax
and    $0xfffff8ff,%eax
mov    %eax,0x100(%rbx)
mov    $0x13c,%eax
jmp    12dc <_config_GC314FS+0x19c>
mov    0x2d17(%rip),%rax
mov    (%rax),%edi
lea    0xd47(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@.str = [28 x i8] c"This appears to be a GC316\0A\00"
@.str.1 = [28 x i8] c"This appears to be a GC314\0A\00"
@.str.2 = [25 x i8] c"ADC Register Value 0x%x\0A\00"
@CLOCK_REALTIME = global i32 0
@stderr = global i32 0
@.str.3 = [35 x i8] c"\09Clock source not properly defined\00"
define i32 @_config_GC314FS(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.timespec
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 1, i32* %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 1
store i64 0, i64* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
store i32 10000, i32* %13
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 256
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = and i32 %17, -17
store i32 %18, i32* %16
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 256
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %21
%23 = and i32 %22, -1793
store i32 %23, i32* %21
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 276
%26 = bitcast i8* %25 to i32*
store i32 3000, i32* %26
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 256
%29 = bitcast i8* %28 to i32*
%30 = load i32, i32* %29
%31 = or i32 %30, 64
store i32 %31, i32* %29
%32 = load i8*, i8** %5
%33 = getelementptr inbounds i8, i8* %32, i64 256
%34 = bitcast i8* %33 to i32*
%35 = load i32, i32* %34
%36 = or i32 %35, 32
store i32 %36, i32* %34
%37 = load i32, i32* %7
%38 = icmp eq i32 %37, -1
br i1 %38, label %40, label %39
39: ; preds = %3
br i1 true, label %40, label %46
40: ; preds = %39, %3
%41 = load i8*, i8** %5
%42 = getelementptr inbounds i8, i8* %41, i64 256
%43 = bitcast i8* %42 to i32*
%44 = load i32, i32* %43
%45 = or i32 %44, 8388608
store i32 %45, i32* %43
br label %52
46: ; preds = %39
%47 = load i8*, i8** %5
%48 = getelementptr inbounds i8, i8* %47, i64 256
%49 = bitcast i8* %48 to i32*
%50 = load i32, i32* %49
%51 = and i32 %50, -8388609
store i32 %51, i32* %49
br label %52
52: ; preds = %46, %40
%53 = load i32, i32* %7
%54 = icmp eq i32 %53, -1
br i1 %54, label %56, label %55
55: ; preds = %52
br i1 true, label %56, label %62
56: ; preds = %55, %52
%57 = load i8*, i8** %5
%58 = getelementptr inbounds i8, i8* %57, i64 256
%59 = bitcast i8* %58 to i32*
%60 = load i32, i32* %59
%61 = or i32 %60, 16777216
store i32 %61, i32* %59
br label %68
62: ; preds = %55
%63 = load i8*, i8** %5
%64 = getelementptr inbounds i8, i8* %63, i64 256
%65 = bitcast i8* %64 to i32*
%66 = load i32, i32* %65
%67 = and i32 %66, -16777217
store i32 %67, i32* %65
br label %68
68: ; preds = %62, %56
store i32 21, i32* %11
%69 = load i32, i32* %11
%70 = load i8*, i8** %5
%71 = getelementptr inbounds i8, i8* %70, i64 304
%72 = bitcast i8* %71 to i32*
store i32 %69, i32* %72
%73 = load i8*, i8** %5
%74 = getelementptr inbounds i8, i8* %73, i64 304
%75 = bitcast i8* %74 to i32*
%76 = load i32, i32* %75
store i32 %76, i32* %8
%77 = load i32, i32* %11
%78 = load i32, i32* %8
%79 = icmp eq i32 %77, %78
br i1 %79, label %80, label %82
80: ; preds = %68
store i32 316, i32* %10
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %84
82: ; preds = %68
store i32 314, i32* %10
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %84
84: ; preds = %82, %80
%85 = load i32, i32* %8
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %85)
%87 = load i8*, i8** %5
%88 = getelementptr inbounds i8, i8* %87, i64 256
%89 = bitcast i8* %88 to i32*
%90 = load i32, i32* %89
%91 = and i32 %90, -524289
store i32 %91, i32* %89
%92 = load i8*, i8** %5
%93 = getelementptr inbounds i8, i8* %92, i64 512
%94 = bitcast i8* %93 to i32*
%95 = load i32, i32* %94
%96 = and i32 %95, -33
store i32 %96, i32* %94
%97 = load i8*, i8** %5
%98 = getelementptr inbounds i8, i8* %97, i64 256
%99 = bitcast i8* %98 to i32*
%100 = load i32, i32* %99
%101 = or i32 %100, 3840
store i32 %101, i32* %99
%102 = load i8*, i8** %5
%103 = getelementptr inbounds i8, i8* %102, i64 784
%104 = bitcast i8* %103 to i32*
store i32 672, i32* %104
%105 = load i8*, i8** %5
%106 = getelementptr inbounds i8, i8* %105, i64 848
%107 = bitcast i8* %106 to i32*
store i32 672, i32* %107
%108 = load i8*, i8** %5
%109 = getelementptr inbounds i8, i8* %108, i64 912
%110 = bitcast i8* %109 to i32*
store i32 672, i32* %110
%111 = load i8*, i8** %5
%112 = getelementptr inbounds i8, i8* %111, i64 976
%113 = bitcast i8* %112 to i32*
store i32 672, i32* %113
%114 = load i8*, i8** %5
%115 = getelementptr inbounds i8, i8* %114, i64 1040
%116 = bitcast i8* %115 to i32*
store i32 672, i32* %116
%117 = load i8*, i8** %5
%118 = getelementptr inbounds i8, i8* %117, i64 1104
%119 = bitcast i8* %118 to i32*
store i32 672, i32* %119
%120 = load i8*, i8** %5
%121 = getelementptr inbounds i8, i8* %120, i64 1168
%122 = bitcast i8* %121 to i32*
store i32 672, i32* %122
%123 = load i8*, i8** %5
%124 = getelementptr inbounds i8, i8* %123, i64 1232
%125 = bitcast i8* %124 to i32*
store i32 672, i32* %125
%126 = load i8*, i8** %5
%127 = getelementptr inbounds i8, i8* %126, i64 1296
%128 = bitcast i8* %127 to i32*
store i32 672, i32* %128
%129 = load i8*, i8** %5
%130 = getelementptr inbounds i8, i8* %129, i64 1360
%131 = bitcast i8* %130 to i32*
store i32 672, i32* %131
%132 = load i8*, i8** %5
%133 = getelementptr inbounds i8, i8* %132, i64 1424
%134 = bitcast i8* %133 to i32*
store i32 672, i32* %134
%135 = load i8*, i8** %5
%136 = getelementptr inbounds i8, i8* %135, i64 1488
%137 = bitcast i8* %136 to i32*
store i32 672, i32* %137
%138 = load i8*, i8** %5
%139 = getelementptr inbounds i8, i8* %138, i64 256
%140 = bitcast i8* %139 to i32*
%141 = load i32, i32* %140
%142 = or i32 %141, 4194304
store i32 %142, i32* %140
%143 = load i32, i32* %6
%144 = icmp eq i32 %143, 16
br i1 %144, label %145, label %159
145: ; preds = %84
%146 = load i8*, i8** %5
%147 = getelementptr inbounds i8, i8* %146, i64 256
%148 = bitcast i8* %147 to i32*
%149 = load i32, i32* %148
%150 = or i32 %149, 4
store i32 %150, i32* %148
%151 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
store i32 20000000, i32* %151
%152 = load i32, i32* @CLOCK_REALTIME
%153 = call i32 @clock_nanosleep(i32 %152, i32 0, %struct.timespec* %9, i32 0)
%154 = load i8*, i8** %5
%155 = getelementptr inbounds i8, i8* %154, i64 256
%156 = bitcast i8* %155 to i32*
%157 = load i32, i32* %156
%158 = and i32 %157, -9
store i32 %158, i32* %156
br label %180
159: ; preds = %84
%160 = load i32, i32* %6
%161 = icmp eq i32 %160, 32
br i1 %161, label %162, label %176
162: ; preds = %159
%163 = load i8*, i8** %5
%164 = getelementptr inbounds i8, i8* %163, i64 256
%165 = bitcast i8* %164 to i32*
%166 = load i32, i32* %165
%167 = and i32 %166, -5
store i32 %167, i32* %165
%168 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
store i32 20000000, i32* %168
%169 = load i32, i32* @CLOCK_REALTIME
%170 = call i32 @clock_nanosleep(i32 %169, i32 0, %struct.timespec* %9, i32 0)
%171 = load i8*, i8** %5
%172 = getelementptr inbounds i8, i8* %171, i64 256
%173 = bitcast i8* %172 to i32*
%174 = load i32, i32* %173
%175 = or i32 %174, 8
store i32 %175, i32* %173
br label %179
176: ; preds = %159
%177 = load i32, i32* @stderr
%178 = call i32 @fprintf(i32 %177, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %4
br label %187
179: ; preds = %162
br label %180
180: ; preds = %179, %145
%181 = load i8*, i8** %5
%182 = getelementptr inbounds i8, i8* %181, i64 256
%183 = bitcast i8* %182 to i32*
%184 = load i32, i32* %183
%185 = and i32 %184, -1793
store i32 %185, i32* %183
%186 = load i32, i32* %10
store i32 %186, i32* %4
br label %187
187: ; preds = %180, %176
%188 = load i32, i32* %4
ret i32 %188
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@.str.2 = [25 x i8] c"ADC Register Value 0x%x\0A\00"
@CLOCK_REALTIME = global i32 0
@stderr = global i32 0
@.str.3 = [35 x i8] c"\09Clock source not properly defined\00"
@str = [27 x i8] c"This appears to be a GC316\00"
define i32 @_config_GC314FS(i8* nocapture %0, i32 %1, i32 %2) {
%4 = alloca %struct.timespec
%5 = bitcast %struct.timespec* %4 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
store i32 10000, i32* %7
%8 = getelementptr inbounds i8, i8* %0, i64 256
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = and i32 %10, -25167729
%12 = getelementptr inbounds i8, i8* %0, i64 276
%13 = bitcast i8* %12 to i32*
store i32 3000, i32* %13
%14 = or i32 %11, 25165920
store i32 %14, i32* %9
%15 = getelementptr inbounds i8, i8* %0, i64 304
%16 = bitcast i8* %15 to i32*
store i32 21, i32* %16
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 21)
%19 = load i32, i32* %9
%20 = and i32 %19, -524289
%21 = getelementptr inbounds i8, i8* %0, i64 512
%22 = bitcast i8* %21 to i32*
%23 = load i32, i32* %22
%24 = and i32 %23, -33
store i32 %24, i32* %22
%25 = getelementptr inbounds i8, i8* %0, i64 784
%26 = bitcast i8* %25 to i32*
store i32 672, i32* %26
%27 = getelementptr inbounds i8, i8* %0, i64 848
%28 = bitcast i8* %27 to i32*
store i32 672, i32* %28
%29 = getelementptr inbounds i8, i8* %0, i64 912
%30 = bitcast i8* %29 to i32*
store i32 672, i32* %30
%31 = getelementptr inbounds i8, i8* %0, i64 976
%32 = bitcast i8* %31 to i32*
store i32 672, i32* %32
%33 = getelementptr inbounds i8, i8* %0, i64 1040
%34 = bitcast i8* %33 to i32*
store i32 672, i32* %34
%35 = getelementptr inbounds i8, i8* %0, i64 1104
%36 = bitcast i8* %35 to i32*
store i32 672, i32* %36
%37 = getelementptr inbounds i8, i8* %0, i64 1168
%38 = bitcast i8* %37 to i32*
store i32 672, i32* %38
%39 = getelementptr inbounds i8, i8* %0, i64 1232
%40 = bitcast i8* %39 to i32*
store i32 672, i32* %40
%41 = getelementptr inbounds i8, i8* %0, i64 1296
%42 = bitcast i8* %41 to i32*
store i32 672, i32* %42
%43 = getelementptr inbounds i8, i8* %0, i64 1360
%44 = bitcast i8* %43 to i32*
store i32 672, i32* %44
%45 = getelementptr inbounds i8, i8* %0, i64 1424
%46 = bitcast i8* %45 to i32*
store i32 672, i32* %46
%47 = getelementptr inbounds i8, i8* %0, i64 1488
%48 = bitcast i8* %47 to i32*
store i32 672, i32* %48
%49 = or i32 %20, 4198144
store i32 %49, i32* %9
switch i32 %1, label %62 [
i32 16, label %50
i32 32, label %56
]
50: ; preds = %3
%51 = or i32 %20, 4198148
store i32 %51, i32* %9
store i32 20000000, i32* %7
%52 = load i32, i32* @CLOCK_REALTIME
%53 = call i32 @clock_nanosleep(i32 %52, i32 0, %struct.timespec* %4, i32 0)
%54 = load i32, i32* %9
%55 = and i32 %54, -9
br label %65
56: ; preds = %3
%57 = and i32 %49, -524293
store i32 %57, i32* %9
store i32 20000000, i32* %7
%58 = load i32, i32* @CLOCK_REALTIME
%59 = call i32 @clock_nanosleep(i32 %58, i32 0, %struct.timespec* %4, i32 0)
%60 = load i32, i32* %9
%61 = or i32 %60, 8
br label %65
62: ; preds = %3
%63 = load i32, i32* @stderr
%64 = tail call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %68
65: ; preds = %56, %50
%66 = phi i32 [ %61, %56 ], [ %55, %50 ]
%67 = and i32 %66, -1793
store i32 %67, i32* %9
br label %68
68: ; preds = %65, %62
%69 = phi i32 [ 316, %65 ], [ -1, %62 ]
ret i32 %69
}