xunge/DecIR huggingface dataset:
/* Variables and functions */
int from_gps(int);
int data_retent_r(void) { return (from_gps(0xe4)); }


x86 assembly (clang, -O0):
<data_retent_r>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe4,%edi
call   1030 <from_gps@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_retent_r>:
mov    $0xe4,%edi
jmp    1030 <from_gps@plt>

LLVM IR (-O0):
define i32 @data_retent_r() {
%1 = call i32 @from_gps(i32 228)
ret i32 %1
}

LLVM IR (-O2):
define i32 @data_retent_r() {
%1 = tail call i32 @from_gps(i32 228)
ret i32 %1
}
/* Variables and functions */
int msgsnd(int, void *, int, int /*<<< orphan*/);
int msg_queue_write(int que_id, void *msg, int len) {
  return msgsnd(que_id, msg, len, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @msg_queue_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @msgsnd(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, void **);
void fthread_join(pthread_t *theThread) {
  int value = 0;
  pthread_join(*theThread, (void **)&value);
}


x86 assembly (clang, -O0):
<fthread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
call   1030 <pthread_join@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fthread_join>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    (%rdi),%edi
lea    0x4(%rsp),%rsi
call   1030 <pthread_join@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fthread_join(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = bitcast i32* %3 to i8**
%7 = call i32 @pthread_join(i32 %5, i8** %6)
ret void
}

LLVM IR (-O2):
define void @fthread_join(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* %0
%5 = bitcast i32* %2 to i8**
%6 = call i32 @pthread_join(i32 %4, i8** %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ethernet_reset();
void arch_decomp_setup(void) { ethernet_reset(); }


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

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

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

LLVM IR (-O2):
define void @arch_decomp_setup() {
%1 = tail call i32 (...) @ethernet_reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putnl(void) { write(1, "\n", 1); }


x86 assembly (clang, -O0):
<ft_putnl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
lea    0xee0(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnl>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putnl() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putnl() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int bma250_read_reg(unsigned char, unsigned char *, int);
int bma250_read_reg_byte(unsigned char adr) {
  unsigned char buf = 0xff;
  int err;
  err = bma250_read_reg(adr, &buf, 1);
  if (err == 0) {
    return buf;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bma250_read_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movb   $0xff,-0x6(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <bma250_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114d <bma250_read_reg_byte+0x3d>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <bma250_read_reg_byte+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bma250_read_reg_byte>:
push   %rax
movb   $0xff,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <bma250_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bma250_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
store i8 -1, i8* %2
%3 = call i32 @bma250_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
int main(int argc, char *argv[]) {
  argc = argc;
  argv = argv;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
store i32 %6, i32* %4
%7 = load i8**, i8*** %5
store i8** %7, i8*** %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int add(int x, int y) { return 24 + x + y; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
add    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 24, %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 24
%4 = add nsw i32 %3, %1
ret i32 %4
}
float sinx(float theta, float sintheta) {
  if (theta > -0.003 && theta < 0.003)
    return (1);
  else
    return (sintheta / theta);
}


x86 assembly (clang, -O0):
<sinx>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1156 <sinx+0x56>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1156 <sinx+0x56>
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1165 <sinx+0x65>
movss  -0xc(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinx>:
cvtss2sd %xmm0,%xmm2
movsd  0xef4(%rip),%xmm3
ucomisd %xmm2,%xmm3
divss  %xmm0,%xmm1
ja     1125 <sinx+0x25>
movaps %xmm1,%xmm0
ucomisd 0xee7(%rip),%xmm2
jbe    1137 <sinx+0x37>
jmp    113a <sinx+0x3a>
movss  0xee3(%rip),%xmm0
ucomisd 0xed3(%rip),%xmm2
ja     113a <sinx+0x3a>
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sinx(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fcmp ogt double %7, -3.000000e-03
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 3.000000e-03
br i1 %12, label %13, label %14
13: ; preds = %9
store float 1.000000e+00, float* %3
br label %18
14: ; preds = %9, %2
%15 = load float, float* %5
%16 = load float, float* %4
%17 = fdiv float %15, %16
store float %17, float* %3
br label %18
18: ; preds = %14, %13
%19 = load float, float* %3
ret float %19
}

LLVM IR (-O2):
define float @sinx(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fcmp ogt double %3, -3.000000e-03
%5 = fcmp olt double %3, 3.000000e-03
%6 = and i1 %4, %5
%7 = fdiv float %1, %0
%8 = select i1 %6, float 1.000000e+00, float %7
ret float %8
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t u4_from_buffer(const uint8_t *b) {
  return b[0] << 24 | b[1] << 16 | b[2] << 8 | b[3] << 0;
}


x86 assembly (clang, -O0):
<u4_from_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u4_from_buffer>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @u4_from_buffer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = shl i32 %19, 0
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @u4_from_buffer(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *acr_strdup(const char *to_duplicate) {
  if (!to_duplicate)
    return NULL;
  size_t string_size = strlen(to_duplicate);
  char *copy = malloc(string_size + 1 * sizeof(*copy));
  memcpy(copy, to_duplicate, string_size + 1);
  return copy;
}


x86 assembly (clang, -O0):
<acr_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <acr_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118f <acr_strdup+0x5f>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acr_strdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1161 <acr_strdup+0x31>
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1164 <acr_strdup+0x34>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @acr_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* null, i8** %2
br label %21
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = call i8* @malloc(i64 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i64, i64* %4
%18 = add i64 %17, 1
%19 = call i32 @memcpy(i8* %15, i8* %16, i64 %18)
%20 = load i8*, i8** %5
store i8* %20, i8** %2
br label %21
21: ; preds = %9, %8
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @acr_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %5)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ fs_http_init();
int /*<<< orphan*/ fs_posix_init();
void fs_init(void) {
  fs_posix_init();
  fs_http_init();
}


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

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

LLVM IR (-O0):
define void @fs_init() {
%1 = call i32 (...) @fs_posix_init()
%2 = call i32 (...) @fs_http_init()
ret void
}

LLVM IR (-O2):
define void @fs_init() {
%1 = tail call i32 (...) @fs_posix_init()
%2 = tail call i32 (...) @fs_http_init()
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;
typedef int int16_t;

/* Variables and functions */
uint32_t blez(int32_t reg1, int16_t kte, uint32_t *pc) {
  int32_t ktebuffer;
  if (reg1 <= 0) {
    ktebuffer = kte << 2;
    *pc = *pc + ktebuffer;
    return *pc;
  } else {
    return *pc;
  }
}


x86 assembly (clang, -O0):
<blez>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1148 <blez+0x48>
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <blez+0x53>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blez>:
test   %rdi,%rdi
jle    1109 <blez+0x9>
mov    (%rdx),%rax
ret
shl    $0x2,%esi
movslq %esi,%rax
add    (%rdx),%rax
mov    %rax,(%rdx)
ret

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

LLVM IR (-O2):
define i64 @blez(i64 %0, i32 %1, i64* nocapture %2) {
%4 = icmp slt i64 %0, 1
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = shl i32 %1, 2
%7 = sext i32 %6 to i64
%8 = load i64, i64* %2
%9 = add nsw i64 %8, %7
store i64 %9, i64* %2
br label %12
10: ; preds = %3
%11 = load i64, i64* %2
br label %12
12: ; preds = %10, %5
%13 = phi i64 [ %9, %5 ], [ %11, %10 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ accept();
int /*<<< orphan*/ bind();
int /*<<< orphan*/ connect();
int /*<<< orphan*/ listen();
int /*<<< orphan*/ socket();
int /*<<< orphan*/ socketpair();
main() {
  socket();
  socketpair();
  bind();
  listen();
  accept();
  connect();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <socket@plt>
mov    $0x0,%al
call   1030 <socketpair@plt>
mov    $0x0,%al
call   1050 <bind@plt>
mov    $0x0,%al
call   1040 <listen@plt>
mov    $0x0,%al
call   1060 <accept@plt>
mov    $0x0,%al
call   1070 <connect@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <socket@plt>
xor    %eax,%eax
call   1030 <socketpair@plt>
xor    %eax,%eax
call   1050 <bind@plt>
xor    %eax,%eax
call   1040 <listen@plt>
xor    %eax,%eax
call   1060 <accept@plt>
xor    %eax,%eax
call   1070 <connect@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @socket()
%2 = call i32 (...) @socketpair()
%3 = call i32 (...) @bind()
%4 = call i32 (...) @listen()
%5 = call i32 (...) @accept()
%6 = call i32 (...) @connect()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @socket()
%2 = tail call i32 (...) @socketpair()
%3 = tail call i32 (...) @bind()
%4 = tail call i32 (...) @listen()
%5 = tail call i32 (...) @accept()
%6 = tail call i32 (...) @connect()
ret i32 0
}
unsigned long long ackermann(unsigned int m, unsigned long long n) {
  if (m == 0) {
    return n + 1;
  }
  if (n == 0) {
    return ackermann(m - 1, 1);
  }
  return ackermann(m - 1, ackermann(m, n - 1));
}


x86 assembly (clang, -O0):
<ackermann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113a <ackermann+0x2a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <ackermann+0x76>
cmpq   $0x0,-0x18(%rbp)
jne    115e <ackermann+0x4e>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <ackermann@plt>
mov    %rax,-0x8(%rbp)
jmp    1186 <ackermann+0x76>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
call   1030 <ackermann@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,%rsi
call   1030 <ackermann@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ackermann>:
push   %rbx
mov    %rsi,%rax
test   %edi,%edi
je     1142 <ackermann+0x32>
mov    %edi,%ebx
jmp    112a <ackermann+0x1a>
nopl   0x0(%rax)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     1142 <ackermann+0x32>
test   %rax,%rax
je     1120 <ackermann+0x10>
add    $0xffffffffffffffff,%rax
mov    %ebx,%edi
mov    %rax,%rsi
call   1030 <ackermann@plt>
add    $0xffffffff,%ebx
jne    112a <ackermann+0x1a>
add    $0x1,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @ackermann(i32 %0, i64 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i64 [ %1, %2 ], [ %12, %11 ]
%6 = add i64 %5, 1
ret i64 %6
7: ; preds = %2, %11
%8 = phi i64 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i64 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i64 [ %17, %15 ], [ 1, %7 ]
%13 = add i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add i64 %8, -1
%17 = tail call i64 @ackermann(i32 %9, i64 %16)
br label %11
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void print_desc(const char *format, va_list args) {
  printf(" - ");
  vprintf(format, args);
}


x86 assembly (clang, -O0):
<print_desc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <vprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_desc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <vprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c" - \00"
define void @print_desc(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @vprintf(i8* %0, i32 %1)
ret void
}
void CFGMR3QueryString(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryString() {
ret void
}
int fun1046() { return 1046; }


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

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

LLVM IR (-O0):
define i32 @fun1046() {
ret i32 1046
}

LLVM IR (-O2):
define i32 @fun1046() {
ret i32 1046
}
int test_imm_D2uint8_reg(unsigned char val) {
  return ((val) & (-0xD2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D2uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff2e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D2uint8_reg>:
test   $0x2e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D2uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 46
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errout(char *);
void f_pass(void) { errout("PASS option not implemented"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"PASS option not implemented\00"
define void @f_pass() {
%1 = call i32 @errout(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"PASS option not implemented\00"
define void @f_pass() {
%1 = tail call i32 @errout(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printint(int b) { printf("%d\n", b); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_prefetch(int *, int, int);
void prefetch(int i) {
  __builtin_arm_prefetch(&i, 0, 1);
  __builtin_arm_prefetch(&i, 1, 1);
  __builtin_arm_prefetch(&i, 1, 0);
}


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

x86 assembly (clang, -O2):
<prefetch>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <__builtin_arm_prefetch@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <__builtin_arm_prefetch@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <__builtin_arm_prefetch@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @prefetch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__builtin_arm_prefetch(i32* %2, i32 0, i32 1)
%4 = call i32 @__builtin_arm_prefetch(i32* %2, i32 1, i32 1)
%5 = call i32 @__builtin_arm_prefetch(i32* %2, i32 1, i32 0)
ret void
}
char parse_around_emu() {}


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

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

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

LLVM IR (-O2):
define signext i8 @parse_around_emu() {
ret i8 undef
}
int MPI_Initialized(int *flag) {
  (*flag) = 1;
  return 0;
}


x86 assembly (clang, -O0):
<MPI_Initialized>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Initialized>:
movl   $0x1,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @MPI_Initialized(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret i32 0
}
double DisplacementScore(double displacement) { return (4 - displacement); }


x86 assembly (clang, -O0):
<DisplacementScore>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplacementScore>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @DisplacementScore(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 4.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @DisplacementScore(double %0) {
%2 = fsub double 4.000000e+00, %0
ret double %2
}
int arithmetics(int a, int b) {
  a = b + 4;
  a = a + a;
  a += a;
  b -= b;
  a = a * b;
  a % b;
  a / b;
  a %= b;
  a /= b;
  a *= b;
  a &b;
  a | b;
  a &= a;
  a |= a;
}


x86 assembly (clang, -O0):
<arithmetics>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @arithmetics(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 4
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = add nsw i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, %14
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = mul nsw i32 %17, %18
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = srem i32 %20, %21
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = sdiv i32 %23, %24
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = srem i32 %27, %26
store i32 %28, i32* %4
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = sdiv i32 %30, %29
store i32 %31, i32* %4
%32 = load i32, i32* %5
%33 = load i32, i32* %4
%34 = mul nsw i32 %33, %32
store i32 %34, i32* %4
%35 = load i32, i32* %4
%36 = load i32, i32* %5
%37 = and i32 %35, %36
%38 = load i32, i32* %4
%39 = load i32, i32* %5
%40 = or i32 %38, %39
%41 = load i32, i32* %4
%42 = load i32, i32* %4
%43 = and i32 %42, %41
store i32 %43, i32* %4
%44 = load i32, i32* %4
%45 = load i32, i32* %4
%46 = or i32 %45, %44
store i32 %46, i32* %4
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
define i32 @arithmetics(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ terminate_application();
void dsm_terminate(void) { (void)terminate_application(); }


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

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

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

LLVM IR (-O2):
define void @dsm_terminate() {
%1 = tail call i32 (...) @terminate_application()
ret void
}
void autonomous12() {}


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

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

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

LLVM IR (-O2):
define void @autonomous12() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int usputc(char const, int /*<<< orphan*/);
int tputs(const char *s) {
  while (*s) {
    if (usputc(*s, STDIN_FILENO) == -1)
      return -1;
    s++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1166 <tputs+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <usputc@plt>
cmp    $0xffffffff,%eax
jne    1155 <tputs+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <tputs+0x5d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <tputs+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tputs>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
xor    %r14d,%r14d
test   %al,%al
je     1153 <tputs+0x43>
mov    %rdi,%rbx
add    $0x1,%rbx
mov    0x2eb5(%rip),%rbp
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp),%esi
movsbl %al,%edi
call   1030 <usputc@plt>
cmp    $0xffffffff,%eax
je     114d <tputs+0x3d>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <tputs+0x20>
jmp    1153 <tputs+0x43>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @tputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %13
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %13, %4 ], [ %0, %1 ]
%10 = load i32, i32* @STDIN_FILENO
%11 = tail call i32 @usputc(i8 signext %8, i32 %10)
%12 = icmp eq i32 %11, -1
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %14, label %4
14: ; preds = %7, %4, %1
%15 = phi i32 [ 0, %1 ], [ 0, %4 ], [ -1, %7 ]
ret i32 %15
}
int isnewline(int c) {
  if (c == '\n') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isnewline>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    111d <isnewline+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <isnewline+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnewline>:
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isnewline(i32 %0) {
%2 = icmp eq i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
void enable_interrupts(void) {}


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

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

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

LLVM IR (-O2):
define void @enable_interrupts() {
ret void
}
/* Variables and functions */
int momrand_genrand_int32();
long momrand_genrand_int31(void) {
  return (long)(momrand_genrand_int32() >> 1);
}


x86 assembly (clang, -O0):
<momrand_genrand_int31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <momrand_genrand_int32@plt>
sar    $0x1,%eax
cltq
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @momrand_genrand_int31() {
%1 = call i32 (...) @momrand_genrand_int32()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @momrand_genrand_int31() {
%1 = tail call i32 (...) @momrand_genrand_int32()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}
void steal_armor(struct battle_char *origin, struct battle_char *target) {}


x86 assembly (clang, -O0):
<steal_armor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.battle_char = type opaque
define void @steal_armor(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
ret void
}

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @steal_armor(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct party {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct party *);
int party_db_final(void *key, void *data, va_list ap) {
  struct party *p = data;
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<party_db_final>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<party_db_final>:
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.party = type { i32 }
define i32 @party_db_final(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.party*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to %struct.party*
store %struct.party* %9, %struct.party** %7
%10 = load %struct.party*, %struct.party** %7
%11 = call i32 @free(%struct.party* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.party = type { i32 }
define i32 @party_db_final(i8* nocapture readnone %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %1 to %struct.party*
%5 = tail call i32 @free(%struct.party* %4)
ret i32 0
}
/* Variables and functions */
double sinh(double);
double Sinh(double a, double b) { return sinh(a); }


x86 assembly (clang, -O0):
<Sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sinh>:
jmp    1030 <sinh@plt>

LLVM IR (-O0):
define double @Sinh(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @sinh(double %5)
ret double %6
}

LLVM IR (-O2):
define double @Sinh(double %0, double %1) {
%3 = tail call double @sinh(double %0)
ret double %3
}
/* Variables and functions */
int getopenobj();
int getopenobj_() { return (getopenobj()); }


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

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

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

LLVM IR (-O2):
define i32 @getopenobj_() {
%1 = tail call i32 (...) @getopenobj()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int gt_requiredUInt32Bits(int /*<<< orphan*/);
int gt_requiredUInt16Bits(uint16_t v) {
  return gt_requiredUInt32Bits((uint32_t)v);
}


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

x86 assembly (clang, -O2):
<gt_requiredUInt16Bits>:
jmp    1030 <gt_requiredUInt32Bits@plt>

LLVM IR (-O0):
define i32 @gt_requiredUInt16Bits(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @gt_requiredUInt32Bits(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @gt_requiredUInt16Bits(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @gt_requiredUInt32Bits(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void yyEnU8free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<yyEnU8free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yyEnU8free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct terminal {
  int dummy;
};
struct parm_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal *, int /*<<< orphan*/, int);
int sum(struct parm_t *);
void curs_back(struct terminal *term, void *arg) {
  int num = sum((struct parm_t *)arg);
  num = (num <= 0) ? 1 : num;
  move_cursor(term, 0, -num);
}


x86 assembly (clang, -O0):
<curs_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sum@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1153 <curs_back+0x33>
mov    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1159 <curs_back+0x39>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
sub    -0x14(%rbp),%edx
xor    %esi,%esi
call   1040 <move_cursor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curs_back>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <sum@plt>
test   %eax,%eax
mov    $0x1,%edx
cmovg  %eax,%edx
neg    %edx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <move_cursor@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_back(%struct.terminal* %0, i8* %1) {
%3 = alloca %struct.terminal*
%4 = alloca i8*
%5 = alloca i32
store %struct.terminal* %0, %struct.terminal** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.parm_t*
%8 = call i32 @sum(%struct.parm_t* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
br label %14
12: ; preds = %2
%13 = load i32, i32* %5
br label %14
14: ; preds = %12, %11
%15 = phi i32 [ 1, %11 ], [ %13, %12 ]
store i32 %15, i32* %5
%16 = load %struct.terminal*, %struct.terminal** %3
%17 = load i32, i32* %5
%18 = sub nsw i32 0, %17
%19 = call i32 @move_cursor(%struct.terminal* %16, i32 0, i32 %18)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_back(%struct.terminal* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.parm_t*
%4 = tail call i32 @sum(%struct.parm_t* %3)
%5 = icmp sgt i32 %4, 1
%6 = select i1 %5, i32 %4, i32 1
%7 = sub nsw i32 0, %6
%8 = tail call i32 @move_cursor(%struct.terminal* %0, i32 0, i32 %7)
ret void
}
/* Variables and functions */
bool nrf91_errata_12(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf91_errata_12() {
ret i32 0
}
/* Variables and functions */
int f341(int *);
int f342(int *p) { return f341(p); }


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

x86 assembly (clang, -O2):
<f342>:
jmp    1030 <f341@plt>

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

LLVM IR (-O2):
define i32 @f342(i32* %0) {
%2 = tail call i32 @f341(i32* %0)
ret i32 %2
}
int isspace(int c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' ||
         c == '\r';
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x4,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 12, label %5
i32 11, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}