#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 stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ add(int, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ sqliteSetString(int, int, int, int, int);
int /*<<< orphan*/ stat(char *, struct stat *);
void test_sys_state() {
  char *filepath = "/data/data/edu.ptu.java.myapplication/lib/libnative-lib.so";
  struct stat statbuf;
  stat(filepath, &statbuf);
  assert(!S_ISDIR(statbuf.st_mode));
  char *pz = "232\0";
  char *zFirst = "232\0";
  add(2, 3);
  int num = 4;
  sqliteSetString(num, 3, 2, 32, 2);
}


x86 assembly (clang, -O0):
<test_sys_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <stat@plt>
mov    -0x10(%rbp),%edi
call   1040 <S_ISDIR@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xeaa(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe9f(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
movl   $0x4,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    $0x3,%esi
mov    $0x2,%r8d
mov    $0x20,%ecx
mov    %r8d,%edx
call   1070 <sqliteSetString@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sys_state>:
push   %rax
lea    0xea8(%rip),%rdi
mov    %rsp,%rsi
call   1060 <stat@plt>
mov    (%rsp),%edi
call   1040 <S_ISDIR@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
mov    $0x4,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x20,%ecx
mov    $0x2,%r8d
pop    %rax
jmp    1070 <sqliteSetString@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [59 x i8] c"/data/data/edu.ptu.java.myapplication/lib/libnative-lib.so\00"
@.str.1 = [5 x i8] c"232\00\00"
define void @test_sys_state() {
%1 = alloca i8*
%2 = alloca %struct.stat
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @stat(i8* %6, %struct.stat* %2)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @S_ISDIR(i32 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %4
%15 = call i32 @add(i32 2, i32 3)
store i32 4, i32* %5
%16 = load i32, i32* %5
%17 = call i32 @sqliteSetString(i32 %16, i32 3, i32 2, i32 32, i32 2)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [59 x i8] c"/data/data/edu.ptu.java.myapplication/lib/libnative-lib.so\00"
define void @test_sys_state() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @S_ISDIR(i32 %5)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @add(i32 2, i32 3)
%11 = tail call i32 @sqliteSetString(i32 4, i32 3, i32 2, i32 32, i32 2)
ret void
}