xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int my_getc(FILE *stream) {
  int retval = getc(stream);
  if (retval == '\r') {
    int next = getc(stream);
    if (next == '\n')
      return next;
    else
      ungetc(next, stream);
  }
  return retval;
}


x86 assembly (clang, -O0):
<my_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xd,-0x14(%rbp)
jne    1174 <my_getc+0x54>
mov    -0x10(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jne    1163 <my_getc+0x43>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <my_getc+0x5a>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ungetc@plt>
jmp    1174 <my_getc+0x54>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <getc@plt>
cmp    $0xd,%eax
jne    114f <my_getc+0x2f>
mov    %rbx,%rdi
call   1040 <getc@plt>
mov    %eax,%edi
mov    $0xa,%eax
cmp    $0xa,%edi
je     114f <my_getc+0x2f>
mov    %rbx,%rsi
call   1030 <ungetc@plt>
mov    $0xd,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_getc(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @getc(i32* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 13
br i1 %9, label %10, label %22
10: ; preds = %1
%11 = load i32*, i32** %3
%12 = call i32 @getc(i32* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i32, i32* %5
store i32 %16, i32* %2
br label %24
17: ; preds = %10
%18 = load i32, i32* %5
%19 = load i32*, i32** %3
%20 = call i32 @ungetc(i32 %18, i32* %19)
br label %21
21: ; preds = %17
br label %22
22: ; preds = %21, %1
%23 = load i32, i32* %4
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %15
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @my_getc(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = icmp eq i32 %2, 13
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @getc(i32* %0)
%6 = icmp eq i32 %5, 10
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @ungetc(i32 %5, i32* %0)
br label %9
9: ; preds = %1, %7, %4
%10 = phi i32 [ 10, %4 ], [ 13, %7 ], [ %2, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ mkpath_(char *);
int /*<<< orphan*/ usleep(int);
int mkpath(char *path) {
  int failcount = 0;
  static const int thresh = 10;
  while (!mkpath_(path) && failcount < thresh) {
    failcount++;
    usleep(1000 * 1000);
  }
  return (failcount < thresh);
}


x86 assembly (clang, -O0):
<mkpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mkpath_@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    1156 <mkpath+0x36>
cmpl   $0xa,-0xc(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1166 <mkpath+0x46>
jmp    117e <mkpath+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0xf4240,%edi
call   1040 <usleep@plt>
jmp    1133 <mkpath+0x13>
cmpl   $0xa,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkpath>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <mkpath_@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    1168 <mkpath+0x48>
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%ebx
mov    $0xf4240,%edi
call   1040 <usleep@plt>
mov    %r14,%rdi
call   1030 <mkpath_@plt>
test   %eax,%eax
jne    1160 <mkpath+0x40>
lea    0x1(%rbx),%eax
cmp    $0x9,%ebx
jb     1140 <mkpath+0x20>
xor    %eax,%eax
cmp    $0x9,%ebx
setb   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@mkpath.thresh = internal constant i32 10
define i32 @mkpath(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = call i32 @mkpath_(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10
br label %11
11: ; preds = %8, %4
%12 = phi i1 [ false, %4 ], [ %10, %8 ]
br i1 %12, label %13, label %17
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = call i32 @usleep(i32 1000000)
br label %4
17: ; preds = %11
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 10
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @mkpath(i8* %0) {
%2 = tail call i32 @mkpath_(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i32 @usleep(i32 1000000)
%8 = tail call i32 @mkpath_(i8* %0)
%9 = icmp eq i32 %8, 0
%10 = icmp ult i32 %5, 9
%11 = select i1 %9, i1 %10, i1 false
br i1 %11, label %4, label %12
12: ; preds = %4
%13 = zext i1 %10 to i32
br label %14
14: ; preds = %12, %1
%15 = phi i32 [ 1, %1 ], [ %13, %12 ]
ret i32 %15
}
void rop3_119_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D & S;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_119_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_119_0_0>:
and    (%rdi),%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_119_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = load i8*, i8** %4
store i8 %19, i8* %20
ret void
}

LLVM IR (-O2):
define void @rop3_119_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, -1
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int write(int, char *, int);
void expanderWrite(int file, char value) {
  char buffer = value | 0x08;
  if (write(file, &buffer, 1) != 1)
    printf("Error escribiendo en el dispositivo.\r\n");
}


x86 assembly (clang, -O0):
<expanderWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
or     $0x8,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
je     1161 <expanderWrite+0x41>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expanderWrite>:
push   %rax
or     $0x8,%sil
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
cmp    $0x1,%eax
jne    1140 <expanderWrite+0x20>
pop    %rax
ret
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Error escribiendo en el dispositivo.\0D\0A\00"
define void @expanderWrite(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = or i32 %7, 8
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
%10 = load i32, i32* %3
%11 = call i32 @write(i32 %10, i8* %5, i32 1)
%12 = icmp ne i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Error escribiendo en el dispositivo.\0D\00"
define void @expanderWrite(i32 %0, i8 signext %1) {
%3 = alloca i8
%4 = or i8 %1, 8
store i8 %4, i8* %3
%5 = call i32 @write(i32 %0, i8* %3, i32 1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret void
}
int parseConfigIsEOLChar(char c) {
  switch (c) {
  case '#':
  case ';':
  case '\0':
  case '\r':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<parseConfigIsEOLChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1151 <parseConfigIsEOLChar+0x51>
jmp    111e <parseConfigIsEOLChar+0x1e>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1151 <parseConfigIsEOLChar+0x51>
jmp    112f <parseConfigIsEOLChar+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x23,%eax
je     1151 <parseConfigIsEOLChar+0x51>
jmp    1140 <parseConfigIsEOLChar+0x40>
mov    -0xc(%rbp),%eax
sub    $0x3b,%eax
jne    115d <parseConfigIsEOLChar+0x5d>
jmp    1151 <parseConfigIsEOLChar+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1164 <parseConfigIsEOLChar+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseConfigIsEOLChar>:
cmp    $0x3b,%edi
ja     111d <parseConfigIsEOLChar+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x800000800002001,%rdx
bt     %rcx,%rdx
jae    111d <parseConfigIsEOLChar+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @parseConfigIsEOLChar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 35, label %6
i32 59, label %6
i32 0, label %6
i32 13, label %6
]
6: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @parseConfigIsEOLChar(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 35, label %4
i32 59, label %4
i32 0, label %4
i32 13, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ core4_swap(char *, int);
void U_EMRSTROKEPATH_swap(char *record, int torev) {
  core4_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_EMRSTROKEPATH_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <core4_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRSTROKEPATH_swap>:
jmp    1030 <core4_swap@plt>

LLVM IR (-O0):
define void @U_EMRSTROKEPATH_swap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @core4_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_EMRSTROKEPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foobar(int);
int main() {
  int a = 10;
  foobar(a);
  foobar(--a);
  foobar(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <foobar@plt>
mov    -0x8(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x8(%rbp)
call   1030 <foobar@plt>
mov    -0x8(%rbp),%edi
call   1030 <foobar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <foobar@plt>
mov    $0x9,%edi
call   1030 <foobar@plt>
mov    $0x9,%edi
call   1030 <foobar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foobar(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = call i32 @foobar(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @foobar(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foobar(i32 10)
%2 = tail call i32 @foobar(i32 9)
%3 = tail call i32 @foobar(i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *strrol(char *);
void clpPrintRol(char *pszStaticTxt, char *pszDynamicTxt, char *pszDisplayTxt) {
  pszDynamicTxt = strrol(pszDynamicTxt);
  memcpy(pszDisplayTxt, pszStaticTxt, strlen(pszStaticTxt));
  memcpy(pszDisplayTxt + 40, pszDynamicTxt, 16);
}


x86 assembly (clang, -O0):
<clpPrintRol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strrol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rdi
add    $0x28,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1050 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clpPrintRol>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strrol@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
add    $0x28,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <memcpy@plt>

LLVM IR (-O0):
define void @clpPrintRol(i8* %0, i8* %1, i8* %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** %5
%8 = call i8* @strrol(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @memcpy(i8* %9, i8* %10, i32 %12)
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 40
%16 = load i8*, i8** %5
%17 = call i32 @memcpy(i8* %15, i8* %16, i32 16)
ret void
}

LLVM IR (-O2):
define void @clpPrintRol(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @strrol(i8* %1)
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32 @memcpy(i8* %2, i8* %0, i32 %5)
%7 = getelementptr inbounds i8, i8* %2, i64 40
%8 = tail call i32 @memcpy(i8* %7, i8* %4, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr,
          "usage: %s -f pcap_file [-h] [-s server_address] [-p server_port] "
          "[-d] [-r radius_dictionary]\n",
          name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [94 x i8] c"usage: %s -f pcap_file [-h] [-s server_address] [-p server_port] [-d] [-r radius_dictionary]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [94 x i8] c"usage: %s -f pcap_file [-h] [-s server_address] [-p server_port] [-d] [-r radius_dictionary]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int bitcount(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d", bitcount((unsigned)255));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xff,%edi
call   1040 <bitcount@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 255)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ h();
int g(int i, int j) {
  int t = 0;
  int i1;
  if (i == j)
    t = 3;
  for (i1 = 0; i1 < 10000; i1++)
    h();
  if (t != 5)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1138 <g+0x28>
movl   $0x3,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    1161 <g+0x51>
mov    $0x0,%al
call   1030 <h@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <g+0x2f>
cmpl   $0x5,-0x10(%rbp)
je     1177 <g+0x67>
movl   $0x0,-0x4(%rbp)
jmp    117e <g+0x6e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    $0x2710,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <h@plt>
add    $0xffffffff,%ebx
jne    1120 <g+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @g(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 0, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 3, i32* %6
br label %12
12: ; preds = %11, %2
store i32 0, i32* %7
br label %13
13: ; preds = %18, %12
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 10000
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = call i32 (...) @h()
br label %18
18: ; preds = %16
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
br label %13
21: ; preds = %13
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 5
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 0, i32* %3
br label %26
25: ; preds = %21
store i32 1, i32* %3
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 (...) @h()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 10000
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
int fatal_error(char *errormsg[]) {
  printf("%s", errormsg);
  printf("\n");
  exit(0);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @fatal_error(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @fatal_error(i8** %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %0)
%3 = tail call i32 @putchar(i32 10)
tail call void @exit(i32 0)
unreachable
}
char *SzCleanString(sz)
char *sz;
{
  char *szEnd;
  while (*sz == ' ')
    sz++;
  szEnd = sz + strlen(sz) - 1;
  while (*szEnd == ' ')
    *szEnd-- = '\0';
  return (sz);
}


x86 assembly (clang, -O0):
<SzCleanString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    113d <SzCleanString+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <SzCleanString+0xc>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1187 <SzCleanString+0x77>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    1160 <SzCleanString+0x50>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SzCleanString>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rbx)
lea    0x1(%rbx),%rbx
je     1120 <SzCleanString+0x10>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmpb   $0x20,-0x1(%rbx,%rax,1)
jne    114d <SzCleanString+0x3d>
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
movb   $0x0,(%rax)
cmpb   $0x20,-0x1(%rax)
lea    -0x1(%rax),%rax
je     1140 <SzCleanString+0x30>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @SzCleanString(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = tail call i64 @strlen(i8* %3)
%9 = getelementptr inbounds i8, i8* %3, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 -1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 32
br i1 %12, label %13, label %18
13: ; preds = %7, %13
%14 = phi i8* [ %15, %13 ], [ %10, %7 ]
store i8 0, i8* %14
%15 = getelementptr inbounds i8, i8* %14, i64 -1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 32
br i1 %17, label %13, label %18
18: ; preds = %13, %7
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fail_test(int);
void *thread_a(void *arg) {
  if ((long)arg != 0x75L)
    fail_test(60);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<thread_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x75,%rax
je     1134 <thread_a+0x24>
mov    $0x3c,%edi
call   1030 <fail_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_a>:
cmp    $0x75,%rdi
je     1125 <thread_a+0x15>
push   %rax
mov    $0x3c,%edi
call   1030 <fail_test@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @thread_a(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = icmp ne i64 %4, 117
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @fail_test(i32 60)
br label %8
8: ; preds = %6, %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_a(i8* readnone %0) {
%2 = icmp eq i8* %0, inttoptr (i64 117 to i8*)
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fail_test(i32 60)
br label %5
5: ; preds = %3, %1
ret i8* null
}
void pchar_remove_lbreaks(char *s) {
  register int i = 0;
  while (s[i]) {
    if (s[i] == '\n' || s[i] == '\r')
      s[i] = '\0';
    i++;
  }
}


x86 assembly (clang, -O0):
<pchar_remove_lbreaks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1165 <pchar_remove_lbreaks+0x65>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     114b <pchar_remove_lbreaks+0x4b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
jne    1157 <pchar_remove_lbreaks+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <pchar_remove_lbreaks+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pchar_remove_lbreaks>:
jmp    1117 <pchar_remove_lbreaks+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <pchar_remove_lbreaks+0x10>
cmp    $0xd,%al
je     1110 <pchar_remove_lbreaks+0x10>
test   %al,%al
jne    1113 <pchar_remove_lbreaks+0x13>
ret

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

LLVM IR (-O2):
define void @pchar_remove_lbreaks(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 10, label %6
i8 13, label %6
]
6: ; preds = %2, %2
store i8 0, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret void
}
void test_ar_1_SCHAR(void *d, signed char n) {
  if (n == 0x7f - 1)
    n = 0x7f - 2;
  __builtin_memset(d, 0, n);
}


x86 assembly (clang, -O0):
<test_ar_1_SCHAR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x7e,%eax
jne    1133 <test_ar_1_SCHAR+0x23>
movb   $0x7d,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbq -0x9(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ar_1_SCHAR>:
cmp    $0x7e,%sil
mov    $0x7d,%eax
cmovne %esi,%eax
movslq %eax,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @test_ar_1_SCHAR(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 126
br i1 %7, label %8, label %9
8: ; preds = %2
store i8 125, i8* %4
br label %9
9: ; preds = %8, %2
%10 = load i8*, i8** %3
%11 = load i8, i8* %4
%12 = sext i8 %11 to i64
ret void
}

LLVM IR (-O2):
define void @test_ar_1_SCHAR(i8* nocapture writeonly %0, i8 signext %1) {
%3 = icmp eq i8 %1, 126
%4 = select i1 %3, i8 125, i8 %1
%5 = sext i8 %4 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %5, i1 false)
ret void
}
void timer(int a) {}


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

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

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

LLVM IR (-O2):
define void @timer(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __fs_path_strip(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char path[] = "   /home/peter/   ///hello world/   path   //  //world   //  ";
  printf("org-path: %s\n", path);
  __fs_path_strip(path);
  printf("reg-path: %s\n", path);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x3e,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <__fs_path_strip@plt>
lea    -0x50(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movups 0xf02(%rip),%xmm0
movups %xmm0,0x2e(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <__fs_path_strip@plt>
lea    0xed7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.path = [62 x i8] c" /home/peter/ ///hello world/ path // //world // \00"
@.str = [14 x i8] c"org-path: %s\0A\00"
@.str.1 = [14 x i8] c"reg-path: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [62 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [62 x i8]* %6 to i8*
%8 = getelementptr inbounds [62 x i8], [62 x i8]* %6, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [62 x i8], [62 x i8]* %6, i64 0, i64 0
%11 = call i32 @__fs_path_strip(i8* %10)
%12 = getelementptr inbounds [62 x i8], [62 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.path = [62 x i8] c" /home/peter/ ///hello world/ path // //world // \00"
@.str = [14 x i8] c"org-path: %s\0A\00"
@.str.1 = [14 x i8] c"reg-path: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [62 x i8]
%4 = getelementptr inbounds [62 x i8], [62 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @__fs_path_strip(i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
void rubysdl2_init_filesystem(void) {}


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

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

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

LLVM IR (-O2):
define void @rubysdl2_init_filesystem() {
ret void
}
/* Variables and functions */
unsigned long rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
unsigned long rand_interval(unsigned long max) {
  srand(time(NULL));
  return (rand() % max);
}


x86 assembly (clang, -O0):
<rand_interval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rdx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_interval>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     115f <rand_interval+0x2f>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @rand_interval(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i64 (...) @rand()
%6 = load i64, i64* %2
%7 = urem i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @rand_interval(i64 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i64 (...) @rand()
%5 = urem i64 %4, %0
ret i64 %5
}
void uart0TxFlush(void) {
  (*((volatile unsigned char *)0xE000C008)) |= (1 << 2);
}


x86 assembly (clang, -O0):
<uart0TxFlush>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000c008,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0x4,%eax
mov    %al,%cl
mov    $0xe000c008,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart0TxFlush>:
mov    $0xe000c008,%eax
orb    $0x4,(%rax)
ret

LLVM IR (-O0):
define void @uart0TxFlush() {
%1 = load volatile i8, i8* inttoptr (i64 3758145544 to i8*)
%2 = zext i8 %1 to i32
%3 = or i32 %2, 4
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 3758145544 to i8*)
ret void
}

LLVM IR (-O2):
define void @uart0TxFlush() {
%1 = load volatile i8, i8* inttoptr (i64 3758145544 to i8*)
%2 = or i8 %1, 4
store volatile i8 %2, i8* inttoptr (i64 3758145544 to i8*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ query;

/* Variables and functions */
int RS400_recvbytes(unsigned char *);
int /*<<< orphan*/ RS400_sendbytes(unsigned char *, int);
int RS400_get_user(unsigned char data[]) {
  unsigned char buf[20];
  unsigned char query[] = {0x5a, 0x00, 0x7e, 0x01};
  RS400_sendbytes(query, sizeof(query));
  return RS400_recvbytes(buf);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x24(%rbp)
lea    -0x24(%rbp),%rdi
mov    $0x4,%esi
call   1030 <RS400_sendbytes@plt>
lea    -0x20(%rbp),%rdi
call   1040 <RS400_recvbytes@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
sub    $0x28,%rsp
movl   $0x17e005a,0xc(%rsp)
01
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
call   1030 <RS400_sendbytes@plt>
lea    0x10(%rsp),%rdi
call   1040 <RS400_recvbytes@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.RS400_get_user.query = [4 x i8] c"Z\00~\01"
define i32 @RS400_get_user(i8* %0) {
%2 = alloca i8*
%3 = alloca [20 x i8]
%4 = alloca [4 x i8]
store i8* %0, i8** %2
%5 = bitcast [4 x i8]* %4 to i8*
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%7 = call i32 @RS400_sendbytes(i8* %6, i32 4)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%9 = call i32 @RS400_recvbytes(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @RS400_get_user(i8* nocapture readnone %0) {
%2 = alloca [20 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
store i32 25034842, i32* %3
%6 = call i32 @RS400_sendbytes(i8* %5, i32 4)
%7 = call i32 @RS400_recvbytes(i8* %4)
ret i32 %7
}
/* Variables and functions */
int strlen(char *);
void padterm(char *string, int length) {
  int i;
  for (i = strlen(string); i < length; i++)
    string[i] = ' ';
  string[length] = '\0';
}


x86 assembly (clang, -O0):
<padterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <padterm+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <padterm+0x1b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padterm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    %ebp,%eax
jge    114c <padterm+0x2c>
movslq %eax,%rdi
add    %rbx,%rdi
not    %eax
add    %ebp,%eax
add    $0x1,%rax
mov    $0x20,%esi
mov    %rax,%rdx
call   1040 <memset@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @padterm(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = getelementptr i8, i8* %0, i64 %6
%8 = xor i32 %3, -1
%9 = add i32 %8, %1
%10 = zext i32 %9 to i64
%11 = add nuw nsw i64 %10, 1
br label %12
12: ; preds = %5, %2
%13 = sext i32 %1 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
ret void
}
int range_butter(float r, float w, int m) { return m; }


x86 assembly (clang, -O0):
<range_butter>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @range_butter(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @range_butter(float %0, float %1, i32 returned %2) {
ret i32 %2
}
/* Type definitions */
typedef int clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
int /*<<< orphan*/ printf(char *, int);
void time_func(void(function)(void *context), void *context) {
  clock_t start = clock(), diff;
  function(context);
  diff = clock() - start;
  int msec = diff * 1000 / CLOCKS_PER_SEC;
  printf("Time: %d\n", msec);
}


x86 assembly (clang, -O0):
<time_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
imul   $0x3e8,-0x18(%rbp),%eax
mov    0x2e89(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_func>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   *%r14
xor    %eax,%eax
call   1030 <clock@plt>
sub    %ebp,%eax
imul   $0x3e8,%eax,%eax
mov    0x2e99(%rip),%rcx
cltd
idivl  (%rcx)
lea    0xea7(%rip),%rdi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
@.str = [10 x i8] c"Time: %d\0A\00"
define void @time_func(void (i8*)* %0, i8* %1) {
%3 = alloca void (i8*)*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store void (i8*)* %0, void (i8*)** %3
store i8* %1, i8** %4
%8 = call i32 (...) @clock()
store i32 %8, i32* %5
%9 = load void (i8*)*, void (i8*)** %3
%10 = load i8*, i8** %4
%11 = call i32 (...) @clock()
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = mul nsw i32 %14, 1000
%16 = load i32, i32* @CLOCKS_PER_SEC
%17 = sdiv i32 %15, %16
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %18)
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
@.str = [10 x i8] c"Time: %d\0A\00"
define void @time_func(void (i8*)* nocapture %0, i8* %1) {
%3 = tail call i32 (...) @clock()
tail call void %0(i8* %1)
%4 = tail call i32 (...) @clock()
%5 = sub nsw i32 %4, %3
%6 = mul nsw i32 %5, 1000
%7 = load i32, i32* @CLOCKS_PER_SEC
%8 = sdiv i32 %6, %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_fs(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "Usage: f3write <PATH>\n");
    return 1;
  }
  fill_fs(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1161 <main+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1175 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <fill_fs@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <fill_fs@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: f3write <PATH>\0A\00"
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @fill_fs(i8* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %11, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: f3write <PATH>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @fill_fs(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
void scene_doFrame() {}


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

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

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

LLVM IR (-O2):
define void @scene_doFrame() {
ret void
}
/* Type definitions */
struct option {
  int /*<<< orphan*/ *name;
};

/* Variables and functions */
int opt_size(struct option *opt) {
  int i;
  if (opt == NULL)
    return 0;
  for (i = 0; opt[i].name != NULL; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<opt_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <opt_size+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1152 <opt_size+0x52>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     114c <opt_size+0x4c>
jmp    113e <opt_size+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <opt_size+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_size>:
test   %rdi,%rdi
je     111e <opt_size+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <opt_size+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.option = type { i32* }
define i32 @opt_size(%struct.option* %0) {
%2 = alloca i32
%3 = alloca %struct.option*
%4 = alloca i32
store %struct.option* %0, %struct.option** %3
%5 = load %struct.option*, %struct.option** %3
%6 = icmp eq %struct.option* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %23
8: ; preds = %1
store i32 0, i32* %4
br label %9
9: ; preds = %18, %8
%10 = load %struct.option*, %struct.option** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds %struct.option, %struct.option* %10, i64 %12
%14 = getelementptr inbounds %struct.option, %struct.option* %13, i32 0, i32 0
%15 = load i32*, i32** %14
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %21
17: ; preds = %9
br label %18
18: ; preds = %17
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %9
21: ; preds = %9
%22 = load i32, i32* %4
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %7
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
%struct.option = type { i32* }
define i32 @opt_size(%struct.option* %0) {
%2 = icmp eq %struct.option* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds %struct.option, %struct.option* %0, i64 %4, i32 0
%6 = load i32*, i32** %5
%7 = icmp eq i32* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
int secret() { return -2; }


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

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

LLVM IR (-O0):
define i32 @secret() {
ret i32 -2
}

LLVM IR (-O2):
define i32 @secret() {
ret i32 -2
}
void toto() {
  char buffer[4096];
  buffer[0] = 0;
  toto();
}


x86 assembly (clang, -O0):
<toto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1000,%rsp
movb   $0x0,-0x1000(%rbp)
call   1030 <toto@plt>
add    $0x1000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toto>:
jmp    1100 <toto>

LLVM IR (-O0):
define void @toto() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
ret void
}

LLVM IR (-O2):
define void @toto() {
br label %1
1: ; preds = %1, %0
br label %1
}