#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*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ setOption(char *);
void configure(char conftxt[], int size) {
  char tmp[size];
  int anotherI = 0;
  for (int i = 0; i < size; i++) {
    if (conftxt[i] == ';') {
      setOption(tmp);
      anotherI = 0;
      memset(tmp, 0, size);
    } else {
      tmp[anotherI] = conftxt[i];
      anotherI++;
    }
  }
}


x86 assembly (clang, -O0):
<configure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d9 <configure+0xb9>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3b,%eax
jne    11a7 <configure+0x87>
mov    -0x30(%rbp),%rdi
call   1030 <setOption@plt>
mov    -0x30(%rbp),%rdi
movl   $0x0,-0x24(%rbp)
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
jmp    11c6 <configure+0xa6>
mov    -0x30(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x28(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11cb <configure+0xab>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1163 <configure+0x43>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r12d
mov    %rsp,%r13
lea    0xf(%r12),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %esi,-0x2c(%rbp)
test   %esi,%esi
jle    1198 <configure+0x78>
mov    %rdi,%r15
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    1175 <configure+0x55>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %r14d,%r14
mov    %al,0x0(%r13,%r14,1)
add    $0x1,%r14d
add    $0x1,%rbx
cmp    %rbx,%r12
je     1198 <configure+0x78>
movzbl (%r15,%rbx,1),%eax
cmp    $0x3b,%al
jne    1160 <configure+0x40>
mov    %r13,%rdi
call   1030 <setOption@plt>
xor    %r14d,%r14d
mov    %r13,%rdi
xor    %esi,%esi
mov    -0x2c(%rbp),%edx
call   1040 <memset@plt>
jmp    116c <configure+0x4c>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @configure(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %5
%12 = alloca i8, i64 %10
store i64 %10, i64* %6
store i32 0, i32* %7
store i32 0, i32* %8
br label %13
13: ; preds = %41, %2
%14 = load i32, i32* %8
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %44
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 59
br i1 %24, label %25, label %29
25: ; preds = %17
%26 = call i32 @setOption(i8* %12)
store i32 0, i32* %7
%27 = load i32, i32* %4
%28 = call i32 @memset(i8* %12, i32 0, i32 %27)
br label %40
29: ; preds = %17
%30 = load i8*, i8** %3
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
%34 = load i8, i8* %33
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %12, i64 %36
store i8 %34, i8* %37
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %40
40: ; preds = %29, %25
br label %41
41: ; preds = %40
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
br label %13
44: ; preds = %13
%45 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @configure(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i8, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %7, label %6
6: ; preds = %20, %2
ret void
7: ; preds = %2, %20
%8 = phi i64 [ %22, %20 ], [ 0, %2 ]
%9 = phi i32 [ %21, %20 ], [ 0, %2 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 59
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = call i32 @setOption(i8* %4)
%15 = call i32 @memset(i8* %4, i32 0, i32 %1)
br label %20
16: ; preds = %7
%17 = sext i32 %9 to i64
%18 = getelementptr inbounds i8, i8* %4, i64 %17
store i8 %11, i8* %18
%19 = add nsw i32 %9, 1
br label %20
20: ; preds = %13, %16
%21 = phi i32 [ 0, %13 ], [ %19, %16 ]
%22 = add nuw nsw i64 %8, 1
%23 = icmp eq i64 %22, %3
br i1 %23, label %6, label %7
}