xunge/DecIR huggingface dataset:
int ft_wdlen(const char *s, char sep) {
  int len;
  len = 0;
  while (s[len] != sep && s[len])
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<ft_wdlen>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     1147 <ft_wdlen+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1157 <ft_wdlen+0x57>
jmp    1165 <ft_wdlen+0x65>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <ft_wdlen+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_wdlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
add    $0x1,%eax
cmp    %sil,%cl
je     1123 <ft_wdlen+0x23>
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ft_wdlen+0x10>
ret

LLVM IR (-O0):
define i32 @ft_wdlen(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %26, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %12, %14
br i1 %15, label %16, label %24
16: ; preds = %6
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br label %24
24: ; preds = %16, %6
%25 = phi i1 [ false, %6 ], [ %23, %16 ]
br i1 %25, label %26, label %29
26: ; preds = %24
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %6
29: ; preds = %24
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
define i32 @ft_wdlen(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = icmp eq i8 %6, 0
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
int test_imm_F9uint8_mem(unsigned char *val) {
  return ((*val) & (0xF9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F9uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xf9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F9uint8_mem>:
testb  $0xf9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F9uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 249
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_F9uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -7
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *fmt_o(unsigned long o, char *s) {
  char *prev = s;
  for (; o; o >>= 3)
    *--s = '0' + (o & 0x7);
  if (s == prev)
    *--s = '0';
  ;
  return s;
}


x86 assembly (clang, -O0):
<fmt_o>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <fmt_o+0x50>
mov    -0x8(%rbp),%rax
and    $0x7,%rax
add    $0x30,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <fmt_o+0x14>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1171 <fmt_o+0x71>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x30,-0x1(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_o>:
mov    %rsi,%rax
test   %rdi,%rdi
je     1136 <fmt_o+0x36>
xor    %esi,%esi
mov    %rdi,%rdx
nopl   (%rax)
mov    %edi,%ecx
and    $0x7,%cl
or     $0x30,%cl
mov    %cl,-0x1(%rax,%rsi,1)
shr    $0x3,%rdx
add    $0xffffffffffffffff,%rsi
cmp    $0x7,%rdi
mov    %rdx,%rdi
ja     1110 <fmt_o+0x10>
test   %rsi,%rsi
je     1136 <fmt_o+0x36>
add    %rsi,%rax
ret
movb   $0x30,-0x1(%rax)
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i8* @fmt_o(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
br label %7
7: ; preds = %17, %2
%8 = load i64, i64* %3
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i64, i64* %3
%12 = and i64 %11, 7
%13 = add i64 48, %12
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 -1
store i8* %16, i8** %4
store i8 %14, i8* %16
br label %17
17: ; preds = %10
%18 = load i64, i64* %3
%19 = lshr i64 %18, 3
store i64 %19, i64* %3
br label %7
20: ; preds = %7
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = icmp eq i8* %21, %22
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 -1
store i8* %26, i8** %4
store i8 48, i8* %26
br label %27
27: ; preds = %24, %20
%28 = load i8*, i8** %4
ret i8* %28
}

LLVM IR (-O2):
define i8* @fmt_o(i64 %0, i8* writeonly %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ %0, %2 ]
%6 = phi i8* [ %10, %4 ], [ %1, %2 ]
%7 = trunc i64 %5 to i8
%8 = and i8 %7, 7
%9 = or i8 %8, 48
%10 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %9, i8* %10
%11 = lshr i64 %5, 3
%12 = icmp ult i64 %5, 8
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = icmp eq i8* %10, %1
br i1 %14, label %15, label %17
15: ; preds = %2, %13
%16 = getelementptr inbounds i8, i8* %1, i64 -1
store i8 48, i8* %16
br label %17
17: ; preds = %15, %13
%18 = phi i8* [ %16, %15 ], [ %10, %13 ]
ret i8* %18
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int __internal_syscall(int, long, long, long, long);
int _gettimeofday(struct timeval *tp, void *tz) {
  return __internal_syscall(169, (long)(tp), (long)(0), (long)(0), (long)(0));
}


x86 assembly (clang, -O0):
<_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xa9,%edi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <__internal_syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gettimeofday>:
mov    %rdi,%rsi
mov    $0xa9,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <__internal_syscall@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @_gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = ptrtoint %struct.timeval* %5 to i64
%7 = call i32 @__internal_syscall(i32 169, i64 %6, i64 0, i64 0, i64 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @_gettimeofday(%struct.timeval* %0, i8* nocapture readnone %1) {
%3 = ptrtoint %struct.timeval* %0 to i64
%4 = tail call i32 @__internal_syscall(i32 169, i64 %3, i64 0, i64 0, i64 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello");
  printf("IT KMITL");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [9 x i8] c"IT KMITL\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [9 x i8] c"IT KMITL\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ term_send(char);
void term_save_cursor_position() {
  term_send(27);
  term_send('[');
  term_send('s');
}


x86 assembly (clang, -O0):
<term_save_cursor_position>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x73,%edi
call   1030 <term_send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_save_cursor_position>:
push   %rax
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x73,%edi
pop    %rax
jmp    1030 <term_send@plt>

LLVM IR (-O0):
define void @term_save_cursor_position() {
%1 = call i32 @term_send(i8 signext 27)
%2 = call i32 @term_send(i8 signext 91)
%3 = call i32 @term_send(i8 signext 115)
ret void
}

LLVM IR (-O2):
define void @term_save_cursor_position() {
%1 = tail call i32 @term_send(i8 signext 27)
%2 = tail call i32 @term_send(i8 signext 91)
%3 = tail call i32 @term_send(i8 signext 115)
ret void
}
void XtVaCreateArgsList() {}


x86 assembly (clang, -O0):
<XtVaCreateArgsList>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XtVaCreateArgsList>:
ret

LLVM IR (-O0):
define void @XtVaCreateArgsList() {
ret void
}

LLVM IR (-O2):
define void @XtVaCreateArgsList() {
ret void
}
/* Variables and functions */
scalar_t__ strchr(char *, char const);
const char *an(const char *next_word) {
  return strchr("aeiou", next_word[0]) ? "an" : "a";
}


x86 assembly (clang, -O0):
<an>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed9(%rip),%rdi
movsbl (%rax),%esi
call   1030 <strchr@plt>
mov    %rax,%rdx
lea    0xed0(%rip),%rax
lea    0xec6(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<an>:
push   %rax
movsbl (%rdi),%esi
lea    0xee5(%rip),%rdi
call   1030 <strchr@plt>
test   %rax,%rax
lea    0xedf(%rip),%rcx
lea    0xed5(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"aeiou\00"
@.str.1 = [3 x i8] c"an\00"
@.str.2 = [2 x i8] c"a\00"
define i8* @an(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i64 @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"aeiou\00"
@.str.1 = [3 x i8] c"an\00"
@.str.2 = [2 x i8] c"a\00"
define i8* @an(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
ret i8* %5
}
unsigned int JSHash(char *str) {
  unsigned int hash = 1315423911;
  while (*str) {
    hash ^= ((hash << 5) + (*str++) + (hash >> 2));
  }
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<JSHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x4e67c6a7,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <JSHash+0x49>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <JSHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<JSHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1134 <JSHash+0x34>
add    $0x1,%rdi
mov    $0x4e67c6a7,%eax
nop
mov    %eax,%edx
mov    %eax,%esi
shl    $0x5,%esi
movsbl %cl,%ecx
shr    $0x2,%eax
add    %esi,%eax
add    %ecx,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <JSHash+0x10>
and    $0x7fffffff,%eax
ret
mov    $0x4e67c6a7,%eax
ret

LLVM IR (-O0):
define i32 @JSHash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1315423911, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 5
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = add i32 %10, %14
%16 = load i32, i32* %3
%17 = lshr i32 %16, 2
%18 = add i32 %15, %17
%19 = load i32, i32* %3
%20 = xor i32 %19, %18
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i32, i32* %3
%23 = and i32 %22, 2147483647
ret i32 %23
}

LLVM IR (-O2):
define i32 @JSHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i32 [ %14, %4 ], [ 1315423911, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 5
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = lshr i32 %6, 2
%12 = add i32 %11, %8
%13 = add i32 %12, %10
%14 = xor i32 %13, %6
%15 = load i8, i8* %9
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = and i32 %14, 2147483647
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ 1315423911, %1 ], [ %18, %17 ]
ret i32 %20
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdupcat(const char *string1, const char *string2) {
  char *buf = (char *)malloc(strlen(string1) + strlen(string2) + 1);
  if (buf) {
    strcpy(buf, string1);
    strcat(buf, string2);
  }
  return buf;
}


x86 assembly (clang, -O0):
<strdupcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     119f <strdupcat+0x5f>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupcat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1186 <strdupcat+0x46>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdupcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %23
16: ; preds = %2
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %5
%21 = load i8*, i8** %4
%22 = call i32 @strcat(i8* %20, i8* %21)
br label %23
23: ; preds = %16, %2
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @strdupcat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = icmp eq i64 %7, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = tail call i32 @strcpy(i8* %8, i8* %0)
%12 = tail call i32 @strcat(i8* %8, i8* %1)
br label %13
13: ; preds = %10, %2
ret i8* %8
}
void Sys_ReplaceChar(char *s, char from, char to) {
  if (s)
    for (; *s; ++s)
      if (*s == from)
        *s = to;
}


x86 assembly (clang, -O0):
<Sys_ReplaceChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1167 <Sys_ReplaceChar+0x67>
jmp    1123 <Sys_ReplaceChar+0x23>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <Sys_ReplaceChar+0x62>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <Sys_ReplaceChar+0x4c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1151 <Sys_ReplaceChar+0x51>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <Sys_ReplaceChar+0x23>
jmp    1167 <Sys_ReplaceChar+0x67>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_ReplaceChar>:
test   %rdi,%rdi
je     1135 <Sys_ReplaceChar+0x35>
mov    (%rdi),%al
test   %al,%al
je     1135 <Sys_ReplaceChar+0x35>
add    $0x1,%rdi
jmp    112b <Sys_ReplaceChar+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1135 <Sys_ReplaceChar+0x35>
cmp    %sil,%al
jne    1120 <Sys_ReplaceChar+0x20>
mov    %dl,-0x1(%rdi)
jmp    1120 <Sys_ReplaceChar+0x20>
ret

LLVM IR (-O0):
define void @Sys_ReplaceChar(i8* %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %29
9: ; preds = %3
br label %10
10: ; preds = %25, %9
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8, i8* %5
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %17, %19
br i1 %20, label %21, label %24
21: ; preds = %14
%22 = load i8, i8* %6
%23 = load i8*, i8** %4
store i8 %22, i8* %23
br label %24
24: ; preds = %21, %14
br label %25
25: ; preds = %24
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
br label %10
28: ; preds = %10
br label %29
29: ; preds = %28, %3
ret void
}

LLVM IR (-O2):
define void @Sys_ReplaceChar(i8* %0, i8 signext %1, i8 signext %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %5, %13
%9 = phi i8 [ %15, %13 ], [ %6, %5 ]
%10 = phi i8* [ %14, %13 ], [ %0, %5 ]
%11 = icmp eq i8 %9, %1
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 %2, i8* %10
br label %13
13: ; preds = %8, %12
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %13, %5, %3
ret void
}
void hc_zero_dvector(x, n) double *x;
int n;
{
  int i;
  for (i = 0; i < n; i++)
    x[i] = 0.0;
}


x86 assembly (clang, -O0):
<hc_zero_dvector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <hc_zero_dvector+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <hc_zero_dvector+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hc_zero_dvector>:
test   %esi,%esi
jle    1126 <hc_zero_dvector+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @hc_zero_dvector(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @hc_zero_dvector(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
scalar_t__ is_tag_name(char const);
int __tag_name_len(const char *s) {
  int l;
  for (l = 0; is_tag_name(*s); l++)
    s++;
  return l;
}


x86 assembly (clang, -O0):
<__tag_name_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_tag_name@plt>
cmp    $0x0,%rax
je     1153 <__tag_name_len+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <__tag_name_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tag_name_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <is_tag_name@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1144 <__tag_name_len+0x34>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_tag_name@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <__tag_name_len+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @__tag_name_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = call i64 @is_tag_name(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @__tag_name_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_tag_name(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = tail call i64 @is_tag_name(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}
/* Variables and functions */
int cp850_char_to_printable(char **, unsigned char, unsigned int);
int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size) {
  return cp850_char_to_printable(p, c, out_size);
}


x86 assembly (clang, -O0):
<dos_char_to_printable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
movzbl %al,%esi
call   1030 <cp850_char_to_printable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dos_char_to_printable>:
jmp    1030 <cp850_char_to_printable@plt>

LLVM IR (-O0):
define i32 @dos_char_to_printable(i8** %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8
%6 = alloca i32
store i8** %0, i8*** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i32 @cp850_char_to_printable(i8** %7, i8 zeroext %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @dos_char_to_printable(i8** %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @cp850_char_to_printable(i8** %0, i8 zeroext %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ motion_direction(int);
int /*<<< orphan*/ speed_control(unsigned int, unsigned int);
void circular_forward(unsigned int l_speed, unsigned int r_speed) {
  motion_direction(0b00000110);
  speed_control(l_speed, r_speed);
  _delay_us(10);
}


x86 assembly (clang, -O0):
<circular_forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x6,%edi
call   1030 <motion_direction@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <speed_control@plt>
mov    $0xa,%edi
call   1040 <_delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_forward>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x6,%edi
call   1030 <motion_direction@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <speed_control@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_delay_us@plt>

LLVM IR (-O0):
define void @circular_forward(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @motion_direction(i32 6)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @speed_control(i32 %6, i32 %7)
%9 = call i32 @_delay_us(i32 10)
ret void
}

LLVM IR (-O2):
define void @circular_forward(i32 %0, i32 %1) {
%3 = tail call i32 @motion_direction(i32 6)
%4 = tail call i32 @speed_control(i32 %0, i32 %1)
%5 = tail call i32 @_delay_us(i32 10)
ret void
}
signed int explicit_unsigned_int_to_signed_int(unsigned int src) {
  return (signed int)src;
}


x86 assembly (clang, -O0):
<explicit_unsigned_int_to_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<explicit_unsigned_int_to_signed_int>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @explicit_unsigned_int_to_signed_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @explicit_unsigned_int_to_signed_int(i32 returned %0) {
ret i32 %0
}
char *strcpy(char *s1, const char *s2) {
  char *os1;
  os1 = s1;
  while (((*s1++) = (*s2++)))
    ;
  return (os1);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %14, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = icmp ne i8 %10, 0
br i1 %13, label %14, label %15
14: ; preds = %7
br label %7
15: ; preds = %7
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int psn_handler(char **save) {
  write_instr(0x00);
  write_imm(0x46);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<psn_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x46,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psn_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x46,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @psn_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 70)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @psn_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 70)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Press ~ and Enter to stop");
  while (getchar() != '~')
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0x7e,%eax
je     1153 <main+0x33>
jmp    113b <main+0x1b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x7e,%al
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Press ~ and Enter to stop\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 126
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Press ~ and Enter to stop\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 126
br i1 %4, label %5, label %2
5: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void gdbmiPrintHelpStack() {
  printf("bt -- Print backtrace of all stack frames\n");
  printf("where -- Print backtrace of all stack frames\n");
}


x86 assembly (clang, -O0):
<gdbmiPrintHelpStack>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbmiPrintHelpStack>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"bt -- Print backtrace of all stack frames\0A\00"
@.str.1 = [46 x i8] c"where -- Print backtrace of all stack frames\0A\00"
define void @gdbmiPrintHelpStack() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"bt -- Print backtrace of all stack frames\00"
@str.2 = [45 x i8] c"where -- Print backtrace of all stack frames\00"
define void @gdbmiPrintHelpStack() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_contains();
int /*<<< orphan*/ test_insertion();
int /*<<< orphan*/ test_removal();
int main(int argc, char **argv) {
  test_insertion();
  test_removal();
  test_contains();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_insertion@plt>
mov    $0x0,%al
call   1040 <test_removal@plt>
mov    $0x0,%al
call   1050 <test_contains@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_insertion@plt>
xor    %eax,%eax
call   1040 <test_removal@plt>
xor    %eax,%eax
call   1050 <test_contains@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_insertion()
%7 = call i32 (...) @test_removal()
%8 = call i32 (...) @test_contains()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_insertion()
%4 = tail call i32 (...) @test_removal()
%5 = tail call i32 (...) @test_contains()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exit1() { exit(34); }


x86 assembly (clang, -O0):
<exit1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit1>:
push   %rax
mov    $0x22,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @exit1() {
%1 = call i32 @exit(i32 34)
unreachable
}

LLVM IR (-O2):
define void @exit1() {
%1 = tail call i32 @exit(i32 34)
unreachable
}
void fork(void) { __asm__("int $0x80"); }


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
int    $0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
int    $0x80
ret

LLVM IR (-O0):
define void @fork() {
ret void
}

LLVM IR (-O2):
define void @fork() {
tail call void asm sideeffect "int $$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lgen2(char *, int, int);
void cgincps(int a, int v) { lgen2("addq\t$%d,%c%d", v, a); }


x86 assembly (clang, -O0):
<cgincps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <lgen2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgincps>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <lgen2@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"addq\09$%d,%c%d\00"
define void @cgincps(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @lgen2(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"addq\09$%d,%c%d\00"
define void @cgincps(i32 %0, i32 %1) {
%3 = tail call i32 @lgen2(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
int fun381() { return 381; }


x86 assembly (clang, -O0):
<fun381>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17d,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun381>:
mov    $0x17d,%eax
ret

LLVM IR (-O0):
define i32 @fun381() {
ret i32 381
}

LLVM IR (-O2):
define i32 @fun381() {
ret i32 381
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_hello(void) { printf("Hello, library.\n"); }


x86 assembly (clang, -O0):
<print_hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hello>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Hello, library.\0A\00"
define void @print_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Hello, library.\00"
define void @print_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ cc_uci_system_shell(char *);
int32_t cc_uci_dhcp_set() {
  return cc_uci_system_shell("/etc/network_event.sh dhcp");
}


x86 assembly (clang, -O0):
<cc_uci_dhcp_set>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <cc_uci_system_shell@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_uci_dhcp_set>:
lea    0xee9(%rip),%rdi
jmp    1030 <cc_uci_system_shell@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"/etc/network_event.sh dhcp\00"
define i32 @cc_uci_dhcp_set() {
%1 = call i32 @cc_uci_system_shell(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [27 x i8] c"/etc/network_event.sh dhcp\00"
define i32 @cc_uci_dhcp_set() {
%1 = tail call i32 @cc_uci_system_shell(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
__attribute__((no, noclone)) unsigned short foo7(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1 << (sizeof(short) * 8 - 1)) : 0) + 1 ||
      arg + 1 > ((!1) ? ((1 << (sizeof(short) * 8 - 1)) - 1)
                      : ((1 << (sizeof(short) * 8)) - 1)) -
                    1)
    return ret;
  arg = arg + 1;
  ret = (unsigned char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo7>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x1,%eax
jl     1133 <foo7+0x33>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0xfffe,%eax
jle    1140 <foo7+0x40>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115e <foo7+0x5e>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo7>:
lea    0x1(%rdi),%ecx
cmp    $0xfffe,%di
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo7(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %7, 1
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = add nsw i32 %11, 1
%13 = icmp sgt i32 %12, 65534
br i1 %13, label %14, label %16
14: ; preds = %9, %1
%15 = load i16, i16* %4
store i16 %15, i16* %2
br label %25
16: ; preds = %9
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = add nsw i32 %18, 1
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i16, i16* %3
%22 = trunc i16 %21 to i8
%23 = zext i8 %22 to i16
store i16 %23, i16* %4
%24 = load i16, i16* %3
store i16 %24, i16* %2
br label %25
25: ; preds = %16, %14
%26 = load i16, i16* %2
ret i16 %26
}

LLVM IR (-O2):
define zeroext i16 @foo7(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, -3
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int is_prime(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main() {
  char input[10];
  fgets(input, 10, stdin);
  printf("%d", is_prime(input));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1040 <fgets@plt>
lea    -0xe(%rbp),%rdi
call   1050 <is_prime@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <is_prime@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 10, i32 %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @is_prime(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 10, i32 %3)
%5 = call i32 @is_prime(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int reverseInt(int i) {
  unsigned char c1, c2, c3, c4;
  c1 = i & 255;
  c2 = (i >> 8) & 255;
  c3 = (i >> 16) & 255;
  c4 = (i >> 24) & 255;
  return ((int)c1 << 24) + ((int)c2 << 16) + ((int)c3 << 8) + c4;
}


x86 assembly (clang, -O0):
<reverseInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x8(%rbp)
movzbl -0x5(%rbp),%eax
shl    $0x18,%eax
movzbl -0x6(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
movzbl -0x7(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
movzbl -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseInt>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @reverseInt(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i32, i32* %2
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
store i8 %13, i8* %4
%14 = load i32, i32* %2
%15 = ashr i32 %14, 16
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
store i8 %17, i8* %5
%18 = load i32, i32* %2
%19 = ashr i32 %18, 24
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
store i8 %21, i8* %6
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 24
%25 = load i8, i8* %4
%26 = zext i8 %25 to i32
%27 = shl i32 %26, 16
%28 = add nsw i32 %24, %27
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 8
%32 = add nsw i32 %28, %31
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = add nsw i32 %32, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @reverseInt(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ draw_tree(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  int total_hashtags_count = (n - 2) * (n - 2);
  printf("%d\n", total_hashtags_count);
  draw_tree(n, total_hashtags_count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <draw_tree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
add    $0xfffffffe,%ebx
imul   %ebx,%ebx
lea    0xeac(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0xc(%rsp),%edi
mov    %ebx,%esi
call   1040 <draw_tree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 2
%9 = mul nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @draw_tree(i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -2
%6 = mul nsw i32 %5, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @draw_tree(i32 %8, i32 %6)
ret i32 0
}
char *strerror(int errno) {
  extern int sys_nerr;
  extern char *sys_errlist[];
  if ((0 <= errno) && (errno < sys_nerr))
    return sys_errlist[errno];
  else
    return "unknown errno";
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jg     113c <strerror+0x3c>
mov    -0xc(%rbp),%eax
mov    0x2ecc(%rip),%rcx
cmp    (%rcx),%eax
jge    113c <strerror+0x3c>
movslq -0xc(%rbp),%rcx
mov    0x2ec9(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <strerror+0x47>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
js     1123 <strerror+0x23>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jle    1123 <strerror+0x23>
mov    %edi,%eax
mov    0x2ed9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [14 x i8] c"unknown errno\00"
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %12
%14 = load i8*, i8** %13
store i8* %14, i8** %2
br label %16
15: ; preds = %6, %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [14 x i8] c"unknown errno\00"
define i8* @strerror(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = load i32, i32* @sys_nerr
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}