#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ adcinit();
void BSP_Microphone_Init(void) {
  adcinit();
  (*((volatile uint32_t *)0x400FE608)) |= 0x00000010;
  while (((*((volatile uint32_t *)0x400FEA08)) & 0x10) == 0) {
  };
  (*((volatile uint32_t *)0x40024528)) |= 0x20;
  (*((volatile uint32_t *)0x40024400)) &= ~0x20;
  (*((volatile uint32_t *)0x40024420)) |= 0x20;
  (*((volatile uint32_t *)0x4002451C)) &= ~0x20;
  adcinit();
  (*((volatile uint32_t *)0x40038000)) &= ~0x0008;
  (*((volatile uint32_t *)0x40038014)) &= ~0xF000;
  (*((volatile uint32_t *)0x400380A0)) = 0x0008;
  (*((volatile uint32_t *)0x400380A4)) = 0x0006;
  (*((volatile uint32_t *)0x40038008)) &= ~0x0008;
  (*((volatile uint32_t *)0x40038000)) |= 0x0008;
}


x86 assembly (clang, -O0):
<BSP_Microphone_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <adcinit@plt>
mov    $0x400fe608,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    $0x400fe608,%eax
mov    %ecx,(%rax)
mov    $0x400fea08,%eax
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
jne    1144 <BSP_Microphone_Init+0x34>
jmp    112c <BSP_Microphone_Init+0x1c>
mov    $0x40024528,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0x40024528,%eax
mov    %ecx,(%rax)
mov    $0x40024400,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    $0x40024400,%eax
mov    %ecx,(%rax)
mov    $0x40024420,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0x40024420,%eax
mov    %ecx,(%rax)
mov    $0x4002451c,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    $0x4002451c,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <adcinit@plt>
mov    $0x40038000,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40038000,%eax
mov    %ecx,(%rax)
mov    $0x40038014,%eax
mov    (%rax),%ecx
and    $0xffff0fff,%ecx
mov    $0x40038014,%eax
mov    %ecx,(%rax)
mov    $0x400380a0,%eax
movl   $0x8,(%rax)
mov    $0x400380a4,%eax
movl   $0x6,(%rax)
mov    $0x40038008,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40038008,%eax
mov    %ecx,(%rax)
mov    $0x40038000,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x40038000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_Microphone_Init>:
push   %rax
xor    %eax,%eax
call   1030 <adcinit@plt>
orl    $0x10,0x400fe608
10
testl  $0x10,0x400fea08
je     1120 <BSP_Microphone_Init+0x10>
orl    $0x20,0x40024528
20
andl   $0xffffffdf,0x40024400
df
orl    $0x20,0x40024420
20
andl   $0xffffffdf,0x4002451c
df
xor    %eax,%eax
call   1030 <adcinit@plt>
andl   $0xfffffff7,0x40038000
f7
andl   $0xffff0fff,0x40038014
ff 0f ff ff
movl   $0x8,0x400380a0
movl   $0x6,0x400380a4
andl   $0xfffffff7,0x40038008
f7
orl    $0x8,0x40038000
08
pop    %rax
ret

LLVM IR (-O0):
define void @BSP_Microphone_Init() {
%1 = call i32 (...) @adcinit()
%2 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%3 = or i32 %2, 16
store volatile i32 %3, i32* inttoptr (i64 1074783752 to i32*)
br label %4
4: ; preds = %8, %0
%5 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%6 = and i32 %5, 16
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = load volatile i32, i32* inttoptr (i64 1073890600 to i32*)
%11 = or i32 %10, 32
store volatile i32 %11, i32* inttoptr (i64 1073890600 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073890304 to i32*)
%13 = and i32 %12, -33
store volatile i32 %13, i32* inttoptr (i64 1073890304 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1073890336 to i32*)
%15 = or i32 %14, 32
store volatile i32 %15, i32* inttoptr (i64 1073890336 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1073890588 to i32*)
%17 = and i32 %16, -33
store volatile i32 %17, i32* inttoptr (i64 1073890588 to i32*)
%18 = call i32 (...) @adcinit()
%19 = load volatile i32, i32* inttoptr (i64 1073971200 to i32*)
%20 = and i32 %19, -9
store volatile i32 %20, i32* inttoptr (i64 1073971200 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 1073971220 to i32*)
%22 = and i32 %21, -61441
store volatile i32 %22, i32* inttoptr (i64 1073971220 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 6, i32* inttoptr (i64 1073971364 to i32*)
%23 = load volatile i32, i32* inttoptr (i64 1073971208 to i32*)
%24 = and i32 %23, -9
store volatile i32 %24, i32* inttoptr (i64 1073971208 to i32*)
%25 = load volatile i32, i32* inttoptr (i64 1073971200 to i32*)
%26 = or i32 %25, 8
store volatile i32 %26, i32* inttoptr (i64 1073971200 to i32*)
ret void
}

LLVM IR (-O2):
define void @BSP_Microphone_Init() {
%1 = tail call i32 (...) @adcinit()
%2 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%3 = or i32 %2, 16
store volatile i32 %3, i32* inttoptr (i64 1074783752 to i32*)
br label %4
4: ; preds = %4, %0
%5 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%6 = and i32 %5, 16
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 1073890600 to i32*)
%10 = or i32 %9, 32
store volatile i32 %10, i32* inttoptr (i64 1073890600 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1073890304 to i32*)
%12 = and i32 %11, -33
store volatile i32 %12, i32* inttoptr (i64 1073890304 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 1073890336 to i32*)
%14 = or i32 %13, 32
store volatile i32 %14, i32* inttoptr (i64 1073890336 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 1073890588 to i32*)
%16 = and i32 %15, -33
store volatile i32 %16, i32* inttoptr (i64 1073890588 to i32*)
%17 = tail call i32 (...) @adcinit()
%18 = load volatile i32, i32* inttoptr (i64 1073971200 to i32*)
%19 = and i32 %18, -9
store volatile i32 %19, i32* inttoptr (i64 1073971200 to i32*)
%20 = load volatile i32, i32* inttoptr (i64 1073971220 to i32*)
%21 = and i32 %20, -61441
store volatile i32 %21, i32* inttoptr (i64 1073971220 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 6, i32* inttoptr (i64 1073971364 to i32*)
%22 = load volatile i32, i32* inttoptr (i64 1073971208 to i32*)
%23 = and i32 %22, -9
store volatile i32 %23, i32* inttoptr (i64 1073971208 to i32*)
%24 = load volatile i32, i32* inttoptr (i64 1073971200 to i32*)
%25 = or i32 %24, 8
store volatile i32 %25, i32* inttoptr (i64 1073971200 to i32*)
ret void
}