xunge/DecIR huggingface dataset:
/* Variables and functions */
int check_password2(char *, char *);
int check_password(char *username) {
  return check_password2("Password: ", username);
}


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

x86 assembly (clang, -O2):
<check_password>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <check_password2@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Password: \00"
define i32 @check_password(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @check_password2(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"Password: \00"
define i32 @check_password(i8* %0) {
%2 = tail call i32 @check_password2(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
const char *true_false(bool b) { return b ? "true" : "false"; }


x86 assembly (clang, -O0):
<true_false>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef4(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<true_false>:
test   %edi,%edi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @true_false(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @true_false(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int calc_md5sum(void *, unsigned char *, unsigned int);
scalar_t__ memcmp(unsigned char *, unsigned char *, int);
int check_md5sum(void *pvFile, unsigned char Digest[16], unsigned fProgress) {
  unsigned char DigestFile[16];
  int rc;
  rc = calc_md5sum(pvFile, DigestFile, fProgress);
  if (!rc)
    rc = memcmp(Digest, DigestFile, 16) ? -1 : 0;
  return rc;
}


x86 assembly (clang, -O0):
<check_md5sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <calc_md5sum@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    1176 <check_md5sum+0x56>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_md5sum>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
call   1040 <calc_md5sum@plt>
test   %eax,%eax
jne    1149 <check_md5sum+0x29>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
call   1030 <memcmp@plt>
neg    %rax
sbb    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_md5sum(i8* %0, i8* %1, i32 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = call i32 @calc_md5sum(i8* %0, i8* %5, i32 %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = call i64 @memcmp(i8* %1, i8* %5, i32 16)
%10 = icmp ne i64 %9, 0
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %8, %3
%13 = phi i32 [ %6, %3 ], [ %11, %8 ]
ret i32 %13
}
int __() {
  int _();
  return _();
}


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

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

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

LLVM IR (-O2):
define i32 @__() {
%1 = tail call i32 (...) @_()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_help() {
  const char msg[] =
      ""
      "Project the spherical harmonic coefficients to a regular mesh\n"
      "\n"
      "Usage: project_geoid infile outfile n_longitude n_latitude\n"
      "\n"
      "infile: name of the CitcomS geoid file\n"
      "outfile: name of the output file.\n"
      "         This file will contain 3 columns (longitude, latitude, geoid)\n"
      "n_longitude: # of grid points in longitude direction for the mesh\n"
      "n_latitude: # of grid points in latitudee direction for the mesh\n";
  fputs(msg, stderr);
  return;
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
lea    -0x190(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x18f,%edx
call   1040 <memcpy@plt>
lea    -0x190(%rbp),%rdi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
sub    $0x190,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x18f,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.print_help.msg = [399 x i8] c"Project the spherical harmonic coefficients to a regular mesh\0A\0AUsage: project_geoid infile outfile n_longitude n_latitude\0A\0Ainfile: name of the CitcomS geoid file\0Aoutfile: name of the output file.\0A This file will contain 3 columns (longitude, latitude, geoid)\0An_longitude: # of grid points in longitude direction for the mesh\0An_latitude: # of grid points in latitudee direction for the mesh\0A\00"
@stderr = global i32 0
define void @print_help() {
%1 = alloca [399 x i8]
%2 = bitcast [399 x i8]* %1 to i8*
%3 = getelementptr inbounds [399 x i8], [399 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@__const.print_help.msg = [399 x i8] c"Project the spherical harmonic coefficients to a regular mesh\0A\0AUsage: project_geoid infile outfile n_longitude n_latitude\0A\0Ainfile: name of the CitcomS geoid file\0Aoutfile: name of the output file.\0A This file will contain 3 columns (longitude, latitude, geoid)\0An_longitude: # of grid points in longitude direction for the mesh\0An_latitude: # of grid points in latitudee direction for the mesh\0A\00"
@stderr = global i32 0
define void @print_help() {
%1 = alloca [399 x i8]
%2 = getelementptr inbounds [399 x i8], [399 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* %2, i32 %3)
ret void
}
float my_fabs(float x) {
  if (x < 0)
    return -x;
  return x;
}


x86 assembly (clang, -O0):
<my_fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <my_fabs+0x32>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113c <my_fabs+0x3c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @my_fabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fneg float %7
store float %8, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @my_fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int strlen(char *);
void str_trim(char *str) {
  int i;
  for (i = strlen(str) - 1; i >= 0; i--) {
    if (str[i] != ' ') {
      str[i + 1] = '\0';
      break;
    }
  }
}


x86 assembly (clang, -O0):
<str_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1173 <str_trim+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1160 <str_trim+0x50>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1173 <str_trim+0x63>
jmp    1165 <str_trim+0x55>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <str_trim+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%eax
nopl   0x0(%rax,%rax,1)
test   %eax,%eax
jle    1137 <str_trim+0x27>
lea    -0x1(%rax),%rcx
cmpb   $0x20,-0x1(%rbx,%rax,1)
mov    %rcx,%rax
je     1120 <str_trim+0x10>
movb   $0x0,0x1(%rbx,%rcx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @str_trim(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = zext i32 %2 to i64
br label %4
4: ; preds = %9, %1
%5 = phi i64 [ %6, %9 ], [ %3, %1 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 %6
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 32
br i1 %12, label %4, label %13
13: ; preds = %9
%14 = and i64 %5, 4294967295
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %4, %13
ret void
}
void PDMR3ThreadResume(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMR3ThreadResume() {
ret void
}
void example(void) {
  typedef short sht;
  typedef double dbl;
}


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

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

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

LLVM IR (-O2):
define void @example() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dhcp6_sendmessage(void *, void (*)(void *));
void dhcp6_sendinform(void *arg) { dhcp6_sendmessage(arg, dhcp6_sendinform); }


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

x86 assembly (clang, -O2):
<dhcp6_sendinform>:
mov    0x2ed9(%rip),%rsi
jmp    1030 <dhcp6_sendmessage@plt>

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

LLVM IR (-O2):
define void @dhcp6_sendinform(i8* %0) {
%2 = tail call i32 @dhcp6_sendmessage(i8* %0, void (i8*)* @dhcp6_sendinform)
ret void
}
/* Variables and functions */
scalar_t__ strrchr(char const *, char);
const char *shortFilePath(const char *path) {
  char *p = (char *)strrchr(path, '/');
  return (p == NULL) ? path : (const char *)p + 1;
}


x86 assembly (clang, -O0):
<shortFilePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <shortFilePath+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <shortFilePath+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortFilePath>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @shortFilePath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strrchr(i8* %4, i8 signext 47)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
br label %14
14: ; preds = %11, %9
%15 = phi i8* [ %10, %9 ], [ %13, %11 ]
ret i8* %15
}

LLVM IR (-O2):
define i8* @shortFilePath(i8* %0) {
%2 = tail call i64 @strrchr(i8* %0, i8 signext 47)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* %0, i8* %5
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int PTHREAD_SCOPE_SYSTEM;
int pthread_attr_getscope(const pthread_attr_t *attr, int *scope) {
  (void)attr;
  *scope = PTHREAD_SCOPE_SYSTEM;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_attr_getscope>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_attr_getscope>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
@PTHREAD_SCOPE_SYSTEM = global i32 0
define i32 @pthread_attr_getscope(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* @PTHREAD_SCOPE_SYSTEM
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret i32 0
}

LLVM IR (-O2):
@PTHREAD_SCOPE_SYSTEM = global i32 0
define i32 @pthread_attr_getscope(i32* nocapture readnone %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* @PTHREAD_SCOPE_SYSTEM
store i32 %3, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UART2_ERR_DriverIRQHandler();
__attribute__((weak)) void UART2_ERR_IRQHandler(void) {
  UART2_ERR_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @UART2_ERR_IRQHandler() {
%1 = call i32 (...) @UART2_ERR_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @UART2_ERR_IRQHandler() {
%1 = tail call i32 (...) @UART2_ERR_DriverIRQHandler()
ret void
}
void WaitVBlank(void) {
  while ((*(volatile unsigned short *)0x4000004 & 1))
    ;
}


x86 assembly (clang, -O0):
<WaitVBlank>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <WaitVBlank+0x9>
mov    $0x4000004,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1125 <WaitVBlank+0x25>
jmp    1109 <WaitVBlank+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitVBlank>:
movzwl 0x4000004,%eax
04
test   $0x1,%al
jne    1100 <WaitVBlank>
ret

LLVM IR (-O0):
define void @WaitVBlank() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i16, i16* inttoptr (i64 67108868 to i16*)
%3 = zext i16 %2 to i32
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @WaitVBlank() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i16, i16* inttoptr (i64 67108868 to i16*)
%3 = and i16 %2, 1
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
int fun_01(char *x, char *y, int z) { return ((x[1] & x[2] & x[3]) == 0) + z; }


x86 assembly (clang, -O0):
<fun_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_01>:
mov    0x2(%rdi),%cl
and    0x1(%rdi),%cl
and    0x3(%rdi),%cl
mov    %edx,%eax
cmp    $0x1,%cl
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @fun_01(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = and i32 %10, %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = and i32 %15, %19
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = load i32, i32* %6
%24 = add nsw i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @fun_01(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = and i8 %7, %5
%9 = getelementptr inbounds i8, i8* %0, i64 3
%10 = load i8, i8* %9
%11 = and i8 %8, %10
%12 = icmp eq i8 %11, 0
%13 = zext i1 %12 to i32
%14 = add nsw i32 %13, %2
ret i32 %14
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigtimedwait(int /*<<< orphan*/ *, int /*<<< orphan*/ *, struct timespec *);
int test(void) {
  sigset_t set;
  siginfo_t info;
  struct timespec timeout;
  int result;
  sigemptyset(&set);
  result = sigtimedwait(&set, &info, &timeout);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigemptyset@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sigtimedwait@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1030 <sigtimedwait@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca i32
%5 = call i32 @sigemptyset(i32* %1)
%6 = call i32 @sigtimedwait(i32* %1, i32* %2, %struct.timespec* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast %struct.timespec* %3 to i8*
%7 = call i32 @sigemptyset(i32* %1)
%8 = call i32 @sigtimedwait(i32* %1, i32* %2, %struct.timespec* %3)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ lua_pushnil();
void indexFB(void) { lua_pushnil(); }


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

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

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

LLVM IR (-O2):
define void @indexFB() {
%1 = tail call i32 (...) @lua_pushnil()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ staticPrintTime();
void AMCTimeMarkDetailed(char *file, int line) {
  printf("##TIME: %s, Line %d: ", file, line);
  staticPrintTime();
  return;
}


x86 assembly (clang, -O0):
<AMCTimeMarkDetailed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <staticPrintTime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCTimeMarkDetailed>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <staticPrintTime@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"##TIME: %s, Line %d: \00"
define void @AMCTimeMarkDetailed(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 (...) @staticPrintTime()
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"##TIME: %s, Line %d: \00"
define void @AMCTimeMarkDetailed(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 (...) @staticPrintTime()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const __m128i;

/* Variables and functions */
__m128i __attribute__((__always___, __nodebug__))
_mm_load_si128(__m128i const *p) {
  return *p;
}


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

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

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

LLVM IR (-O2):
define i32 @_mm_load_si128(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int win_alarm(unsigned seconds) {
  (void)seconds;
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @win_alarm(i32 %0) {
ret i32 0
}
float transforme_j(int j, int h, float y1, float y2) {
  return (y1 + (h - j) * (y2 - y1) / (h - 1));
}


x86 assembly (clang, -O0):
<transforme_j>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
movss  -0x10(%rbp),%xmm2
subss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm1
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<transforme_j>:
mov    %esi,%eax
sub    %edi,%eax
cvtsi2ss %eax,%xmm2
add    $0xffffffff,%esi
cvtsi2ss %esi,%xmm3
subss  %xmm0,%xmm1
mulss  %xmm1,%xmm2
divss  %xmm3,%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @transforme_j(i32 %0, i32 %1, float %2, float %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
%13 = sitofp i32 %12 to float
%14 = load float, float* %8
%15 = load float, float* %7
%16 = fsub float %14, %15
%17 = fmul float %13, %16
%18 = load i32, i32* %6
%19 = sub nsw i32 %18, 1
%20 = sitofp i32 %19 to float
%21 = fdiv float %17, %20
%22 = fadd float %9, %21
ret float %22
}

LLVM IR (-O2):
define float @transforme_j(i32 %0, i32 %1, float %2, float %3) {
%5 = sub nsw i32 %1, %0
%6 = sitofp i32 %5 to float
%7 = fsub float %3, %2
%8 = fmul float %7, %6
%9 = add nsw i32 %1, -1
%10 = sitofp i32 %9 to float
%11 = fdiv float %8, %10
%12 = fadd float %11, %2
ret float %12
}
char *rindex(sp, c)
register char *sp, c;
{
  register char *r;
  r = 0;
  do {
    if (*sp == c)
      r = sp;
  } while (*sp++);
  return (r);
}


x86 assembly (clang, -O0):
<rindex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <rindex+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <rindex+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1116 <rindex+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rindex>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
cmp    %sil,%cl
cmove  %rdi,%rax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <rindex+0x10>
ret

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

LLVM IR (-O2):
define i8* @rindex(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = phi i8* [ null, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, %1
%8 = select i1 %7, i8* %4, i8* %5
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %8
}
/* Variables and functions */
int errno;
int C_pegasock_errno() { return errno; }


x86 assembly (clang, -O0):
<C_pegasock_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_pegasock_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @C_pegasock_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @C_pegasock_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
int strcmp(char const *, char const *);
int mystrcmp(const char *str1, const char *str2) {
  if (!str1) {
    if (str2)
      return -1;
    return 0;
  }
  if (!str2)
    return 1;
  return strcmp(str1, str2);
}


x86 assembly (clang, -O0):
<mystrcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <mystrcmp+0x3e>
cmpq   $0x0,-0x18(%rbp)
je     1142 <mystrcmp+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <mystrcmp+0x65>
movl   $0x0,-0x4(%rbp)
jmp    1175 <mystrcmp+0x65>
cmpq   $0x0,-0x18(%rbp)
jne    1165 <mystrcmp+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1175 <mystrcmp+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcmp>:
test   %rdi,%rdi
je     111f <mystrcmp+0xf>
test   %rsi,%rsi
je     1125 <mystrcmp+0x15>
jmp    1030 <strcmp@plt>
neg    %rsi
sbb    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mystrcmp(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 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 -1, i32* %3
br label %21
12: ; preds = %8
store i32 0, i32* %3
br label %21
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %17, label %16
16: ; preds = %13
store i32 1, i32* %3
br label %21
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = load i8*, i8** %5
%20 = call i32 @strcmp(i8* %18, i8* %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %17, %16, %12, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @mystrcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp ne i8* %1, null
%6 = sext i1 %5 to i32
br label %11
7: ; preds = %2
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %11
11: ; preds = %7, %4, %9
%12 = phi i32 [ %10, %9 ], [ %6, %4 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(char);
char firstpunc(char *s) {
  while (*s++)
    if (!isalnum(*s))
      return *s;
  return (0);
}


x86 assembly (clang, -O0):
<firstpunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     115c <firstpunc+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
jne    1157 <firstpunc+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    1160 <firstpunc+0x50>
jmp    111c <firstpunc+0xc>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstpunc>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,(%rbx)
je     113a <firstpunc+0x2a>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isalnum@plt>
test   %eax,%eax
jne    1120 <firstpunc+0x10>
mov    (%rbx),%al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @firstpunc(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %4, %7 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i8, i8* %4
%9 = tail call i32 @isalnum(i8 signext %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %7
%12 = load i8, i8* %4
br label %13
13: ; preds = %2, %11
%14 = phi i8 [ %12, %11 ], [ 0, %2 ]
ret i8 %14
}
/* Variables and functions */
int create_net_namespace(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int status;
  status = create_net_namespace("runallnetworktests_parent.sh",
                                "runallnetworktests_child.sh");
  printf("Execution of all the network testcases under network"
         " namespace done. return value is %d\n",
         status);
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <create_net_namespace@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeea(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xeee(%rip),%rsi
call   1030 <create_net_namespace@plt>
mov    %eax,%ebx
lea    0xefc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"runallnetworktests_parent.sh\00"
@.str.1 = [28 x i8] c"runallnetworktests_child.sh\00"
@.str.2 = [89 x i8] c"Execution of all the network testcases under network namespace done. return value is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @create_net_namespace(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [29 x i8] c"runallnetworktests_parent.sh\00"
@.str.1 = [28 x i8] c"runallnetworktests_child.sh\00"
@.str.2 = [89 x i8] c"Execution of all the network testcases under network namespace done. return value is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @create_net_namespace(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 %1
}
int egsy_aes_gcm_counter_incr_csr_debug_set(
    unsigned int dev_id, union egsy_aes_gcm_counter_incr_csr_debug_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.egsy_aes_gcm_counter_incr_csr_debug_u = type opaque
define i32 @egsy_aes_gcm_counter_incr_csr_debug_set(i32 %0, %union.egsy_aes_gcm_counter_incr_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_aes_gcm_counter_incr_csr_debug_u*
store i32 %0, i32* %3
store %union.egsy_aes_gcm_counter_incr_csr_debug_u* %1, %union.egsy_aes_gcm_counter_incr_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_aes_gcm_counter_incr_csr_debug_u = type opaque
define i32 @egsy_aes_gcm_counter_incr_csr_debug_set(i32 %0, %union.egsy_aes_gcm_counter_incr_csr_debug_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
long long roundf(float);
long long int llroundf(float x) { return roundf(x); }


x86 assembly (clang, -O0):
<llroundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <roundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llroundf>:
jmp    1030 <roundf@plt>

LLVM IR (-O0):
define i64 @llroundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @roundf(float %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @llroundf(float %0) {
%2 = tail call i64 @roundf(float %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wait();
void *thread1(void *arg) {
  sleep(1);
  wait();
  printf("1st Hello from thread1\n");
  sleep(1);
  wait();
  wait();
  printf("2d Hello from thread1\n");
  return NULL;
}


x86 assembly (clang, -O0):
<thread1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    $0x0,%al
call   1050 <wait@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    $0x0,%al
call   1050 <wait@plt>
mov    $0x0,%al
call   1050 <wait@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread1>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1050 <wait@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1050 <wait@plt>
xor    %eax,%eax
call   1050 <wait@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"1st Hello from thread1\0A\00"
@.str.1 = [23 x i8] c"2d Hello from thread1\0A\00"
define i8* @thread1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 1)
%4 = call i32 (...) @wait()
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 1)
%7 = call i32 (...) @wait()
%8 = call i32 (...) @wait()
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [23 x i8] c"1st Hello from thread1\00"
@str.2 = [22 x i8] c"2d Hello from thread1\00"
define noalias i8* @thread1(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 (...) @wait()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 (...) @wait()
%7 = tail call i32 (...) @wait()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret i8* null
}
unsigned xrop3_137_1_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;
  unsigned stk4;
  stk4 = ~S;
  stk3 = T & stk4;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_137_1_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    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
and    -0x20(%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
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_137_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
shl    $0x8,%esi
mov    %ecx,%edx
not    %edx
and    %edx,%esi
lea    0xff(%rsi),%eax
xor    %ecx,%eax
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_137_1_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
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %24, -1
store i32 %25, i32* %11
%26 = load i32, i32* %7
%27 = load i32, i32* %11
%28 = and i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %5
%30 = load i32, i32* %10
%31 = or i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = xor i32 %35, -1
store i32 %36, i32* %8
%37 = load i32, i32* %8
%38 = load i32, i32* %6
%39 = xor i32 %38, -1
%40 = and i32 %37, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_137_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, 255
%10 = xor i32 %4, %9
%11 = xor i32 %10, -1
%12 = and i32 %11, %7
%13 = or i32 %12, %3
ret i32 %13
}
/* Variables and functions */
int delete_fd(int);
int vfs_close(int fd) { return delete_fd(fd); }


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

x86 assembly (clang, -O2):
<vfs_close>:
jmp    1030 <delete_fd@plt>

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

LLVM IR (-O2):
define i32 @vfs_close(i32 %0) {
%2 = tail call i32 @delete_fd(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t instruction_operation_extract_condition(uint16_t instruction) {
  return (instruction >> 0x08) & 0x0F;
}


x86 assembly (clang, -O0):
<instruction_operation_extract_condition>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instruction_operation_extract_condition>:
mov    %edi,%eax
shr    $0x8,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @instruction_operation_extract_condition(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 15
ret i32 %5
}

LLVM IR (-O2):
define i32 @instruction_operation_extract_condition(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 15
ret i32 %3
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__u32 signed_asl(__u32 val, signed int shift) {
  if (shift >= 0)
    val <<= shift;
  else
    val >>= -shift;
  return val;
}


x86 assembly (clang, -O0):
<signed_asl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1124 <signed_asl+0x24>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <signed_asl+0x31>
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_asl>:
mov    %edi,%eax
mov    %esi,%ecx
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
test   %esi,%esi
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @signed_asl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = shl i32 %9, %8
store i32 %10, i32* %3
br label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = sub nsw i32 0, %12
%14 = load i32, i32* %3
%15 = ashr i32 %14, %13
store i32 %15, i32* %3
br label %16
16: ; preds = %11, %7
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @signed_asl(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
%4 = shl i32 %0, %1
%5 = sub nsw i32 0, %1
%6 = ashr i32 %0, %5
%7 = select i1 %3, i32 %4, i32 %6
ret i32 %7
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double current_timestamp() {
  struct timeval te;
  gettimeofday(&te, NULL);
  double microseconds = (double)te.tv_sec + (double)te.tv_usec / 1000000;
  return microseconds;
}


x86 assembly (clang, -O0):
<current_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_timestamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @current_timestamp() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %6, %10
store double %11, double* %2
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @current_timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}