xunge/DecIR huggingface dataset:
int clickplc_exe_Next_enc(void *obj, unsigned char *stream) {
  int encsize = 4;
  stream[0] = 0x00;
  stream[1] = 0x22;
  stream[2] = 0xff;
  stream[3] = 0xff;
  return (encsize);
}


x86 assembly (clang, -O0):
<clickplc_exe_Next_enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x22,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0xff,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0xff,0x3(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clickplc_exe_Next_enc>:
movl   $0xffff2200,(%rsi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @clickplc_exe_Next_enc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 4, i32* %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 0, i8* %7
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 34, i8* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 2
store i8 -1, i8* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 3
store i8 -1, i8* %13
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @clickplc_exe_Next_enc(i8* nocapture readnone %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 34, i8* %3
%4 = getelementptr inbounds i8, i8* %1, i64 2
store i8 -1, i8* %4
%5 = getelementptr inbounds i8, i8* %1, i64 3
store i8 -1, i8* %5
ret i32 4
}
int skip_atoi(const char **s) {
  int i, c;
  for (i = 0; '0' <= (c = **s) && c <= '9'; ++*s) {
    i = i * 10 + c - '0';
  }
  return i;
}


x86 assembly (clang, -O0):
<skip_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edx
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jg     1138 <skip_atoi+0x38>
cmpl   $0x39,-0x10(%rbp)
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1148 <skip_atoi+0x48>
jmp    1168 <skip_atoi+0x68>
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    110f <skip_atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_atoi>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
lea    -0x30(%rdx),%esi
xor    %eax,%eax
cmp    $0x9,%sil
ja     113f <skip_atoi+0x3f>
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movzbl %dl,%edx
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
mov    %rcx,(%rdi)
movzbl (%rcx),%edx
lea    -0x30(%rdx),%esi
add    $0x1,%rcx
cmp    $0xa,%sil
jb     1120 <skip_atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @skip_atoi(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %3, %1 ]
%8 = phi i8* [ %14, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = zext i8 %7 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ func(int);
int /*<<< orphan*/ sleep(int);
int main() {
  int ret = 0;
  for (ret; ret < 1000; ret++) {
    func(ret);
    sleep(30);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1163 <main+0x43>
mov    -0x8(%rbp),%edi
call   1030 <func@plt>
mov    $0x1e,%edi
call   1040 <sleep@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   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <func@plt>
mov    $0x1e,%edi
call   1040 <sleep@plt>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1000
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @func(i32 %8)
%10 = call i32 @sleep(i32 30)
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @func(i32 %2)
%4 = tail call i32 @sleep(i32 30)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 1000
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_swap32p(int /*<<< orphan*/ *, int /*<<< orphan*/);
void cpu_to_be32p(uint32_t *outp, uint32_t in) { cpu_swap32p(outp, in); }


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

x86 assembly (clang, -O2):
<cpu_to_be32p>:
jmp    1030 <cpu_swap32p@plt>

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

LLVM IR (-O2):
define void @cpu_to_be32p(i32* %0, i32 %1) {
%3 = tail call i32 @cpu_swap32p(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *name) {
  printf("Usage: %s [-h] [-s TEST_CASE] [-t TEST_FUNC]\n"
         "  -h            print this Help\n"
         "  -s TEST_CASE  only run suite named SUITE\n"
         "  -t TEST_FUNC  only run test named TEST\n"
         "  --silent      do not print result\n",
         name);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [198 x i8] c"Usage: %s [-h] [-s TEST_CASE] [-t TEST_FUNC]\0A -h print this Help\0A -s TEST_CASE only run suite named SUITE\0A -t TEST_FUNC only run test named TEST\0A --silent do not print result\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([198 x i8], [198 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [198 x i8] c"Usage: %s [-h] [-s TEST_CASE] [-t TEST_FUNC]\0A -h print this Help\0A -s TEST_CASE only run suite named SUITE\0A -t TEST_FUNC only run test named TEST\0A --silent do not print result\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([198 x i8], [198 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t len = 0;
  while (str[len] != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HAPI_Timer();
unsigned char V5H_IntHandle(void) {
  VIM_HAPI_Timer();
  return 0;
}


x86 assembly (clang, -O0):
<V5H_IntHandle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VIM_HAPI_Timer@plt>
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @V5H_IntHandle() {
%1 = call i32 (...) @VIM_HAPI_Timer()
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @V5H_IntHandle() {
%1 = tail call i32 (...) @VIM_HAPI_Timer()
ret i8 0
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t time_now() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  uint64_t ret = tv.tv_sec;
  ret *= 1000000;
  ret += tv.tv_usec;
  return ret;
}


x86 assembly (clang, -O0):
<time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0xf4240,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%eax
add    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @time_now() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 1000000
store i32 %7, i32* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @time_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = add i32 %6, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
void main() {
  int c;
  int d;
  foo(c, d);
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @foo(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @foo(i32 undef, i32 undef)
ret void
}
int get_value_from_a(void) { return 15; }


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

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

LLVM IR (-O0):
define i32 @get_value_from_a() {
ret i32 15
}

LLVM IR (-O2):
define i32 @get_value_from_a() {
ret i32 15
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_init(int /*<<< orphan*/ *);
int main(void) {
  pthread_mutexattr_t mutex_attr;
  return pthread_mutexattr_init(&mutex_attr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <pthread_mutexattr_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_mutexattr_init(i32* %1)
ret i32 %3
}
int isAlpha(char *s) {
  if ((*s >= 'a' && *s <= 'z') || (*s >= 'A' && *s <= 'Z')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1128 <isAlpha+0x28>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jle    1148 <isAlpha+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1154 <isAlpha+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1154 <isAlpha+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <isAlpha+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlpha>:
mov    (%rdi),%cl
and    $0xdf,%cl
add    $0xbf,%cl
xor    %eax,%eax
cmp    $0x1a,%cl
setb   %al
ret

LLVM IR (-O0):
define i32 @isAlpha(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 122
br i1 %12, label %23, label %13
13: ; preds = %8, %1
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 65
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 90
br i1 %22, label %23, label %24
23: ; preds = %18, %8
store i32 1, i32* %2
br label %25
24: ; preds = %18, %13
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @isAlpha(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -33
%4 = add i8 %3, -65
%5 = icmp ult i8 %4, 26
%6 = zext i1 %5 to i32
ret i32 %6
}
int multiply_by_three(int a) { return a * 3; }


x86 assembly (clang, -O0):
<multiply_by_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply_by_three>:
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @multiply_by_three(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
int sys_getpeername(tcp)
struct tcb *tcp;
{
  return sys_accept(tcp);
}


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @sys_getpeername(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @sys_accept to i32 (%struct.tcb*, ...)*)(%struct.tcb* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_getpeername(%struct.tcb* %0) {
%2 = tail call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @sys_accept to i32 (%struct.tcb*, ...)*)(%struct.tcb* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assign();
int /*<<< orphan*/ emit();
int /*<<< orphan*/ getargs(int, char **);
int /*<<< orphan*/ map();
int /*<<< orphan*/ memalloc();
int /*<<< orphan*/ readkeys();
int /*<<< orphan*/ verify();
int main(int argc, char **argv) {
  getargs(argc, argv);
  readkeys();
  memalloc();
  map();
  assign();
  verify();
  emit();
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <getargs@plt>
mov    $0x0,%al
call   1030 <readkeys@plt>
mov    $0x0,%al
call   1040 <memalloc@plt>
mov    $0x0,%al
call   1050 <map@plt>
mov    $0x0,%al
call   1070 <assign@plt>
mov    $0x0,%al
call   1060 <verify@plt>
mov    $0x0,%al
call   1080 <emit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1090 <getargs@plt>
xor    %eax,%eax
call   1030 <readkeys@plt>
xor    %eax,%eax
call   1040 <memalloc@plt>
xor    %eax,%eax
call   1050 <map@plt>
xor    %eax,%eax
call   1070 <assign@plt>
xor    %eax,%eax
call   1060 <verify@plt>
xor    %eax,%eax
call   1080 <emit@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @getargs(i32 %6, i8** %7)
%9 = call i32 (...) @readkeys()
%10 = call i32 (...) @memalloc()
%11 = call i32 (...) @map()
%12 = call i32 (...) @assign()
%13 = call i32 (...) @verify()
%14 = call i32 (...) @emit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getargs(i32 %0, i8** %1)
%4 = tail call i32 (...) @readkeys()
%5 = tail call i32 (...) @memalloc()
%6 = tail call i32 (...) @map()
%7 = tail call i32 (...) @assign()
%8 = tail call i32 (...) @verify()
%9 = tail call i32 (...) @emit()
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
double rand();
double unirand(double a, double b) {
  return rand() / (RAND_MAX + 1.0) * (b - a) + a;
}


x86 assembly (clang, -O0):
<unirand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xecf(%rip),%xmm1
mov    0x2eb0(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unirand>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eba(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @unirand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @rand()
%6 = load double, double* @RAND_MAX
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %5, %7
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %8, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @unirand(double %0, double %1) {
%3 = tail call double (...) @rand()
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
/* Variables and functions */
double floor(double);
double pow(int, double);
double wavegen_triangle(double time) {
  return 4.0 * (time - floor(time + 0.5)) * pow(-1, floor(time + 0.5)) - 1.0;
}


x86 assembly (clang, -O0):
<wavegen_triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  -0x18(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe9d(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
mov    $0xffffffff,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe6d(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wavegen_triangle>:
push   %rax
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <floor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xebc(%rip),%xmm1
movsd  %xmm1,(%rsp)
mov    $0xffffffff,%edi
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
addsd  0xea8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @wavegen_triangle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 5.000000e-01
%6 = call double @llvm.floor.f64(double %5)
%7 = fsub double %3, %6
%8 = fmul double 4.000000e+00, %7
%9 = load double, double* %2
%10 = fadd double %9, 5.000000e-01
%11 = call double @llvm.floor.f64(double %10)
%12 = call double @pow(i32 -1, double %11)
%13 = call double @llvm.fmuladd.f64(double %8, double %12, double -1.000000e+00)
ret double %13
}

LLVM IR (-O2):
define double @wavegen_triangle(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fsub double %0, %3
%5 = fmul double %4, 4.000000e+00
%6 = tail call double @pow(i32 -1, double %3)
%7 = tail call double @llvm.fmuladd.f64(double %5, double %6, double -1.000000e+00)
ret double %7
}
int __attribute__((version_selector)) featureTest() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @featureTest() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Just one small step for coders. One giant leep for");
  printf(" programmers!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"Just one small step for coders. One giant leep for\00"
@.str.1 = [15 x i8] c" programmers!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"Just one small step for coders. One giant leep for\00"
@str = [14 x i8] c" programmers!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ strstr(char const *, char const *);
int selected(const char *filter, const char *name) {
  if (filter == 0)
    return 1;
  return strstr(name, filter) ? 1 : 0;
}


x86 assembly (clang, -O0):
<selected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <selected+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1158 <selected+0x48>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selected>:
test   %rdi,%rdi
je     1134 <selected+0x24>
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @selected(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %16
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = load i8*, i8** %4
%12 = call i64 @strstr(i8* %10, i8* %11)
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @selected(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @strstr(i8* %1, i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void terminate_window(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @terminate_window() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_highvideo(void) { conio_init(); }


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

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

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

LLVM IR (-O2):
define void @caca_conio_highvideo() {
%1 = tail call i32 (...) @conio_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ stdout;
void cutils_cout_double_print(double number) {
  fprintf(stdout, "%lf\n", number);
}


x86 assembly (clang, -O0):
<cutils_cout_double_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cout_double_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"%lf\0A\00"
define void @cutils_cout_double_print(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @stdout
%4 = load double, double* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%lf\0A\00"
define void @cutils_cout_double_print(double %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(int argc, const char *argv[]) {
  float weight;
  weight = 14.2;
  float cookingTime;
  cookingTime = 15.0 + 15.0 * weight;
  printf("Cookit for %f minutes.\n", cookingTime);
  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)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebc(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Cookit for %f minutes.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x402C666660000000, float* %6
%8 = load float, float* %6
%9 = fpext float %8 to double
%10 = call double @llvm.fmuladd.f64(double 1.500000e+01, double %9, double 1.500000e+01)
%11 = fptrunc double %10 to float
store float %11, float* %7
%12 = load float, float* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), float %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Cookit for %f minutes.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), float 2.280000e+02)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t CountCombinations(int cardinality, int groups) {
  int64_t c, g, combinations = 0;
  return combinations;
}


x86 assembly (clang, -O0):
<CountCombinations>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @CountCombinations(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ inv_fifo_protocol_helper_decode_acc_data(void const *,
                                                            int /*<<< orphan*/,
                                                            float *, float *,
                                                            float *);
void inv_fifo_protocol_helper_decode_linear_acc_data(const void *in,
                                                     uint16_t len, float *x,
                                                     float *y, float *z) {
  inv_fifo_protocol_helper_decode_acc_data(in, len, x, y, z);
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_linear_acc_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <inv_fifo_protocol_helper_decode_acc_data@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_linear_acc_data>:
jmp    1030 <inv_fifo_protocol_helper_decode_acc_data@plt>

LLVM IR (-O0):
define void @inv_fifo_protocol_helper_decode_linear_acc_data(i8* %0, i32 %1, float* %2, float* %3, float* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
store i8* %0, i8** %6
store i32 %1, i32* %7
store float* %2, float** %8
store float* %3, float** %9
store float* %4, float** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load float*, float** %8
%14 = load float*, float** %9
%15 = load float*, float** %10
%16 = call i32 @inv_fifo_protocol_helper_decode_acc_data(i8* %11, i32 %12, float* %13, float* %14, float* %15)
ret void
}

LLVM IR (-O2):
define void @inv_fifo_protocol_helper_decode_linear_acc_data(i8* %0, i32 %1, float* %2, float* %3, float* %4) {
%6 = tail call i32 @inv_fifo_protocol_helper_decode_acc_data(i8* %0, i32 %1, float* %2, float* %3, float* %4)
ret void
}
/* Variables and functions */
scalar_t__ pic_is_normal_IRQ(int);
int /*<<< orphan*/ pic_send_EOI_normal(int);
void isr_irq_7() {
  if (pic_is_normal_IRQ(7)) {
    pic_send_EOI_normal(7);
  }
}


x86 assembly (clang, -O0):
<isr_irq_7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <pic_is_normal_IRQ@plt>
cmp    $0x0,%rax
je     1142 <isr_irq_7+0x22>
mov    $0x7,%edi
call   1040 <pic_send_EOI_normal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isr_irq_7>:
push   %rax
mov    $0x7,%edi
call   1030 <pic_is_normal_IRQ@plt>
test   %rax,%rax
je     113b <isr_irq_7+0x1b>
mov    $0x7,%edi
pop    %rax
jmp    1040 <pic_send_EOI_normal@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @isr_irq_7() {
%1 = call i64 @pic_is_normal_IRQ(i32 7)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @pic_send_EOI_normal(i32 7)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @isr_irq_7() {
%1 = tail call i64 @pic_is_normal_IRQ(i32 7)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @pic_send_EOI_normal(i32 7)
br label %5
5: ; preds = %3, %0
ret void
}
void busy_wait(void) { __asm volatile("rep; nop" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @busy_wait() {
tail call void asm sideeffect "rep; nop", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct msg_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ NLA_ALIGN(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int /*<<< orphan*/);
void *msg_put(struct msg_buff *, int /*<<< orphan*/);
void *__nla_reserve_nohdr(struct msg_buff *msg, int attrlen) {
  void *start;
  start = msg_put(msg, NLA_ALIGN(attrlen));
  memset(start, 0, NLA_ALIGN(attrlen));
  return start;
}


x86 assembly (clang, -O0):
<__nla_reserve_nohdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <NLA_ALIGN@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <msg_put@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <NLA_ALIGN@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__nla_reserve_nohdr>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1050 <NLA_ALIGN@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <msg_put@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1050 <NLA_ALIGN@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.msg_buff = type { i32 }
define i8* @__nla_reserve_nohdr(%struct.msg_buff* %0, i32 %1) {
%3 = alloca %struct.msg_buff*
%4 = alloca i32
%5 = alloca i8*
store %struct.msg_buff* %0, %struct.msg_buff** %3
store i32 %1, i32* %4
%6 = load %struct.msg_buff*, %struct.msg_buff** %3
%7 = load i32, i32* %4
%8 = call i32 @NLA_ALIGN(i32 %7)
%9 = call i8* @msg_put(%struct.msg_buff* %6, i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%12 = call i32 @NLA_ALIGN(i32 %11)
%13 = call i32 @memset(i8* %10, i32 0, i32 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
%struct.msg_buff = type { i32 }
define i8* @__nla_reserve_nohdr(%struct.msg_buff* %0, i32 %1) {
%3 = tail call i32 @NLA_ALIGN(i32 %1)
%4 = tail call i8* @msg_put(%struct.msg_buff* %0, i32 %3)
%5 = tail call i32 @NLA_ALIGN(i32 %1)
%6 = tail call i32 @memset(i8* %4, i32 0, i32 %5)
ret i8* %4
}
long long uusu() { return 0x7fff7fffffff7fffLL; }


x86 assembly (clang, -O0):
<uusu>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff7fffffff7fff,%rax
7f ff 7f
pop    %rbp
ret

x86 assembly (clang, -O2):
<uusu>:
movabs $0x7fff7fffffff7fff,%rax
7f ff 7f
ret

LLVM IR (-O0):
define i64 @uusu() {
ret i64 9223231299366387711
}

LLVM IR (-O2):
define i64 @uusu() {
ret i64 9223231299366387711
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int SSL_shutdown(int /*<<< orphan*/ *);
int /*<<< orphan*/ shutdown(int, int);
void ssl_quit_client(SSL *ssl, int socket) {
  int r;
  r = SSL_shutdown(ssl);
  if (!r) {
    shutdown(socket, 1);
    r = SSL_shutdown(ssl);
  }
  SSL_free(ssl);
}


x86 assembly (clang, -O0):
<ssl_quit_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <SSL_shutdown@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    116e <ssl_quit_client+0x3e>
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1040 <shutdown@plt>
mov    -0x8(%rbp),%rdi
call   1050 <SSL_shutdown@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <SSL_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_quit_client>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <SSL_shutdown@plt>
test   %eax,%eax
jne    1155 <ssl_quit_client+0x25>
mov    %ebp,%edi
mov    $0x1,%esi
call   1040 <shutdown@plt>
mov    %rbx,%rdi
call   1050 <SSL_shutdown@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SSL_free@plt>

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

LLVM IR (-O2):
define void @ssl_quit_client(i32* %0, i32 %1) {
%3 = tail call i32 @SSL_shutdown(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @shutdown(i32 %1, i32 1)
%7 = tail call i32 @SSL_shutdown(i32* %0)
br label %8
8: ; preds = %5, %2
%9 = tail call i32 @SSL_free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Debugger();
int /*<<< orphan*/ ShowErrorMessage(char *, char *);
int /*<<< orphan*/ error();
int /*<<< orphan*/ kWriteLog(char *);
void GeneralProtectionFault() {
  Debugger();
  ShowErrorMessage("GP FAULT", "GENERAL PROTECTION FAULT");
  kWriteLog("GENERAL PROTECTION FAULT");
  error();
}


x86 assembly (clang, -O0):
<GeneralProtectionFault>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Debugger@plt>
lea    0xeae(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <ShowErrorMessage@plt>
lea    0xea4(%rip),%rdi
call   1040 <kWriteLog@plt>
mov    $0x0,%al
call   1050 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GeneralProtectionFault>:
push   %rbx
xor    %eax,%eax
call   1030 <Debugger@plt>
lea    0xeb1(%rip),%rdi
lea    0xeb3(%rip),%rbx
mov    %rbx,%rsi
call   1060 <ShowErrorMessage@plt>
mov    %rbx,%rdi
call   1040 <kWriteLog@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <error@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"GP FAULT\00"
@.str.1 = [25 x i8] c"GENERAL PROTECTION FAULT\00"
define void @GeneralProtectionFault() {
%1 = call i32 (...) @Debugger()
%2 = call i32 @ShowErrorMessage(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @kWriteLog(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @error()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"GP FAULT\00"
@.str.1 = [25 x i8] c"GENERAL PROTECTION FAULT\00"
define void @GeneralProtectionFault() {
%1 = tail call i32 (...) @Debugger()
%2 = tail call i32 @ShowErrorMessage(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @kWriteLog(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @error()
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t i;
  for (i = 0; *str != '\0'; str++, i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1142 <strlen+0x42>
jmp    1125 <strlen+0x25>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t u32_b0(uint32_t value) { return (uint8_t)(value & 0x000000FF); }


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

x86 assembly (clang, -O2):
<u32_b0>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @u32_b0(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
char dj_load_mod(unsigned char *file_handle, char *filename, char mod_num) {
  return 0;
}


x86 assembly (clang, -O0):
<dj_load_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @dj_load_mod(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
ret i8 0
}

LLVM IR (-O2):
define signext i8 @dj_load_mod(i8* nocapture readnone %0, i8* nocapture readnone %1, i8 signext %2) {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ gcall(char *);
glneg() { gcall("^lneg"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"^lneg\00"
define i32 @glneg() {
%1 = alloca i32
%2 = call i32 @gcall(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"^lneg\00"
define i32 @glneg() {
%1 = tail call i32 @gcall(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int border_width;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
void set_XConfigureEvent_border_width(void *_p, int _v) {
  ((XConfigureEvent *)_p)->border_width = (int)_v;
}


x86 assembly (clang, -O0):
<set_XConfigureEvent_border_width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XConfigureEvent_border_width>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XConfigureEvent_border_width(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XConfigureEvent_border_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void doexit(int status) { exit(status); }


x86 assembly (clang, -O0):
<doexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<doexit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @doexit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
void UI_add_error_string(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_add_error_string() {
ret void
}
void g_closure_get_type() {}


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

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

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

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