xunge/DecIR huggingface dataset:
void sptlrpc_lproc_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @sptlrpc_lproc_fini() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ PASS(char *);
int main(int argc, const char *argv[]) {
  PASS("image-state-dependents-initialized");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <PASS@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"image-state-dependents-initialized\00"
@EXIT_SUCCESS = global i32 0
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 @PASS(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [35 x i8] c"image-state-dependents-initialized\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @PASS(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t crack_decrypt_byte(uint32_t key) {
  uint16_t temp;
  temp = key | 2;
  return (uint8_t)((temp * (temp ^ 1)) >> 8);
}


x86 assembly (clang, -O0):
<crack_decrypt_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0x1,%ecx
imul   %ecx,%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crack_decrypt_byte>:
or     $0x2,%edi
mov    %edi,%eax
xor    $0x1,%eax
imul   %edi,%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @crack_decrypt_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = or i32 %4, 2
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = xor i32 %7, 1
%9 = mul nsw i32 %6, %8
%10 = ashr i32 %9, 8
ret i32 %10
}

LLVM IR (-O2):
define i32 @crack_decrypt_byte(i32 %0) {
%2 = or i32 %0, 2
%3 = xor i32 %2, 1
%4 = mul nsw i32 %3, %2
%5 = ashr i32 %4, 8
ret i32 %5
}
/* Variables and functions */
int find_plaintext_in_dict1(char *);
scalar_t__ find_plaintext_in_dict2(char *);
int verify_plaintext(char *plaintext) {
  int result;
  result = find_plaintext_in_dict1(plaintext);
  if (!result)
    result += find_plaintext_in_dict2(plaintext);
  return result;
}


x86 assembly (clang, -O0):
<verify_plaintext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <find_plaintext_in_dict1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1158 <verify_plaintext+0x38>
mov    -0x8(%rbp),%rdi
call   1030 <find_plaintext_in_dict2@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_plaintext>:
push   %rbx
mov    %rdi,%rbx
call   1040 <find_plaintext_in_dict1@plt>
test   %eax,%eax
je     112f <verify_plaintext+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <find_plaintext_in_dict2@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @verify_plaintext(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @find_plaintext_in_dict1(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @find_plaintext_in_dict2(i8* %9)
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %8, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @verify_plaintext(i8* %0) {
%2 = tail call i32 @find_plaintext_in_dict1(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i64 @find_plaintext_in_dict2(i8* %0)
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %2, %1 ], [ %6, %4 ]
ret i32 %8
}
const char *New_Brief(void) { return "Construction and Destruction"; }


x86 assembly (clang, -O0):
<New_Brief>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"Construction and Destruction\00"
define i8* @New_Brief() {
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [29 x i8] c"Construction and Destruction\00"
define i8* @New_Brief() {
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ iassert(int);
int /*<<< orphan*/ massert(int);
double realProb(int n1, int n2) {
  massert(n1 <= n2);
  iassert(n1 >= 0 && n2 > 0);
  if (n2 == 0)
    n2 = 1;
  return ((double)n1) / (double)n2;
}


x86 assembly (clang, -O0):
<realProb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <massert@plt>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     115a <realProb+0x3a>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <iassert@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1178 <realProb+0x58>
movl   $0x1,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realProb>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
xor    %edi,%edi
cmp    %esi,%r14d
setle  %dil
call   1040 <massert@plt>
test   %r14d,%r14d
setns  %al
test   %ebx,%ebx
setg   %cl
mov    $0x1,%ebp
cmovne %ebx,%ebp
and    %al,%cl
movzbl %cl,%edi
call   1030 <iassert@plt>
cvtsi2sd %r14d,%xmm0
cvtsi2sd %ebp,%xmm1
divsd  %xmm1,%xmm0
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @realProb(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 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @massert(i32 %8)
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br label %15
15: ; preds = %12, %2
%16 = phi i1 [ false, %2 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i32 @iassert(i32 %17)
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 1, i32* %4
br label %22
22: ; preds = %21, %15
%23 = load i32, i32* %3
%24 = sitofp i32 %23 to double
%25 = load i32, i32* %4
%26 = sitofp i32 %25 to double
%27 = fdiv double %24, %26
ret double %27
}

LLVM IR (-O2):
define double @realProb(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @massert(i32 %4)
%6 = icmp sgt i32 %0, -1
%7 = icmp sgt i32 %1, 0
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
%10 = tail call i32 @iassert(i32 %9)
%11 = icmp eq i32 %1, 0
%12 = select i1 %11, i32 1, i32 %1
%13 = sitofp i32 %0 to double
%14 = sitofp i32 %12 to double
%15 = fdiv double %13, %14
ret double %15
}
/* Variables and functions */
double __rinf(double);
scalar_t__ signbit(double);
double trunc(double);
double floor(double x) { return signbit(x) ? __rinf(x) : trunc(x); }


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <signbit@plt>
cmp    $0x0,%rax
je     1165 <floor+0x35>
movsd  -0x8(%rbp),%xmm0
call   1030 <__rinf@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <floor+0x44>
movsd  -0x8(%rbp),%xmm0
call   1040 <trunc@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
push   %rax
movsd  %xmm0,(%rsp)
call   1050 <signbit@plt>
test   %rax,%rax
je     114b <floor+0x1b>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <__rinf@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <trunc@plt>

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @signbit(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = call double @__rinf(double %7)
br label %12
9: ; preds = %1
%10 = load double, double* %2
%11 = call double @llvm.trunc.f64(double %10)
br label %12
12: ; preds = %9, %6
%13 = phi double [ %8, %6 ], [ %11, %9 ]
ret double %13
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = tail call i64 @signbit(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call double @__rinf(double %0)
br label %8
6: ; preds = %1
%7 = tail call double @llvm.trunc.f64(double %0)
br label %8
8: ; preds = %6, %4
%9 = phi double [ %5, %4 ], [ %7, %6 ]
ret double %9
}
void SteamAPI_ISteamGameServer_SetSpectatorServerName(
    void *self, const char *pszSpectatorServerName) {
  xlogf("%s(self = %p, pszSpectatorServerName = %s)\n", __func__, self,
        pszSpectatorServerName);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamGameServer_SetSpectatorServerName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xef6(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamGameServer_SetSpectatorServerName>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xf08(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"%s(self = %p, pszSpectatorServerName = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetSpectatorServerName = [49 x i8] c"SteamAPI_ISteamGameServer_SetSpectatorServerName\00"
define void @SteamAPI_ISteamGameServer_SetSpectatorServerName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @__func__.SteamAPI_ISteamGameServer_SetSpectatorServerName, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"%s(self = %p, pszSpectatorServerName = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetSpectatorServerName = [49 x i8] c"SteamAPI_ISteamGameServer_SetSpectatorServerName\00"
define void @SteamAPI_ISteamGameServer_SetSpectatorServerName(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @__func__.SteamAPI_ISteamGameServer_SetSpectatorServerName, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void gtk_toolbar_get_relief_style() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_get_relief_style() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int cnd1, cnd2;
  int errors = 0;
  cnd1 = 0;
  cnd2 = 0;
  if (cnd1 != 1 || cnd2 != 1) {
    errors += 1;
    printf("not defined _OPENMP.\n");
  }
  if (errors == 0) {
    printf("conditional complilation 001 PASSED\n");
  } else {
    printf("conditional complilation 001 FAILED\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1148 <main+0x38>
cmpl   $0x1,-0xc(%rbp)
je     115d <main+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
jne    1178 <main+0x68>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    1184 <main+0x74>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"not defined _OPENMP.\0A\00"
@.str.1 = [37 x i8] c"conditional complilation 001 PASSED\0A\00"
@.str.2 = [37 x i8] c"conditional complilation 001 FAILED\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %7, %0
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %10, %7
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %21
19: ; preds = %14
%20 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@str = [21 x i8] c"not defined _OPENMP.\00"
@str.3 = [36 x i8] c"conditional complilation 001 FAILED\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int host_notify_dev_register(struct host_notify_dev *ndev) { return 0; }


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

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

LLVM IR (-O0):
%struct.host_notify_dev = type opaque
define i32 @host_notify_dev_register(%struct.host_notify_dev* %0) {
%2 = alloca %struct.host_notify_dev*
store %struct.host_notify_dev* %0, %struct.host_notify_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.host_notify_dev = type opaque
define i32 @host_notify_dev_register(%struct.host_notify_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printMsg() { printf("hello world!\n"); }


x86 assembly (clang, -O0):
<printMsg>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define void @printMsg() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define void @printMsg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inb(int);
int keyboard_getStatus();
void keyboard_clearBuffer() {
  while ((keyboard_getStatus() & 0x01)) {
    inb(0x60);
  }
}


x86 assembly (clang, -O0):
<keyboard_clearBuffer>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <keyboard_clearBuffer+0x9>
mov    $0x0,%al
call   1030 <keyboard_getStatus@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     114b <keyboard_clearBuffer+0x2b>
mov    $0x60,%edi
call   1040 <inb@plt>
jmp    1129 <keyboard_clearBuffer+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_clearBuffer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <keyboard_getStatus@plt>
test   $0x1,%al
je     1147 <keyboard_clearBuffer+0x27>
mov    $0x60,%edi
call   1040 <inb@plt>
jmp    1130 <keyboard_clearBuffer+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @keyboard_clearBuffer() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @keyboard_getStatus()
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @inb(i32 96)
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @keyboard_clearBuffer() {
%1 = tail call i32 (...) @keyboard_getStatus()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 @inb(i32 96)
%6 = tail call i32 (...) @keyboard_getStatus()
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret void
}
int do_nothing(void) {}


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

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

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

LLVM IR (-O2):
define i32 @do_nothing() {
ret i32 undef
}
int block_cli_if_desc_update_post_fault_lock_component_pretake() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @block_cli_if_desc_update_post_fault_lock_component_pretake() {
ret i32 1
}
void INT_Excep_PERIB_INTB150(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB150() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool datetime_is_leap_year(uint16_t year) {
  if ((year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0))
    return (true);
  else
    return (false);
}


x86 assembly (clang, -O0):
<datetime_is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <datetime_is_leap_year+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <datetime_is_leap_year+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <datetime_is_leap_year+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <datetime_is_leap_year+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<datetime_is_leap_year>:
test   $0x3,%dil
jne    1143 <datetime_is_leap_year+0x43>
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1,%eax
cmp    $0x28f5c28,%ecx
ja     1145 <datetime_is_leap_year+0x45>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
je     1145 <datetime_is_leap_year+0x45>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @datetime_is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ 0, %10 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void inf_print(char *info) {
  printf(" \033[0;32m "
         "%s"
         " \033[0m\n",
         info);
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c" \1B[0;32m %s \1B[0m\0A\00"
define void @inf_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
int /*<<< orphan*/ stderr;
void __mpx_dig_abort(const char *file, const char *func, int line) {
  fprintf(stderr, "MPX dig abort @ %s::%d in %s()\n", file, line, func);
  printf("MPX dig abort @ %s::%d in %s()\n", file, line, func);
  abort();
}


x86 assembly (clang, -O0):
<__mpx_dig_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__mpx_dig_abort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%r15
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %r14,%r8
call   1050 <fprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"MPX dig abort @ %s::%d in %s()\0A\00"
define void @__mpx_dig_abort(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 i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = load i8*, i8** %5
%15 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i8* %14)
%16 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"MPX dig abort @ %s::%d in %s()\0A\00"
define void @__mpx_dig_abort(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i8* %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i8* %1)
%7 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int fibonacci(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, int);
int main() {
  unsigned i;
  for (i = 0; i < 50; ++i) {
    printf("fib(%d) = %d\n", i, fibonacci(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jae    116d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fibonacci@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <fibonacci@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x32,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"fib(%d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 50
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @fibonacci(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"fib(%d) = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @fibonacci(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 50
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
int test_bit(const char *mask, int bit) {
  return mask[bit / 8] & (1 << (bit % 8));
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
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),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(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 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = shl i32 1, %13
%15 = and i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @test_bit(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %7
ret i32 %10
}
/* Variables and functions */
char c(int);
char d(void) { return c(2); }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <c@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
mov    $0x2,%edi
jmp    1030 <c@plt>

LLVM IR (-O0):
define signext i8 @d() {
%1 = call signext i8 @c(i32 2)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @d() {
%1 = tail call signext i8 @c(i32 2)
ret i8 %1
}
int fibonacci(int n) {
  if (n == 1 || n == 2) {
    return 1;
  } else {
    return fibonacci(n - 1) + fibonacci(n - 2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112f <fibonacci+0x1f>
cmpl   $0x2,-0x8(%rbp)
jne    113b <fibonacci+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115e <fibonacci+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1144 <fibonacci+0x34>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <fibonacci@plt>
add    %eax,%ebx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <fibonacci+0x20>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @fibonacci(i32 %5)
%9 = add nsw i32 %6, -2
%10 = add nsw i32 %8, %7
%11 = add i32 %6, -3
%12 = icmp ult i32 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 1, %1 ], [ %14, %13 ]
ret i32 %16
}
long int cast_uchar_long(unsigned char x) { return (long int)x; }


x86 assembly (clang, -O0):
<cast_uchar_long>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @cast_uchar_long(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_uchar_long(i8 zeroext %0) {
%2 = zext i8 %0 to i64
ret i64 %2
}
/* Type definitions */
struct group {
  int /*<<< orphan*/ gr_gid;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ a_num(char const *, char *);
struct group *getgrnam(char const *);
gid_t a_gid(const char *s) {
  struct group *gr;
  if ((gr = getgrnam(s)) != NULL)
    return gr->gr_gid;
  return a_num(s, "group");
}


x86 assembly (clang, -O0):
<a_gid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getgrnam@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1151 <a_gid+0x31>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <a_gid+0x44>
mov    -0x10(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1040 <a_num@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_gid>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getgrnam@plt>
test   %rax,%rax
je     1132 <a_gid+0x12>
mov    (%rax),%eax
pop    %rbx
ret
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <a_num@plt>

LLVM IR (-O0):
%struct.group = type { i32 }
@.str = [6 x i8] c"group\00"
define i32 @a_gid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.group*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.group* @getgrnam(i8* %5)
store %struct.group* %6, %struct.group** %4
%7 = icmp ne %struct.group* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load %struct.group*, %struct.group** %4
%10 = getelementptr inbounds %struct.group, %struct.group* %9, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %15
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i32 @a_num(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.group = type { i32 }
@.str = [6 x i8] c"group\00"
define i32 @a_gid(i8* %0) {
%2 = tail call %struct.group* @getgrnam(i8* %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i32, i32* %5
br label %9
7: ; preds = %1
%8 = tail call i32 @a_num(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ pci_cleanup(void *const);
int enable_flash_pch100_shutdown(void *const pci_acc) {
  pci_cleanup(pci_acc);
  return 0;
}


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

x86 assembly (clang, -O2):
push   %rax
call   1030 <pci_cleanup@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @enable_flash_pch100_shutdown(i8* %0) {
%2 = tail call i32 @pci_cleanup(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __byte_memcpy(void *, void const *, size_t);
void __byt_memcpy(void *__restrict s1, const void *__restrict s2, size_t n) {
  __byte_memcpy(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<__byt_memcpy>:
jmp    1030 <__byte_memcpy@plt>

LLVM IR (-O0):
define void @__byt_memcpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @__byte_memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @__byt_memcpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = tail call i32 @__byte_memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int creat(char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int fd;
  fd = creat("test.txt", 0700);
  if (-1 == fd) {
    perror("fail to creat");
    exit(1);
  } else
    printf("creat OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x1c0,%esi
call   1050 <creat@plt>
mov    %eax,-0x8(%rbp)
mov    $0xffffffff,%eax
cmp    -0x8(%rbp),%eax
jne    1187 <main+0x47>
lea    0xe91(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x1c0,%esi
call   1050 <creat@plt>
cmp    $0xffffffff,%eax
je     1167 <main+0x27>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [14 x i8] c"fail to creat\00"
@.str.2 = [10 x i8] c"creat OK\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 448)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 -1, %4
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [14 x i8] c"fail to creat\00"
@str = [9 x i8] c"creat OK\00"
define i32 @main() {
%1 = tail call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 448)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int inreg(int, int);
int serial_getc(int channel) {
  if (inreg(channel, 0x05) & 0x01) {
    return inreg(channel, 0x00);
  }
  return -1;
}


x86 assembly (clang, -O0):
<serial_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1030 <inreg@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     1146 <serial_getc+0x36>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <inreg@plt>
mov    %eax,-0x4(%rbp)
jmp    114d <serial_getc+0x3d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_getc>:
push   %rbx
mov    %edi,%ebx
mov    $0x5,%esi
call   1030 <inreg@plt>
test   $0x1,%al
jne    1128 <serial_getc+0x18>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <inreg@plt>

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

LLVM IR (-O2):
define i32 @serial_getc(i32 %0) {
%2 = tail call i32 @inreg(i32 %0, i32 5)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @inreg(i32 %0, i32 0)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int atoi(char *);
int main(int argc, char *argv[]) {
  int index = atoi(argv[1]);
  char *str = argv[index];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
store i8* %16, i8** %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
unsigned short int __swap16(unsigned short int x) {
  __asm__("xchgb %b0,%h0" : "=q"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<__swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
xchg   %ah,%al
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__swap16>:
mov    %edi,%eax
xchg   %ah,%al
ret

LLVM IR (-O0):
define zeroext i16 @__swap16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i16 asm "xchgb ${0:b},${0:h}", "=q,0,~{dirflag},~{fpsr},~{flags}"(i16 %3)
store i16 %4, i16* %2
%5 = load i16, i16* %2
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @__swap16(i16 zeroext %0) {
%2 = tail call i16 asm "xchgb ${0:b},${0:h}", "=q,0,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
void callee_2_2_1() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ send(int, void *, size_t, int /*<<< orphan*/);
ssize_t mywrite_swift_blc_fwd(int fd, void *buf, size_t len) {
  return send(fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<mywrite_swift_blc_fwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mywrite_swift_blc_fwd>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

LLVM IR (-O0):
define i32 @mywrite_swift_blc_fwd(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @send(i32 %7, i8* %8, i64 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mywrite_swift_blc_fwd(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
OP(dd, ce) {
  illegal_1();
  op_ce();
}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ce()
ret i32 undef
}
/* Variables and functions */
int big_stack();
int /*<<< orphan*/ printf(char *, int);
int small_stack();
int main(int argc, char **argv) {
  int ptr1, ptr2;
  ptr1 = small_stack();
  printf("0x%x\n", ptr1);
  ptr2 = big_stack();
  printf("0x%x\n", ptr2);
  return (ptr2 + 128 * 1000) < ptr1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <small_stack@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <big_stack@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1f400,%eax
cmp    -0x14(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <small_stack@plt>
mov    %eax,%ebx
lea    0xebc(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <big_stack@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x1f400,%ebp
xor    %eax,%eax
cmp    %ebx,%ebp
setl   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @small_stack()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @big_stack()
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 128000
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @small_stack()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @big_stack()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %5, 128000
%8 = icmp slt i32 %7, %3
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void init_asig_section() {
  write("ganttproject.gan", "\t<allocations>\n", NULL);
}


x86 assembly (clang, -O0):
<init_asig_section>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_asig_section>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [16 x i8] c"\09<allocations>\0A\00"
define void @init_asig_section() {
%1 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [16 x i8] c"\09<allocations>\0A\00"
define void @init_asig_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}