#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*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void GPRS_init(int fd_uart) {
  write(fd_uart, "AT+CMIC=0,15\n", strlen("AT+CMIC=0,15\n"));
  write(fd_uart, "AT+CHFA=1\n", strlen("AT+CHFA=1\n"));
  write(fd_uart, "AT+CLVL=100\n", strlen("AT+CLVL=100\n"));
  write(fd_uart, "AT+CPIL=1\n", strlen("AT+CPIL=1\n"));
  write(fd_uart, "AT+CMGF=1\n", strlen("AT+CMGF=1\n"));
  write(fd_uart, "AT+CSCS=\"GSM\"\n", strlen("AT+CSCS=\"GSM\"\n"));
}


x86 assembly (clang, -O0):
<GPRS_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0xec8(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%edx
lea    0xeb7(%rip),%rsi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%edx
lea    0xea2(%rip),%rsi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xe9b(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xe8a(%rip),%rsi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xe85(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%edx
lea    0xe74(%rip),%rsi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xe6d(%rip),%rdi
call   1040 <strlen@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
lea    0xe5c(%rip),%rsi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xe55(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
lea    0xe44(%rip),%rsi
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPRS_init>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xec6(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xeb6(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xea8(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xe98(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xe88(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"AT+CMIC=0,15\0A\00"
@.str.1 = [11 x i8] c"AT+CHFA=1\0A\00"
@.str.2 = [13 x i8] c"AT+CLVL=100\0A\00"
@.str.3 = [11 x i8] c"AT+CPIL=1\0A\00"
@.str.4 = [11 x i8] c"AT+CMGF=1\0A\00"
@.str.5 = [15 x i8] c"AT+CSCS=\22GSM\22\0A\00"
define void @GPRS_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @write(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @write(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @strlen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @write(i32 %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @write(i32 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %2
%16 = call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @write(i32 %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
%19 = call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 @write(i32 %18, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"AT+CMIC=0,15\0A\00"
@.str.1 = [11 x i8] c"AT+CHFA=1\0A\00"
@.str.2 = [13 x i8] c"AT+CLVL=100\0A\00"
@.str.3 = [11 x i8] c"AT+CPIL=1\0A\00"
@.str.4 = [11 x i8] c"AT+CMGF=1\0A\00"
@.str.5 = [15 x i8] c"AT+CSCS=\22GSM\22\0A\00"
define void @GPRS_init(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @strlen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = tail call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %12)
ret void
}