#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*/ str_trim(char **);
int /*<<< orphan*/ strncpy(char *, char *, int);
void trim_line_data(char *line_data_buf) {
  char *tmp_ptr = NULL;
  if (line_data_buf == NULL) {
    return;
  }
  tmp_ptr = line_data_buf;
  while (*tmp_ptr && ((tmp_ptr - line_data_buf) <= (400))) {
    if (*tmp_ptr == '#' || *tmp_ptr == ';') {
      *tmp_ptr = '\0';
      break;
    }
    tmp_ptr++;
  }
  tmp_ptr = line_data_buf;
  str_trim(&tmp_ptr);
  strncpy(line_data_buf, tmp_ptr, (400));
}


x86 assembly (clang, -O0):
<trim_line_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1144 <trim_line_data+0x24>
jmp    11e8 <trim_line_data+0xc8>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1178 <trim_line_data+0x58>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x190,%rax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1188 <trim_line_data+0x68>
jmp    11c5 <trim_line_data+0xa5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     11a8 <trim_line_data+0x88>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    11b4 <trim_line_data+0x94>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    11c5 <trim_line_data+0xa5>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114c <trim_line_data+0x2c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <str_trim@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x190,%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_line_data>:
test   %rdi,%rdi
je     118d <trim_line_data+0x6d>
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1167 <trim_line_data+0x47>
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
cmp    $0x3b,%al
je     1162 <trim_line_data+0x42>
cmp    $0x23,%al
je     1162 <trim_line_data+0x42>
movzbl (%rbx,%rcx,1),%eax
test   %al,%al
je     1167 <trim_line_data+0x47>
lea    0x1(%rcx),%rdx
cmp    $0x191,%rcx
mov    %rdx,%rcx
jl     1140 <trim_line_data+0x20>
jmp    1167 <trim_line_data+0x47>
movb   $0x0,-0x1(%rbx,%rcx,1)
mov    %rbx,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <str_trim@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x190,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @trim_line_data(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %44
7: ; preds = %1
%8 = load i8*, i8** %2
store i8* %8, i8** %3
br label %9
9: ; preds = %35, %7
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
%20 = icmp sle i64 %19, 400
br label %21
21: ; preds = %14, %9
%22 = phi i1 [ false, %9 ], [ %20, %14 ]
br i1 %22, label %23, label %38
23: ; preds = %21
%24 = load i8*, i8** %3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 35
br i1 %27, label %33, label %28
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 59
br i1 %32, label %33, label %35
33: ; preds = %28, %23
%34 = load i8*, i8** %3
store i8 0, i8* %34
br label %38
35: ; preds = %28
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i32 1
store i8* %37, i8** %3
br label %9
38: ; preds = %33, %21
%39 = load i8*, i8** %2
store i8* %39, i8** %3
%40 = call i32 @str_trim(i8** %3)
%41 = load i8*, i8** %2
%42 = load i8*, i8** %3
%43 = call i32 @strncpy(i8* %41, i8* %42, i32 400)
br label %44
44: ; preds = %38, %6
ret void
}

LLVM IR (-O2):
define void @trim_line_data(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %25, label %5
5: ; preds = %1
%6 = ptrtoint i8* %0 to i64
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %5, %13
%10 = phi i8 [ %15, %13 ], [ %7, %5 ]
%11 = phi i8* [ %14, %13 ], [ %0, %5 ]
switch i8 %10, label %13 [
i8 35, label %12
i8 59, label %12
]
12: ; preds = %9, %9
store i8 0, i8* %11
br label %21
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %11, i64 1
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 0
%17 = ptrtoint i8* %14 to i64
%18 = sub i64 %17, %6
%19 = icmp slt i64 %18, 401
%20 = and i1 %16, %19
br i1 %20, label %9, label %21
21: ; preds = %13, %5, %12
store i8* %0, i8** %2
%22 = call i32 @str_trim(i8** %2)
%23 = load i8*, i8** %2
%24 = call i32 @strncpy(i8* %0, i8* %23, i32 400)
br label %25
25: ; preds = %1, %21
ret void
}