xunge/DecIR huggingface dataset:
/* Type definitions */
struct servent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ getservbyname_r(char const *, int /*<<< orphan*/ *,
                                   struct servent *, char *, size_t,
                                   struct servent **);
void proxy_getservbyname(const char *service, struct servent *se_buf, char *buf,
                         size_t buf_len, struct servent **se_result) {
  getservbyname_r(service, NULL, se_buf, buf, buf_len, se_result);
}


x86 assembly (clang, -O0):
<proxy_getservbyname>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %eax,%eax
mov    %eax,%esi
call   1030 <getservbyname_r@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proxy_getservbyname>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <getservbyname_r@plt>

LLVM IR (-O0):
%struct.servent = type { i32 }
define void @proxy_getservbyname(i8* %0, %struct.servent* %1, i8* %2, i64 %3, %struct.servent** %4) {
%6 = alloca i8*
%7 = alloca %struct.servent*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca %struct.servent**
store i8* %0, i8** %6
store %struct.servent* %1, %struct.servent** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store %struct.servent** %4, %struct.servent*** %10
%11 = load i8*, i8** %6
%12 = load %struct.servent*, %struct.servent** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load %struct.servent**, %struct.servent*** %10
%16 = call i32 @getservbyname_r(i8* %11, i32* null, %struct.servent* %12, i8* %13, i64 %14, %struct.servent** %15)
ret void
}

LLVM IR (-O2):
%struct.servent = type { i32 }
define void @proxy_getservbyname(i8* %0, %struct.servent* %1, i8* %2, i64 %3, %struct.servent** %4) {
%6 = tail call i32 @getservbyname_r(i8* %0, i32* null, %struct.servent* %1, i8* %2, i64 %3, %struct.servent** %4)
ret void
}
/* Type definitions */
typedef union quat {
  int dummy;
} quat;

/* Variables and functions */
int /*<<< orphan*/ quat_lerp(union quat *, union quat const *,
                             union quat const *, float);
int /*<<< orphan*/ quat_normalize_self(union quat *);
union quat *quat_nlerp(union quat *qo, const union quat *qfrom,
                       const union quat *qto, float t) {
  quat_lerp(qo, qfrom, qto, t);
  quat_normalize_self(qo);
  return qo;
}


x86 assembly (clang, -O0):
<quat_nlerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movss  -0x1c(%rbp),%xmm0
call   1040 <quat_lerp@plt>
mov    -0x8(%rbp),%rdi
call   1030 <quat_normalize_self@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_nlerp>:
push   %rbx
mov    %rdi,%rbx
call   1040 <quat_lerp@plt>
mov    %rbx,%rdi
call   1030 <quat_normalize_self@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%union.quat = type { i32 }
define %union.quat* @quat_nlerp(%union.quat* %0, %union.quat* %1, %union.quat* %2, float %3) {
%5 = alloca %union.quat*
%6 = alloca %union.quat*
%7 = alloca %union.quat*
%8 = alloca float
store %union.quat* %0, %union.quat** %5
store %union.quat* %1, %union.quat** %6
store %union.quat* %2, %union.quat** %7
store float %3, float* %8
%9 = load %union.quat*, %union.quat** %5
%10 = load %union.quat*, %union.quat** %6
%11 = load %union.quat*, %union.quat** %7
%12 = load float, float* %8
%13 = call i32 @quat_lerp(%union.quat* %9, %union.quat* %10, %union.quat* %11, float %12)
%14 = load %union.quat*, %union.quat** %5
%15 = call i32 @quat_normalize_self(%union.quat* %14)
%16 = load %union.quat*, %union.quat** %5
ret %union.quat* %16
}

LLVM IR (-O2):
%union.quat = type { i32 }
define %union.quat* @quat_nlerp(%union.quat* returned %0, %union.quat* %1, %union.quat* %2, float %3) {
%5 = tail call i32 @quat_lerp(%union.quat* %0, %union.quat* %1, %union.quat* %2, float %3)
%6 = tail call i32 @quat_normalize_self(%union.quat* %0)
ret %union.quat* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int helpCommand(char **args) {
  printf("This is a tiny but pretty shell, made for fun.\nCommands "
         "available:\n * help - print this help\n * cd [directory] - changes "
         "the working directory to directory\n * echo [text|variable] - prints "
         "out a string or a variable\n * program - executes a program, "
         "searching in PATH (env variable)\n");
  return 0;
}


x86 assembly (clang, -O0):
<helpCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [283 x i8] c"This is a tiny but pretty shell, made for fun.\0ACommands available:\0A * help - print this help\0A * cd [directory] - changes the working directory to directory\0A * echo [text|variable] - prints out a string or a variable\0A * program - executes a program, searching in PATH (env variable)\0A\00"
define i32 @helpCommand(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([283 x i8], [283 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [282 x i8] c"This is a tiny but pretty shell, made for fun.\0ACommands available:\0A * help - print this help\0A * cd [directory] - changes the working directory to directory\0A * echo [text|variable] - prints out a string or a variable\0A * program - executes a program, searching in PATH (env variable)\00"
define i32 @helpCommand(i8** nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([282 x i8], [282 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_92uint16_reg(unsigned short val) {
  return ((val) & (-0x92 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_92uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff6e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_92uint16_reg>:
test   $0xff6e,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_92uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -146
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int V(sid)
int sid;
{ return (semcall(sid, 1, 0)); }


x86 assembly (clang, -O0):
<V>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <semcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V>:
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <semcall@plt>

LLVM IR (-O0):
define i32 @V(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @semcall to i32 (i32, i32, i32, ...)*)(i32 %3, i32 1, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @V(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @semcall to i32 (i32, i32, i32, ...)*)(i32 %0, i32 1, i32 0)
ret i32 %2
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int unary_s(char *s) {
  struct stat buf;
  if (stat(s, &buf))
    return 0;
  return buf.st_size;
}


x86 assembly (clang, -O0):
<unary_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <unary_s+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1145 <unary_s+0x35>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unary_s>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <unary_s+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @unary_s(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
void bitSetBit(void *bitarray, int bitno, int value) {
  if (value)
    ((char *)bitarray)[bitno / 8] |= (1 << (bitno % 8));
  else
    ((char *)bitarray)[bitno / 8] &= ~(1 << (bitno % 8));
}


x86 assembly (clang, -O0):
<bitSetBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1156 <bitSetBit+0x56>
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
jmp    1192 <bitSetBit+0x92>
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
xor    $0xffffffff,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitSetBit>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%r8d
shl    %cl,%r8d
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rsi
mov    (%rdi,%rsi,1),%cl
mov    %r8d,%eax
not    %al
and    %cl,%al
or     %r8b,%cl
test   %edx,%edx
movzbl %al,%eax
movzbl %cl,%ecx
cmove  %eax,%ecx
mov    %cl,(%rdi,%rsi,1)
ret

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

LLVM IR (-O2):
define void @bitSetBit(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = and i32 %1, 7
%6 = shl nuw nsw i32 1, %5
%7 = sdiv i32 %1, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = trunc i32 %6 to i8
%12 = xor i8 %11, -1
%13 = and i8 %10, %12
%14 = or i8 %10, %11
%15 = select i1 %4, i8 %13, i8 %14
store i8 %15, i8* %9
ret void
}
/* Variables and functions */
char *fname_last(char *ptr) {
  char *s = ptr;
  while (*ptr) {
    if (*ptr++ == '/') {
      s = ptr;
    }
  }
  return s;
}


x86 assembly (clang, -O0):
<fname_last>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <fname_last+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1140 <fname_last+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <fname_last+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fname_last>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <fname_last+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    $0x2f,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <fname_last+0x10>
ret

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

LLVM IR (-O2):
define i8* @fname_last(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 47
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ ICPrintNumbers(int, int, int);
int main(int argc, const char *argv[]) {
  ICPrintNumbers(21, 1, 7);
  ICPrintNumbers(5, 1, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x15,%edi
mov    $0x1,%esi
mov    $0x7,%edx
call   1030 <ICPrintNumbers@plt>
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <ICPrintNumbers@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x15,%edi
mov    $0x1,%esi
mov    $0x7,%edx
call   1030 <ICPrintNumbers@plt>
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <ICPrintNumbers@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ICPrintNumbers(i32 21, i32 1, i32 7)
%4 = tail call i32 @ICPrintNumbers(i32 5, i32 1, i32 8)
ret i32 0
}
__attribute__((cdecl)) int CDECLfunc(int a, int b) { return a + b; }


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

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

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

LLVM IR (-O2):
define i32 @CDECLfunc(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct syslog_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void vsyslogp_r(int priority, struct syslog_data *data, const char *msgid,
                const char *sdfmt, const char *fmt, va_list ap) {
  vsyslog(priority, fmt, ap);
}


x86 assembly (clang, -O0):
<vsyslogp_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <vsyslog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsyslogp_r>:
mov    %r9d,%edx
mov    %r8,%rsi
jmp    1030 <vsyslog@plt>

LLVM IR (-O0):
%struct.syslog_data = type { i32 }
define void @vsyslogp_r(i32 %0, %struct.syslog_data* %1, i8* %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca %struct.syslog_data*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %7
store %struct.syslog_data* %1, %struct.syslog_data** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %11
%15 = load i32, i32* %12
%16 = call i32 @vsyslog(i32 %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.syslog_data = type { i32 }
define void @vsyslogp_r(i32 %0, %struct.syslog_data* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* %4, i32 %5) {
%7 = tail call i32 @vsyslog(i32 %0, i8* %4, i32 %5)
ret void
}
void delay(unsigned int n) {
  unsigned int i, k;
  for (i = 0; i <= n; i++)
    for (k = 0; k <= 0xff; k++)
      ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     1154 <delay+0x54>
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
ja     1141 <delay+0x41>
jmp    1133 <delay+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <delay+0x21>
jmp    1146 <delay+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *zalloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr)
    memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <zalloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <zalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @zalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i32 0, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @zalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void fusion_double_write(double *p, double d) { p[0x12345] = d; }


x86 assembly (clang, -O0):
<fusion_double_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x91a28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fusion_double_write>:
movsd  %xmm0,0x91a28(%rdi)
ret

LLVM IR (-O0):
define void @fusion_double_write(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 74565
store double %5, double* %7
ret void
}

LLVM IR (-O2):
define void @fusion_double_write(double* nocapture writeonly %0, double %1) {
%3 = getelementptr inbounds double, double* %0, i64 74565
store double %1, double* %3
ret void
}
int fz_exclusion_byte(int bd, int s) {
  return bd + s - ((((bd) * ((s) + 1)) >> 8) << 1);
}


x86 assembly (clang, -O0):
<fz_exclusion_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
sar    $0x8,%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_exclusion_byte>:
lea    (%rsi,%rdi,1),%eax
add    $0x1,%esi
imul   %edi,%esi
sar    $0x7,%esi
and    $0xfffffffe,%esi
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @fz_exclusion_byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %8, %10
%12 = ashr i32 %11, 8
%13 = shl i32 %12, 1
%14 = sub nsw i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @fz_exclusion_byte(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = add nsw i32 %1, 1
%5 = mul nsw i32 %4, %0
%6 = ashr i32 %5, 7
%7 = and i32 %6, -2
%8 = sub i32 %3, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ tokenise(char *);
int main() {
  char *foo = NULL;
  foo = "select _col1, col2 ,colC from test where city = \"Auckland\" ;";
  tokenise(foo);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"select _col1, col2 ,colC from test where city = \22Auckland\22 ;\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
store i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @tokenise(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"select _col1, col2 ,colC from test where city = \22Auckland\22 ;\00"
define i32 @main() {
%1 = tail call i32 @tokenise(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ fstat(int, struct stat *);
int stan_util_get_file_size(int fd) {
  struct stat _info;
  fstat(fd, &_info);
  return _info.st_size;
}


x86 assembly (clang, -O0):
<stan_util_get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <fstat@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stan_util_get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @stan_util_get_file_size(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stan_util_get_file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
long double sqrt(double);
__attribute__((weak)) long double sqrtl(long double x) {
  return sqrt((double)x);
}


x86 assembly (clang, -O0):
<sqrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sqrt@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define weak x86_fp80 @sqrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @sqrt(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @sqrtl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @sqrt(double %2)
ret x86_fp80 %3
}
/* Type definitions */
struct wl_region {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/);
void wl_region_destroy(struct wl_region *wl_region) {
  wl_proxy_marshal((struct wl_proxy *)wl_region, 0);
  wl_proxy_destroy((struct wl_proxy *)wl_region);
}


x86 assembly (clang, -O0):
<wl_region_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wl_proxy_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_region_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_region = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_region_destroy(%struct.wl_region* %0) {
%2 = alloca %struct.wl_region*
store %struct.wl_region* %0, %struct.wl_region** %2
%3 = load %struct.wl_region*, %struct.wl_region** %2
%4 = bitcast %struct.wl_region* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 0)
%6 = load %struct.wl_region*, %struct.wl_region** %2
%7 = bitcast %struct.wl_region* %6 to %struct.wl_proxy*
%8 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_region = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_region_destroy(%struct.wl_region* %0) {
%2 = bitcast %struct.wl_region* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 0)
%4 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 4;
  int b = 9;
  {
    int __z;
    __z = a;
    a = b;
    b = __z;
  };
  printf("a: %d b: %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb4(%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
mov    $0x9,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"a: %d b: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 9, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rmEleMt22d(void *, void *);
void freeAlcPEle2(void *obj, void *node) {
  if ((obj != NULL) && (node != NULL)) {
    rmEleMt22d(obj, node);
  } else {
  }
}


x86 assembly (clang, -O0):
<freeAlcPEle2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <freeAlcPEle2+0x38>
cmpq   $0x0,-0x10(%rbp)
je     1148 <freeAlcPEle2+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rmEleMt22d@plt>
jmp    114d <freeAlcPEle2+0x3d>
jmp    114d <freeAlcPEle2+0x3d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeAlcPEle2>:
test   %rdi,%rdi
je     111f <freeAlcPEle2+0xf>
test   %rsi,%rsi
je     111f <freeAlcPEle2+0xf>
jmp    1030 <rmEleMt22d@plt>
ret

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

LLVM IR (-O2):
define void @freeAlcPEle2(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @rmEleMt22d(i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
ret void
}
int yas_bma150_lock(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @yas_bma150_lock() {
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_bma150_lock() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: adig [-f flag] [-s server] [-c class] "
                  "[-t type] [-p port] name ...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"usage: adig [-f flag] [-s server] [-c class] [-t type] [-p port] name ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"usage: adig [-f flag] [-s server] [-c class] [-t type] [-p port] name ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int WEXITSTATUS(int);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int system(char *);
int main() {
  int r;
  printf("%d\n", getpid());
  r = system("./maint");
  printf("%d\n", WEXITSTATUS(r));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
lea    0xe99(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <WEXITSTATUS@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
lea    0xea4(%rip),%rdi
call   1040 <system@plt>
mov    %eax,%edi
call   1060 <WEXITSTATUS@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [8 x i8] c"./maint\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @WEXITSTATUS(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void ARGBSubtract() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSubtract() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf(char *, char const *);
int stress_rdrand_supported(const char *name) {
  pr_inf("%s stressor will be skipped, CPU "
         "does not support the rdrand instruction.\n",
         name);
  return -1;
}


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

x86 assembly (clang, -O2):
<stress_rdrand_supported>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <pr_inf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [75 x i8] c"%s stressor will be skipped, CPU does not support the rdrand instruction.\0A\00"
define i32 @stress_rdrand_supported(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_inf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [75 x i8] c"%s stressor will be skipped, CPU does not support the rdrand instruction.\0A\00"
define i32 @stress_rdrand_supported(i8* %0) {
%2 = tail call i32 @pr_inf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __swab32p(int /*<<< orphan*/ *);
void __swab32s(uint32_t *p) { *p = __swab32p(p); }


x86 assembly (clang, -O0):
<__swab32s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__swab32p@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__swab32s>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__swab32p@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__swab32s(i32* %0) {
%2 = tail call i32 @__swab32p(i32* %0)
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_3(char c) { printf("%c", c); }


x86 assembly (clang, -O0):
<print_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_3>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_3(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MA_Malloc(scalar_t__, char const *, char const *, long);
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
char *MA_CopyString(const char *cp, const char *r, const char *fn, long ln) {
  return strcpy(MA_Malloc(strlen(cp) + 1, r, fn, ln), cp);
}


x86 assembly (clang, -O0):
<MA_CopyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1050 <MA_Malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MA_CopyString>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <MA_Malloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @MA_CopyString(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = call i32 @MA_Malloc(i64 %11, i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %5
%17 = call i8* @strcpy(i32 %15, i8* %16)
ret i8* %17
}

LLVM IR (-O2):
define i8* @MA_CopyString(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @MA_Malloc(i64 %6, i8* %1, i8* %2, i64 %3)
%8 = tail call i8* @strcpy(i32 %7, i8* %0)
ret i8* %8
}
int main() {
  v(1);
  w(1);
  y();
  x();
  x(1);
  x(1, 2);
  z(1, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <v@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <w@plt>
mov    $0x0,%al
call   1070 <y@plt>
mov    $0x0,%al
call   1050 <x@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <x@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <x@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1040 <z@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <v@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1060 <w@plt>
xor    %eax,%eax
call   1070 <y@plt>
xor    %eax,%eax
call   1050 <x@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <x@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <x@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <z@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (i32, ...) bitcast (i32 (...)* @v to i32 (i32, ...)*)(i32 1)
%2 = call i32 (i32, ...) bitcast (i32 (...)* @w to i32 (i32, ...)*)(i32 1)
%3 = call i32 (...) @y()
%4 = call i32 (...) @x()
%5 = call i32 (i32, ...) bitcast (i32 (...)* @x to i32 (i32, ...)*)(i32 1)
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @x to i32 (i32, i32, ...)*)(i32 1, i32 2)
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @z to i32 (i32, i32, ...)*)(i32 1, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @v to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @w to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (...) @y()
%4 = tail call i32 (...) @x()
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @x to i32 (i32, ...)*)(i32 1)
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @x to i32 (i32, i32, ...)*)(i32 1, i32 2)
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @z to i32 (i32, i32, ...)*)(i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
int MAP_SHARED;
int flags_map_shared(void) { return MAP_SHARED; }


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

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

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

LLVM IR (-O2):
@MAP_SHARED = global i32 0
define i32 @flags_map_shared() {
%1 = load i32, i32* @MAP_SHARED
ret i32 %1
}
void RTS3GetBuckets(void) {}


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

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

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

LLVM IR (-O2):
define void @RTS3GetBuckets() {
ret void
}
void kmain() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <kmain+0x9>
jmp    1109 <kmain+0x9>

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

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

LLVM IR (-O2):
define void @kmain() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void idle(void) {
  glutPostRedisplay();
  return;
}


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

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

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

LLVM IR (-O2):
define void @idle() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysCtlPeripheralDeepSleepEnable(uint32_t ui32Peripheral) {
  ;
  (*((volatile unsigned long
          *)(((unsigned long)(0x400fe800 + ((ui32Peripheral & 0xff00) >> 8)) &
              0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x400fe800 + ((ui32Peripheral & 0xff00) >> 8)) &
               0x000FFFFF)
              << 5) |
             ((ui32Peripheral & 0xff) << 2)))) = 1;
}


x86 assembly (clang, -O0):
<SysCtlPeripheralDeepSleepEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
add    $0x400fe800,%eax
cltq
movabs $0xf0000000,%rcx
and    %rcx,%rax
or     $0x2000000,%rax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
add    $0x400fe800,%ecx
movslq %ecx,%rcx
and    $0xfffff,%rcx
shl    $0x5,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPeripheralDeepSleepEnable>:
movzbl %dil,%eax
shr    $0x3,%edi
and    $0x1fe0,%edi
shl    $0x2,%eax
or     %edi,%eax
movq   $0x1,0x43fd0000(%rax)
ret

LLVM IR (-O0):
define void @SysCtlPeripheralDeepSleepEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = add nsw i32 1074784256, %5
%7 = sext i32 %6 to i64
%8 = and i64 %7, 4026531840
%9 = or i64 %8, 33554432
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = add nsw i32 1074784256, %12
%14 = sext i32 %13 to i64
%15 = and i64 %14, 1048575
%16 = shl i64 %15, 5
%17 = or i64 %9, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 255
%20 = shl i32 %19, 2
%21 = sext i32 %20 to i64
%22 = or i64 %17, %21
%23 = inttoptr i64 %22 to i64*
store volatile i64 1, i64* %23
ret void
}

LLVM IR (-O2):
define void @SysCtlPeripheralDeepSleepEnable(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 8160
%4 = shl i32 %0, 2
%5 = and i32 %4, 1020
%6 = or i32 %5, %3
%7 = or i32 %6, 1140654080
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
store volatile i64 1, i64* %9
ret void
}
int packet_is_okay_kex(unsigned char type) {
  if (type >= 50) {
    return 0;
  }
  if (type == 5 || type == 6) {
    return 0;
  }
  if (type == 20) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<packet_is_okay_kex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x32,%eax
jl     1123 <packet_is_okay_kex+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1169 <packet_is_okay_kex+0x69>
movzbl -0x5(%rbp),%eax
cmp    $0x5,%eax
je     113d <packet_is_okay_kex+0x3d>
movzbl -0x5(%rbp),%eax
cmp    $0x6,%eax
jne    1149 <packet_is_okay_kex+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1169 <packet_is_okay_kex+0x69>
movzbl -0x5(%rbp),%eax
cmp    $0x14,%eax
jne    1162 <packet_is_okay_kex+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1169 <packet_is_okay_kex+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<packet_is_okay_kex>:
cmp    $0x32,%dil
setb   %al
lea    -0x7(%rdi),%ecx
cmp    $0xfe,%cl
setb   %cl
cmp    $0x14,%dil
setne  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @packet_is_okay_kex(i8 zeroext %0) {
%2 = icmp ult i8 %0, 50
%3 = add i8 %0, -7
%4 = icmp ult i8 %3, -2
%5 = icmp ne i8 %0, 20
%6 = and i1 %2, %4
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}