xunge/DecIR huggingface dataset:
int is_ln(char *buffer) {
  int position;
  bwx_DEBUG(__FUNCTION__);
  position = 0;
  adv_ws(buffer, &position);
  switch (buffer[position]) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    return -1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x15(%rbp)
call   1030 <bwx_DEBUG@plt>
mov    -0x15(%rbp),%al
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <adv_ws@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0xffffffd0,%eax
sub    $0x9,%eax
ja     117d <is_ln+0x5d>
jmp    1171 <is_ln+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <is_ln+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ln>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <bwx_DEBUG@plt>
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <adv_ws@plt>
movslq 0xc(%rsp),%rax
movsbl (%rbx,%rax,1),%eax
add    $0xffffffd0,%eax
cmp    $0xa,%eax
sbb    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__FUNCTION__.is_ln = [6 x i8] c"is_ln\00"
define i32 @is_ln(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.is_ln, i64 0, i64 0))
store i32 0, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @adv_ws to i32 (i8*, i32*, ...)*)(i8* %6, i32* %4)
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %15 [
i32 48, label %14
i32 49, label %14
i32 50, label %14
i32 51, label %14
i32 52, label %14
i32 53, label %14
i32 54, label %14
i32 55, label %14
i32 56, label %14
i32 57, label %14
]
14: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 -1, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@__FUNCTION__.is_ln = [6 x i8] c"is_ln\00"
define i32 @is_ln(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.is_ln, i64 0, i64 0))
store i32 0, i32* %2
%5 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @adv_ws to i32 (i8*, i32*, ...)*)(i8* %0, i32* %2)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = add nsw i32 %10, -48
%12 = icmp ult i32 %11, 10
%13 = sext i1 %12 to i32
ret i32 %13
}
OP(ed, f1) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ s;

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void what_time() {
  time_t t = time(NULL);
  struct tm *tm = localtime(&t);
  char s[64];
  strftime(s, sizeof(s), "%c", tm);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<what_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x40,%esi
lea    0xe8b(%rip),%rdx
call   1060 <strftime@plt>
lea    -0x50(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<what_time>:
push   %rbx
sub    $0x50,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe9f(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
lea    0xe86(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @what_time() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca [64 x i8]
%4 = call i32 @time(i32* null)
store i32 %4, i32* %1
%5 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %5, %struct.tm** %2
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%7 = load %struct.tm*, %struct.tm** %2
%8 = call i32 @strftime(i8* %6, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @what_time() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %1
%5 = call %struct.tm* @localtime(i32* %1)
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%7 = call i32 @strftime(i8* %6, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}
int e06_kad_validation(int encrypt_mode, int ukad, int akad) {
  int count = 0;
  if (ukad > 0 || akad > 12)
    count = 1;
  if (!encrypt_mode && (ukad || akad))
    count = 1;
  return count;
}


x86 assembly (clang, -O0):
<e06_kad_validation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1128 <e06_kad_validation+0x28>
cmpl   $0xc,-0xc(%rbp)
jle    112f <e06_kad_validation+0x2f>
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1154 <e06_kad_validation+0x54>
cmpl   $0x0,-0x8(%rbp)
jne    114d <e06_kad_validation+0x4d>
cmpl   $0x0,-0xc(%rbp)
je     1154 <e06_kad_validation+0x54>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e06_kad_validation>:
test   %esi,%esi
setg   %al
cmp    $0xd,%edx
setge  %cl
or     %al,%cl
test   %edi,%edi
sete   %al
or     %esi,%edx
setne  %dl
and    %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @e06_kad_validation(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
%5 = icmp sgt i32 %2, 12
%6 = or i1 %4, %5
%7 = icmp eq i32 %0, 0
%8 = or i32 %2, %1
%9 = icmp ne i32 %8, 0
%10 = and i1 %7, %9
%11 = or i1 %6, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ flushall();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ pass_by_value(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int initial_number = 1;
  printf("initial_number is %d\n", initial_number);
  getchar();
  pass_by_value(initial_number);
  getchar();
  printf("\ninitial_number is still %d\n", initial_number);
  getchar();
  flushall();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%edi
call   1060 <pass_by_value@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1040 <flushall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    $0x1,%edi
call   1060 <pass_by_value@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xea5(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1040 <flushall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"initial_number is %d\0A\00"
@.str.1 = [29 x i8] c"\0Ainitial_number is still %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @getchar()
%5 = load i32, i32* %1
%6 = call i32 @pass_by_value(i32 %5)
%7 = call i32 (...) @getchar()
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @getchar()
%11 = call i32 (...) @flushall()
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"initial_number is %d\0A\00"
@.str.1 = [29 x i8] c"\0Ainitial_number is still %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 @pass_by_value(i32 1)
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = tail call i32 (...) @getchar()
%7 = tail call i32 (...) @flushall()
ret i32 0
}
void XtOpenDisplay() {}


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

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

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

LLVM IR (-O2):
define void @XtOpenDisplay() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stderr;
void rejectFile(FILE *file, char name[]) {
  fclose(file);
  fprintf(stderr, "Please, provide a valid 1-bit BMP file: ");
  scanf("%s", name);
  file = fopen(name, "r");
}


x86 assembly (clang, -O0):
<rejectFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rejectFile>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fclose@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <fopen@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Please, provide a valid 1-bit BMP file: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"r\00"
define void @rejectFile(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 @fclose(i32* %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %4
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %4
%12 = call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %12, i32** %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Please, provide a valid 1-bit BMP file: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"r\00"
define void @rejectFile(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fclose(i32* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%7 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void __bid_is754(int *retval) { *retval = 0; }


x86 assembly (clang, -O0):
<__bid_is754>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bid_is754>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @__bid_is754(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Type definitions */
struct sd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reg_w(struct sd *, int, int);
void w9968cf_stop0(struct sd *sd) {
  reg_w(sd, 0x39, 0x0000);
  reg_w(sd, 0x16, 0x0000);
}


x86 assembly (clang, -O0):
<w9968cf_stop0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x39,%esi
xor    %edx,%edx
call   1030 <reg_w@plt>
mov    -0x8(%rbp),%rdi
mov    $0x16,%esi
xor    %edx,%edx
call   1030 <reg_w@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w9968cf_stop0>:
push   %rbx
mov    %rdi,%rbx
mov    $0x39,%esi
xor    %edx,%edx
call   1030 <reg_w@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <reg_w@plt>

LLVM IR (-O0):
%struct.sd = type { i32 }
define void @w9968cf_stop0(%struct.sd* %0) {
%2 = alloca %struct.sd*
store %struct.sd* %0, %struct.sd** %2
%3 = load %struct.sd*, %struct.sd** %2
%4 = call i32 @reg_w(%struct.sd* %3, i32 57, i32 0)
%5 = load %struct.sd*, %struct.sd** %2
%6 = call i32 @reg_w(%struct.sd* %5, i32 22, i32 0)
ret void
}

LLVM IR (-O2):
%struct.sd = type { i32 }
define void @w9968cf_stop0(%struct.sd* %0) {
%2 = tail call i32 @reg_w(%struct.sd* %0, i32 57, i32 0)
%3 = tail call i32 @reg_w(%struct.sd* %0, i32 22, i32 0)
ret void
}
int grantpt(int fildes) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<grantpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xedc(%rip),%rsi
lea    0xee7(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1132 <grantpt+0x22>

x86 assembly (clang, -O2):
<grantpt>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <grantpt+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.grantpt = [8 x i8] c"grantpt\00"
define i32 @grantpt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.grantpt, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.grantpt = [8 x i8] c"grantpt\00"
define i32 @grantpt(i32 %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.grantpt, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
int start_number(middle, s)
int middle, s;
{ return (middle - (5 + s - 1) / 2); }


x86 assembly (clang, -O0):
<start_number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x5,%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_number>:
mov    %edi,%eax
mov    %esi,%ecx
add    $0x4,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
add    $0x4,%ecx
sar    %ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @start_number(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 4
%4 = sdiv i32 %3, -2
%5 = add i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int alloc_failed(void) {
  fprintf(stderr, "fuse: memory allocation failed\n");
  return -1;
}


x86 assembly (clang, -O0):
<alloc_failed>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_failed>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"fuse: memory allocation failed\0A\00"
define i32 @alloc_failed() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"fuse: memory allocation failed\0A\00"
define i32 @alloc_failed() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
char *stringtoken(char *, char, int *);
void getit(char *buf, char **x, char **y) {
  int i;
  buf++;
  i = 0;
  *x = stringtoken(buf, ':', &i);
  *y = stringtoken(buf, ':', &i);
}


x86 assembly (clang, -O0):
<getit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
lea    -0x1c(%rbp),%rdx
call   1030 <stringtoken@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
lea    -0x1c(%rbp),%rdx
call   1030 <stringtoken@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getit>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
add    $0x1,%rbx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r12
mov    %rbx,%rdi
mov    $0x3a,%esi
mov    %r12,%rdx
call   1030 <stringtoken@plt>
mov    %rax,(%r15)
mov    %rbx,%rdi
mov    $0x3a,%esi
mov    %r12,%rdx
call   1030 <stringtoken@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @getit(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
store i32 0, i32* %7
%10 = load i8*, i8** %4
%11 = call i8* @stringtoken(i8* %10, i8 signext 58, i32* %7)
%12 = load i8**, i8*** %5
store i8* %11, i8** %12
%13 = load i8*, i8** %4
%14 = call i8* @stringtoken(i8* %13, i8 signext 58, i32* %7)
%15 = load i8**, i8*** %6
store i8* %14, i8** %15
ret void
}

LLVM IR (-O2):
define void @getit(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i32 0, i32* %4
%7 = call i8* @stringtoken(i8* %6, i8 signext 58, i32* %4)
store i8* %7, i8** %1
%8 = call i8* @stringtoken(i8* %6, i8 signext 58, i32* %4)
store i8* %8, i8** %2
ret void
}
/* Type definitions */
struct AMCMemPool {
  int dummy;
};

/* Variables and functions */
struct AMCMemPool *_memPool_Create_WithLock(unsigned long, unsigned long,
                                            unsigned long, long);
struct AMCMemPool *AMCMemPool_Create(unsigned long unitSize,
                                     unsigned long initUnitCount,
                                     unsigned long growUnitCount,
                                     long useLock) {
  return _memPool_Create_WithLock(unitSize, initUnitCount, growUnitCount,
                                  useLock);
}


x86 assembly (clang, -O0):
<AMCMemPool_Create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <_memPool_Create_WithLock@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCMemPool_Create>:
jmp    1030 <_memPool_Create_WithLock@plt>

LLVM IR (-O0):
%struct.AMCMemPool = type { i32 }
define %struct.AMCMemPool* @AMCMemPool_Create(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call %struct.AMCMemPool* @_memPool_Create_WithLock(i64 %9, i64 %10, i64 %11, i64 %12)
ret %struct.AMCMemPool* %13
}

LLVM IR (-O2):
%struct.AMCMemPool = type { i32 }
define %struct.AMCMemPool* @AMCMemPool_Create(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call %struct.AMCMemPool* @_memPool_Create_WithLock(i64 %0, i64 %1, i64 %2, i64 %3)
ret %struct.AMCMemPool* %5
}
trc() {}


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

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

LLVM IR (-O0):
define i32 @trc() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @trc() {
ret i32 undef
}
/* Type definitions */
struct client_socket_params {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_client_socket_params(struct client_socket_params **);
void cleanup_custom_data_client_socket_params(void *client_socket_params_struct,
                                              unsigned long int length) {
  struct client_socket_params *params =
      (struct client_socket_params *)client_socket_params_struct;
  free_client_socket_params(&params);
  if (length) {
  }
}


x86 assembly (clang, -O0):
<cleanup_custom_data_client_socket_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <free_client_socket_params@plt>
cmpq   $0x0,-0x10(%rbp)
je     1141 <cleanup_custom_data_client_socket_params+0x31>
jmp    1141 <cleanup_custom_data_client_socket_params+0x31>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_custom_data_client_socket_params>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <free_client_socket_params@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.client_socket_params = type { i32 }
define void @cleanup_custom_data_client_socket_params(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca %struct.client_socket_params*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.client_socket_params*
store %struct.client_socket_params* %7, %struct.client_socket_params** %5
%8 = call i32 @free_client_socket_params(%struct.client_socket_params** %5)
%9 = load i64, i64* %4
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.client_socket_params = type { i32 }
define void @cleanup_custom_data_client_socket_params(i8* %0, i64 %1) {
%3 = alloca %struct.client_socket_params*
%4 = bitcast %struct.client_socket_params** %3 to i8*
%5 = bitcast %struct.client_socket_params** %3 to i8**
store i8* %0, i8** %5
%6 = call i32 @free_client_socket_params(%struct.client_socket_params** %3)
ret void
}
/* Variables and functions */
unsigned char *aes192cbc_decrypt(unsigned char *, size_t *,
                                 unsigned char const *, size_t,
                                 unsigned char const *, unsigned char const *);
unsigned char *crypt_decrypt_aes192cbc(unsigned char *out, size_t *out_len,
                                       const unsigned char *in, size_t in_len,
                                       const unsigned char *nonce,
                                       const unsigned char *key) {
  return aes192cbc_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_aes192cbc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <aes192cbc_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_aes192cbc>:
jmp    1030 <aes192cbc_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_aes192cbc(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @aes192cbc_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_aes192cbc(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @aes192cbc_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t unix_time_now() {
  time_t now;
  time(&now);
  return now;
}


x86 assembly (clang, -O0):
<unix_time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <time@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_time_now>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <time@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @unix_time_now() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @unix_time_now() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
int get_line_length(cp)
register char *cp;
{
  register int len;
  len = 0;
  while (*cp && *cp != '\n') {
    ++cp;
    ++len;
  }
  if (*cp == '\n')
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<get_line_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1134 <get_line_length+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <get_line_length+0x44>
jmp    115e <get_line_length+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_line_length+0xf>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1177 <get_line_length+0x77>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line_length>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%edx
test   %dl,%dl
je     1123 <get_line_length+0x23>
cmp    $0xa,%dl
je     1123 <get_line_length+0x23>
add    $0x1,%rcx
jmp    1110 <get_line_length+0x10>
xor    %eax,%eax
cmp    $0xa,%dl
sete   %al
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_line_length(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = phi i32 [ 0, %1 ], [ %8, %6 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %9
i8 10, label %9
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = add nuw nsw i32 %4, 1
br label %2
9: ; preds = %2, %2
%10 = icmp eq i8 %5, 10
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %4, %11
ret i32 %12
}
long sun_time2timeofday(int hour, int min, int sec) {
  return ((long)hour) * 3600 + ((long)min) * 60 + ((long)sec);
}


x86 assembly (clang, -O0):
<sun_time2timeofday>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x4(%rbp),%rax
imul   $0xe10,%rax,%rax
movslq -0x8(%rbp),%rcx
imul   $0x3c,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun_time2timeofday>:
movslq %edi,%rax
imul   $0xe10,%rax,%rax
movslq %esi,%rcx
imul   $0x3c,%rcx,%rcx
add    %rax,%rcx
movslq %edx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @sun_time2timeofday(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul nsw i64 %8, 3600
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = mul nsw i64 %11, 60
%13 = add nsw i64 %9, %12
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = add nsw i64 %13, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @sun_time2timeofday(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = mul nsw i64 %4, 3600
%6 = sext i32 %1 to i64
%7 = mul nsw i64 %6, 60
%8 = add nsw i64 %7, %5
%9 = sext i32 %2 to i64
%10 = add nsw i64 %8, %9
ret i64 %10
}
char *procprt_WRDSK_e(struct tstat *curstat, int avgval, int nsecs) {
  return "     -";
}


x86 assembly (clang, -O0):
<procprt_WRDSK_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_WRDSK_e>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [7 x i8] c" -\00"
define i8* @procprt_WRDSK_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [7 x i8] c" -\00"
define i8* @procprt_WRDSK_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int foo();
int mod2_bar(void) { return foo(); }


x86 assembly (clang, -O0):
<mod2_bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2_bar>:
xor    %eax,%eax
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @mod2_bar() {
%1 = call i32 (...) @foo()
ret i32 %1
}

LLVM IR (-O2):
define i32 @mod2_bar() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
int use_macro() { int a = 1; }


x86 assembly (clang, -O0):
<use_macro>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @use_macro() {
ret i32 undef
}
long rdrand_long(unsigned long *v) {
  int ok;
  asm volatile("1: "
               ".byte 0x48,0x0f,0xc7,0xf0"
               "\n\t"
               "jc 2f\n\t"
               "decl %0\n\t"
               "jnz 1b\n\t"
               "2:"
               : "=r"(ok), "=a"(*v)
               : "0"(10));
  return ok;
}


x86 assembly (clang, -O0):
<rdrand_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0xa,%edx
rdrand %rax
jb     1127 <rdrand_long+0x27>
dec    %edx
jne    1115 <rdrand_long+0x15>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %edx,-0xc(%rbp)
mov    %rcx,(%rax)
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdrand_long>:
mov    $0xa,%ecx
rdrand %rax
jb     110f <rdrand_long+0xf>
dec    %ecx
jne    1105 <rdrand_long+0x5>
mov    %rax,(%rdi)
movslq %ecx,%rax
ret

LLVM IR (-O0):
define i64 @rdrand_long(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = call { i32, i64 } asm sideeffect "1: .byte 0x48,0x0f,0xc7,0xf0\0A\09jc 2f\0A\09decl $0\0A\09jnz 1b\0A\092:", "=r,={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 10)
%6 = extractvalue { i32, i64 } %5, 0
%7 = extractvalue { i32, i64 } %5, 1
store i32 %6, i32* %3
store i64 %7, i64* %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @rdrand_long(i64* nocapture writeonly %0) {
%2 = tail call { i32, i64 } asm sideeffect "1: .byte 0x48,0x0f,0xc7,0xf0\0A\09jc 2f\0A\09decl $0\0A\09jnz 1b\0A\092:", "=r,={ax},0,~{dirflag},~{fpsr},~{flags}"(i32 10)
%3 = extractvalue { i32, i64 } %2, 0
%4 = extractvalue { i32, i64 } %2, 1
store i64 %4, i64* %0
%5 = sext i32 %3 to i64
ret i64 %5
}
OP(dd, e6) {
  illegal_1();
  op_e6();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_e6@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_e6@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_e6()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_e6()
ret i32 undef
}
int util_bin_to_byte(unsigned char *src, unsigned char *dst) {
  if (*src == 0x7d) {
    *dst = (*(++src)) ^ 0x20;
    return 2;
  } else {
    *dst = *src;
    return 1;
  }
}


x86 assembly (clang, -O0):
<util_bin_to_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x7d,%eax
jne    1146 <util_bin_to_byte+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl 0x1(%rax),%eax
xor    $0x20,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    1159 <util_bin_to_byte+0x59>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_bin_to_byte>:
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    $0x7d,%cl
jne    1117 <util_bin_to_byte+0x17>
mov    0x1(%rdi),%cl
xor    $0x20,%cl
mov    $0x2,%eax
mov    %cl,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @util_bin_to_byte(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 125
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = xor i8 %7, 32
br label %9
9: ; preds = %2, %5
%10 = phi i8 [ %8, %5 ], [ %3, %2 ]
%11 = phi i32 [ 2, %5 ], [ 1, %2 ]
store i8 %10, i8* %1
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_storel_epi64(void *, int /*<<< orphan*/);
void test_mm_storel_epi64(__m128i x, void *y) { _mm_storel_epi64(y, x); }


x86 assembly (clang, -O0):
<test_mm_storel_epi64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <_mm_storel_epi64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_storel_epi64>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <_mm_storel_epi64@plt>

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

LLVM IR (-O2):
define void @test_mm_storel_epi64(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_storel_epi64(i8* %1, i32 %0)
ret void
}
unsigned long thread_get_id(void) {
  static unsigned long int counter = 0;
  return ++counter;
}


x86 assembly (clang, -O0):
<thread_get_id>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1d(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f12(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_get_id>:
mov    0x2f21(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f16(%rip)
ret

LLVM IR (-O0):
@thread_get_id.counter = internal global i64 0
define i64 @thread_get_id() {
%1 = load i64, i64* @thread_get_id.counter
%2 = add i64 %1, 1
store i64 %2, i64* @thread_get_id.counter
ret i64 %2
}

LLVM IR (-O2):
@thread_get_id.counter = internal unnamed_addr global i64 0
define i64 @thread_get_id() {
%1 = load i64, i64* @thread_get_id.counter
%2 = add i64 %1, 1
store i64 %2, i64* @thread_get_id.counter
ret i64 %2
}
/* Variables and functions */
int strcmp(void *, void *);
int compar_char(void *c1, void *c2) { return strcmp(c1, c2); }


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

x86 assembly (clang, -O2):
<compar_char>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compar_char(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void foo285() {}


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

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

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

LLVM IR (-O2):
define void @foo285() {
ret void
}
void foo_1_2_1_2_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_2_2_1_1() {
ret void
}
int sumFunc(int a1, int a2) { return a1 + a2; }


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

x86 assembly (clang, -O2):
<sumFunc>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @sumFunc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @sumFunc(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int fingerprintgre(struct libalias *la, struct ip *pip, struct alias_data *ah) {
  return (0);
}


x86 assembly (clang, -O0):
<fingerprintgre>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fingerprintgre>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.libalias = type opaque
%struct.ip = type opaque
%struct.alias_data = type opaque
define i32 @fingerprintgre(%struct.libalias* %0, %struct.ip* %1, %struct.alias_data* %2) {
%4 = alloca %struct.libalias*
%5 = alloca %struct.ip*
%6 = alloca %struct.alias_data*
store %struct.libalias* %0, %struct.libalias** %4
store %struct.ip* %1, %struct.ip** %5
store %struct.alias_data* %2, %struct.alias_data** %6
ret i32 0
}

LLVM IR (-O2):
%struct.libalias = type opaque
%struct.ip = type opaque
%struct.alias_data = type opaque
define i32 @fingerprintgre(%struct.libalias* nocapture readnone %0, %struct.ip* nocapture readnone %1, %struct.alias_data* nocapture readnone %2) {
ret i32 0
}
int genchdir(const char *directory) { return -1; }


x86 assembly (clang, -O0):
<genchdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @genchdir(i8* nocapture readnone %0) {
ret i32 -1
}
int f(int i) { return i - 1; }


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

x86 assembly (clang, -O2):
<f>:
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
signed int rt_cond_signal(union anon$42 *cvp) {
  signed int status = 0;
  status = pthread_cond_signal(cvp);
  return status;
}


x86 assembly (clang, -O0):
<rt_cond_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <pthread_cond_signal@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_cond_signal>:
xor    %eax,%eax
jmp    1030 <pthread_cond_signal@plt>

LLVM IR (-O0):
%"union.anon$42" = type opaque
define i32 @rt_cond_signal(%"union.anon$42"* %0) {
%2 = alloca %"union.anon$42"*
%3 = alloca i32
store %"union.anon$42"* %0, %"union.anon$42"** %2
store i32 0, i32* %3
%4 = load %"union.anon$42"*, %"union.anon$42"** %2
%5 = call i32 (%"union.anon$42"*, ...) bitcast (i32 (...)* @pthread_cond_signal to i32 (%"union.anon$42"*, ...)*)(%"union.anon$42"* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%"union.anon$42" = type opaque
define i32 @rt_cond_signal(%"union.anon$42"* %0) {
%2 = tail call i32 (%"union.anon$42"*, ...) bitcast (i32 (...)* @pthread_cond_signal to i32 (%"union.anon$42"*, ...)*)(%"union.anon$42"* %0)
ret i32 %2
}
int is_uv_hubbed(int uv) { return 0; }


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

x86 assembly (clang, -O2):
<is_uv_hubbed>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_uv_hubbed(i32 %0) {
ret i32 0
}
int Operand_uimm8_decode(unsigned int *valp) {
  unsigned uimm8_0, imm8_0;
  imm8_0 = *valp & 0xff;
  uimm8_0 = imm8_0;
  *valp = uimm8_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_uimm8_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_uimm8_decode>:
movzbl (%rdi),%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_uimm8_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 255
store i32 %7, i32* %4
%8 = load i32, i32* %4
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
store i32 %9, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_uimm8_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 255
store i32 %3, i32* %0
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t ones_to_twos_complement4(int32_t num) {
  return num < 0 ? num + 1 : num;
}


x86 assembly (clang, -O0):
<ones_to_twos_complement4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1124 <ones_to_twos_complement4+0x24>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <ones_to_twos_complement4+0x2c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones_to_twos_complement4>:
mov    %rdi,%rax
shr    $0x3f,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ones_to_twos_complement4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = add nsw i64 %6, 1
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @ones_to_twos_complement4(i64 %0) {
%2 = lshr i64 %0, 63
%3 = add nsw i64 %2, %0
ret i64 %3
}