xunge/DecIR huggingface dataset:
__attribute__((__const__)) int is_leap_year(const int year) {
  if (year % 400 == 0)
    return 1;
  if (year % 100 == 0)
    return 0;
  if (year % 4 == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <is_leap_year+0x27>
movl   $0x1,-0x4(%rbp)
jmp    116e <is_leap_year+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <is_leap_year+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <is_leap_year+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <is_leap_year+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <is_leap_year+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <is_leap_year+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <is_leap_year+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = srem i32 %9, 100
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = srem i32 %14, 4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %2
br label %19
18: ; preds = %13
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn67() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn67");
  return result;
}


x86 assembly (clang, -O0):
<fn67>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn67>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn67\00"
define i8* @fn67() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn67\00"
define i8* @fn67() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy7(int *x, int *y) { memcpy(x, y, 7); }


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

x86 assembly (clang, -O2):
<copy7>:
mov    $0x7,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy7(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 = call i32 @memcpy(i32* %5, i32* %6, i32 7)
ret void
}

LLVM IR (-O2):
define void @copy7(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 7)
ret void
}
/* Variables and functions */
long remainder(long dividend, long divisor) {
  long res;
  res = dividend / divisor;
  res = dividend - res * divisor;
  if (res < 0) {
    res = res + divisor;
  }
  return res;
}


x86 assembly (clang, -O0):
<remainder>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    1145 <remainder+0x45>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainder>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <remainder+0x16>
cqto
idiv   %rsi
jmp    111a <remainder+0x1a>
xor    %edx,%edx
div    %esi
mov    %rdx,%rax
sar    $0x3f,%rax
and    %rsi,%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @remainder(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sdiv i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = load i64, i64* %5
%11 = load i64, i64* %4
%12 = mul nsw i64 %10, %11
%13 = sub nsw i64 %9, %12
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load i64, i64* %5
%18 = load i64, i64* %4
%19 = add nsw i64 %17, %18
store i64 %19, i64* %5
br label %20
20: ; preds = %16, %2
%21 = load i64, i64* %5
ret i64 %21
}

LLVM IR (-O2):
define i64 @remainder(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
%4 = icmp slt i64 %3, 0
%5 = select i1 %4, i64 %1, i64 0
%6 = add nsw i64 %5, %3
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ M_PI;
int /*<<< orphan*/ cos(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(int /*<<< orphan*/);
int main() {
  printf("The value of PI is %lf\n", M_PI);
  printf("The value of COS(PI) is %lf\n", cos(M_PI));
  printf("The sqrt(PI) is %lf\n", sqrt(M_PI));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <cos@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <sqrt@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1040 <cos@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1050 <sqrt@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"The value of PI is %lf\0A\00"
@M_PI = global i32 0
@.str.1 = [29 x i8] c"The value of COS(PI) is %lf\0A\00"
@.str.2 = [21 x i8] c"The sqrt(PI) is %lf\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @M_PI
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @M_PI
%5 = call i32 @cos(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @M_PI
%8 = call i32 @sqrt(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The value of PI is %lf\0A\00"
@M_PI = global i32 0
@.str.1 = [29 x i8] c"The value of COS(PI) is %lf\0A\00"
@.str.2 = [21 x i8] c"The sqrt(PI) is %lf\0A\00"
define i32 @main() {
%1 = load i32, i32* @M_PI
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @M_PI
%4 = tail call i32 @cos(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @M_PI
%7 = tail call i32 @sqrt(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int inject(char *);
enum nss_status _nss_inject_gethostbyname_r(const char *name,
                                            struct hostent *result,
                                            char *buffer, size_t buflen,
                                            int *errnop, int *h_errnop) {
  return inject("gethostbyname");
}


x86 assembly (clang, -O0):
<_nss_inject_gethostbyname_r>:
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)
lea    0xec9(%rip),%rdi
call   1030 <inject@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.hostent = type { i32 }
@.str = [14 x i8] c"gethostbyname\00"
define i32 @_nss_inject_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca %struct.hostent*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i32*
store i8* %0, i8** %7
store %struct.hostent* %1, %struct.hostent** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = call i32 @inject(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %13
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@.str = [14 x i8] c"gethostbyname\00"
define i32 @_nss_inject_gethostbyname_r(i8* nocapture readnone %0, %struct.hostent* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = tail call i32 @inject(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}
void res1_except() {}


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

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

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

LLVM IR (-O2):
define void @res1_except() {
ret void
}
/* Variables and functions */
int O_CREAT;
int O_RDONLY;
int open(char *, int, int);
int /*<<< orphan*/ perror(char *);
int open_file(char *name) {
  int fd;
  if ((fd = open(name, O_RDONLY | O_CREAT, 0700)) < 0) {
    perror("open");
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
or     (%rax),%esi
mov    $0x1c0,%edx
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1164 <open_file+0x44>
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1c0,%edx
call   1030 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1147 <open_file+0x27>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb2(%rip),%rdi
call   1040 <perror@plt>
jmp    1143 <open_file+0x23>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
@.str = [5 x i8] c"open\00"
define i32 @open_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDONLY
%6 = load i32, i32* @O_CREAT
%7 = or i32 %5, %6
%8 = call i32 @open(i8* %4, i32 %7, i32 448)
store i32 %8, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
@.str = [5 x i8] c"open\00"
define i32 @open_file(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4, i32 448)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "unlink", message); }


x86 assembly (clang, -O0):
<g_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [7 x i8] c"unlink\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Com_sprintf(char *, int, char *, ...);
void CL_DemoFilename(int number, char *fileName) {
  if (number < 0 || number > 9999) {
    Com_sprintf(fileName, 256, "demo9999");
    return;
  }
  Com_sprintf(fileName, 256, "demo%04i", number);
}


x86 assembly (clang, -O0):
<CL_DemoFilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1136 <CL_DemoFilename+0x26>
cmpl   $0x270f,-0x4(%rbp)
jle    1152 <CL_DemoFilename+0x42>
mov    -0x10(%rbp),%rdi
mov    $0x100,%esi
lea    0xeba(%rip),%rdx
mov    $0x0,%al
call   1030 <Com_sprintf@plt>
jmp    116c <CL_DemoFilename+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x100,%esi
lea    0xea4(%rip),%rdx
mov    $0x0,%al
call   1030 <Com_sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_DemoFilename>:
cmp    $0x2710,%edi
jb     112e <CL_DemoFilename+0x1e>
lea    0xee1(%rip),%rdx
mov    %rsi,%rdi
mov    $0x100,%esi
xor    %eax,%eax
jmp    1030 <Com_sprintf@plt>
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsi,%rdi
mov    $0x100,%esi
xor    %eax,%eax
jmp    1030 <Com_sprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"demo9999\00"
@.str.1 = [9 x i8] c"demo%04i\00"
define void @CL_DemoFilename(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 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 9999
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %11, i32 256, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %17
13: ; preds = %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %3
%16 = call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %14, i32 256, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"demo9999\00"
@.str.1 = [9 x i8] c"demo%04i\00"
define void @CL_DemoFilename(i32 %0, i8* %1) {
%3 = icmp ugt i32 %0, 9999
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %1, i32 256, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %1, i32 256, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int ntohl(int);
int read_int(char **ptr, char *end) {
  if (*ptr + 4 > end)
    return 0;
  int res = ntohl(*((int *)*ptr));
  *ptr += 4;
  return res;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x4,%rax
cmp    -0x18(%rbp),%rax
jbe    1141 <read_int+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1166 <read_int+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <ntohl@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rax
lea    0x4(%rax),%rbx
cmp    %rsi,%rbx
jbe    1124 <read_int+0x14>
xor    %eax,%eax
jmp    1131 <read_int+0x21>
mov    %rdi,%r14
mov    (%rax),%edi
call   1030 <ntohl@plt>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @read_int(i8** nocapture %0, i8* readnone %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = icmp ugt i8* %4, %1
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = bitcast i8* %3 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @ntohl(i32 %8)
store i8* %4, i8** %0
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
char *strcpy(char *__restrict __dest, __const char *__restrict __src) {
  while ((*__dest++ = *__src++))
    ;
  return __dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strcpy+0x3b>
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias writeonly %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_trip_start();
void roadmap_start_trip(void) { roadmap_trip_start(); }


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

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

LLVM IR (-O0):
define void @roadmap_start_trip() {
%1 = call i32 (...) @roadmap_trip_start()
ret void
}

LLVM IR (-O2):
define void @roadmap_start_trip() {
%1 = tail call i32 (...) @roadmap_trip_start()
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
unsigned long strtoul(char const *, char **, int);
uint32_t __attribute__((always_))
strtou32(const char *nptr, char **endptr, int base) {
  unsigned long int val = strtoul(nptr, endptr, base);
  if (sizeof(long int) > 4 && val > 0xffffffff)
    val = 0xffffffff;
  return val;
}


x86 assembly (clang, -O0):
<strtou32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtoul@plt>
mov    %rax,-0x20(%rbp)
mov    $0xffffffff,%eax
cmp    %rax,-0x20(%rbp)
jbe    114f <strtou32+0x3f>
mov    $0xffffffff,%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtou32>:
push   %rax
call   1030 <strtoul@plt>
mov    $0xffffffff,%ecx
cmp    %rcx,%rax
cmovae %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @strtou32(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
%5 = icmp ult i64 %4, 4294967295
%6 = select i1 %5, i64 %4, i64 4294967295
ret i64 %6
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
main(void) {
  int c;
  int nl = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\n')
      nl++;
  }
  printf("número de lineas: %d\n", nl);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1167 <main+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [23 x i8] c"n\C3\BAmero de lineas: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %14, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [23 x i8] c"n\C3\BAmero de lineas: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Test program\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Test program\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 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Test program\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo_1_1_2_2_2_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_2_1_1_1_2() {
ret void
}
/* Variables and functions */
int rj_writeword(int, int);
int rj_setservo(int chan, int usec) { return rj_writeword(chan, usec); }


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

x86 assembly (clang, -O2):
<rj_setservo>:
jmp    1030 <rj_writeword@plt>

LLVM IR (-O0):
define i32 @rj_setservo(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 = call i32 @rj_writeword(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rj_setservo(i32 %0, i32 %1) {
%3 = tail call i32 @rj_writeword(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ out_char(char);
void out_string(char *str) {
  while (*str) {
    out_char(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<out_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <out_string+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <out_char@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <out_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <out_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <out_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <out_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @out_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @out_char(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
unsigned xrop3_141_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_141_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_141_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rdi,%rax,1),%ecx
shl    $0x8,%esi
xor    %esi,%eax
or     $0xff,%eax
xor    %ecx,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_141_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = xor i32 %7, %4
%9 = or i32 %8, 255
%10 = xor i32 %5, %9
%11 = xor i32 %10, -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ SIGILL;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int main() {
  raise(SIGILL);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGILL = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SIGILL
%3 = call i32 @raise(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@SIGILL = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGILL
%2 = tail call i32 @raise(i32 %1)
ret i32 0
}
void callback_match_total(void *arg, struct aho_match_t *m) {
  long long int *match_total = (long long int *)arg;
  (*match_total)++;
}


x86 assembly (clang, -O0):
<callback_match_total>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback_match_total>:
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
%struct.aho_match_t = type opaque
define void @callback_match_total(i8* %0, %struct.aho_match_t* %1) {
%3 = alloca i8*
%4 = alloca %struct.aho_match_t*
%5 = alloca i64*
store i8* %0, i8** %3
store %struct.aho_match_t* %1, %struct.aho_match_t** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i64*, i64** %5
%9 = load i64, i64* %8
%10 = add nsw i64 %9, 1
store i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
%struct.aho_match_t = type opaque
define void @callback_match_total(i8* nocapture %0, %struct.aho_match_t* nocapture readnone %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = add nsw i64 %4, 1
store i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void pfatal(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<pfatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pfatal>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @pfatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @pfatal(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int file_valid(char *path) {
  if (access(path, F_OK) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1144 <file_valid+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <file_valid+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_valid>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_valid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @F_OK
%6 = call i64 @access(i8* %4, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_valid(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ log_level(int /*<<< orphan*/);
int log_level_compare(int /*<<< orphan*/, int);
int log_warn_enable() { return log_level_compare(log_level(0), 3); }


x86 assembly (clang, -O0):
<log_warn_enable>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <log_level@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <log_level_compare@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_warn_enable>:
push   %rax
xor    %edi,%edi
call   1030 <log_level@plt>
mov    %eax,%edi
mov    $0x3,%esi
pop    %rax
jmp    1040 <log_level_compare@plt>

LLVM IR (-O0):
define i32 @log_warn_enable() {
%1 = call i32 @log_level(i32 0)
%2 = call i32 @log_level_compare(i32 %1, i32 3)
ret i32 %2
}

LLVM IR (-O2):
define i32 @log_warn_enable() {
%1 = tail call i32 @log_level(i32 0)
%2 = tail call i32 @log_level_compare(i32 %1, i32 3)
ret i32 %2
}
int v9fs_cache_register(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @v9fs_cache_register() {
ret i32 1
}

LLVM IR (-O2):
define i32 @v9fs_cache_register() {
ret i32 1
}
void foo_1_1_2_2_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_1_2_1_2_2() {
ret void
}
int test3() {
  int x, y, z;
  x = y = z = 1;
  if (x > 0) {
    while (x >= 0) {
      while (y >= x) {
        x = x - 1;
        y = y / 2;
      }
    }
  }
  z = y;
  return 0;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1169 <test3+0x69>
jmp    1128 <test3+0x28>
cmpl   $0x0,-0x4(%rbp)
jl     1164 <test3+0x64>
jmp    1137 <test3+0x37>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     115f <test3+0x5f>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1137 <test3+0x37>
jmp    1128 <test3+0x28>
jmp    1169 <test3+0x69>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @test3() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %3
store i32 1, i32* %2
store i32 1, i32* %1
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %22
6: ; preds = %0
br label %7
7: ; preds = %20, %6
%8 = load i32, i32* %1
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %7
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %2
%13 = load i32, i32* %1
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i32, i32* %1
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %1
%18 = load i32, i32* %2
%19 = sdiv i32 %18, 2
store i32 %19, i32* %2
br label %11
20: ; preds = %11
br label %7
21: ; preds = %7
br label %22
22: ; preds = %21, %0
%23 = load i32, i32* %2
store i32 %23, i32* %3
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ process_options(int, char **);
int /*<<< orphan*/ setup_defaults();
void piphoned_commandline_info_from_argv(int argc, char *argv[]) {
  setup_defaults();
  process_options(argc, argv);
}


x86 assembly (clang, -O0):
<piphoned_commandline_info_from_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <setup_defaults@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <process_options@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piphoned_commandline_info_from_argv>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <setup_defaults@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <process_options@plt>

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

LLVM IR (-O2):
define void @piphoned_commandline_info_from_argv(i32 %0, i8** %1) {
%3 = tail call i32 (...) @setup_defaults()
%4 = tail call i32 @process_options(i32 %0, i8** %1)
ret void
}
void enable_int(void) { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_int() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct vioDevice {
  int dummy;
};
struct device {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ writeDevice(int /*<<< orphan*/ *, struct device *);
void vioWriteDevice(FILE *file, struct vioDevice *dev) {
  writeDevice(file, (struct device *)dev);
}


x86 assembly (clang, -O0):
<vioWriteDevice>:
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 <writeDevice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vioWriteDevice>:
jmp    1030 <writeDevice@plt>

LLVM IR (-O0):
%struct.vioDevice = type { i32 }
%struct.device = type { i32 }
define void @vioWriteDevice(i32* %0, %struct.vioDevice* %1) {
%3 = alloca i32*
%4 = alloca %struct.vioDevice*
store i32* %0, i32** %3
store %struct.vioDevice* %1, %struct.vioDevice** %4
%5 = load i32*, i32** %3
%6 = load %struct.vioDevice*, %struct.vioDevice** %4
%7 = bitcast %struct.vioDevice* %6 to %struct.device*
%8 = call i32 @writeDevice(i32* %5, %struct.device* %7)
ret void
}

LLVM IR (-O2):
%struct.vioDevice = type { i32 }
%struct.device = type { i32 }
define void @vioWriteDevice(i32* %0, %struct.vioDevice* %1) {
%3 = bitcast %struct.vioDevice* %1 to %struct.device*
%4 = tail call i32 @writeDevice(i32* %0, %struct.device* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
char *malloc(int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *getDate() {
  time_t t = time(NULL);
  struct tm tm = *gmtime(&t);
  char *date = malloc(150 * sizeof(char));
  strftime(date, 150, "%a, %d %b %Y %H:%M:%S %Z", &tm);
  return date;
}


x86 assembly (clang, -O0):
<getDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1060 <gmtime@plt>
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x96,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x96,%esi
lea    0xe80(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1050 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDate>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1060 <gmtime@plt>
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    $0x96,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe8c(%rip),%rdx
lea    0x8(%rsp),%rcx
mov    %rax,%rdi
mov    $0x96,%esi
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [25 x i8] c"%a, %d %b %Y %H:%M:%S %Z\00"
define i8* @getDate() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = alloca i8*
%4 = call i32 @time(i32* null)
store i32 %4, i32* %1
%5 = call %struct.tm* @gmtime(i32* %1)
%6 = bitcast %struct.tm* %2 to i8*
%7 = bitcast %struct.tm* %5 to i8*
%8 = call i8* @malloc(i32 150)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strftime(i8* %9, i32 150, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [25 x i8] c"%a, %d %b %Y %H:%M:%S %Z\00"
define i8* @getDate() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %1
%5 = bitcast %struct.tm* %2 to i8*
%6 = call %struct.tm* @gmtime(i32* %1)
%7 = getelementptr %struct.tm, %struct.tm* %6, i64 0, i32 0
%8 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
%9 = load i32, i32* %7
store i32 %9, i32* %8
%10 = call dereferenceable_or_null(150) i8* @malloc(i32 150)
%11 = call i32 @strftime(i8* %10, i32 150, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
ret i8* %10
}