xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadWord(int, unsigned short *);
int /*<<< orphan*/ VIM_SIF_I2cWriteWord(int, int /*<<< orphan*/);
unsigned char CheckId_MT9V112(void) {
  unsigned short temp;
  VIM_SIF_I2cWriteWord(0xf0, 0);
  VIM_SIF_I2cReadWord(0xff, &temp);
  if (temp == 0x1229)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CheckId_MT9V112>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf0,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteWord@plt>
mov    $0xff,%edi
lea    -0x4(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadWord@plt>
movzwl -0x4(%rbp),%eax
cmp    $0x1229,%eax
jne    115a <CheckId_MT9V112+0x3a>
movb   $0x1,-0x1(%rbp)
jmp    115e <CheckId_MT9V112+0x3e>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckId_MT9V112>:
push   %rax
mov    $0xf0,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteWord@plt>
lea    0x6(%rsp),%rsi
mov    $0xff,%edi
call   1030 <VIM_SIF_I2cReadWord@plt>
movzwl 0x6(%rsp),%eax
cmp    $0x1229,%eax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CheckId_MT9V112() {
%1 = alloca i8
%2 = alloca i16
%3 = call i32 @VIM_SIF_I2cWriteWord(i32 240, i32 0)
%4 = call i32 @VIM_SIF_I2cReadWord(i32 255, i16* %2)
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = icmp eq i32 %6, 4649
br i1 %7, label %8, label %9
8: ; preds = %0
store i8 1, i8* %1
br label %10
9: ; preds = %0
store i8 0, i8* %1
br label %10
10: ; preds = %9, %8
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @CheckId_MT9V112() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = tail call i32 @VIM_SIF_I2cWriteWord(i32 240, i32 0)
%4 = call i32 @VIM_SIF_I2cReadWord(i32 255, i16* %1)
%5 = load i16, i16* %1
%6 = icmp eq i16 %5, 4649
%7 = zext i1 %6 to i8
ret i8 %7
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IXGRP;
int S_IXOTH;
int S_IXUSR;
int S_ISEXE(mode_t mode) { return ((S_IXUSR | S_IXGRP | S_IXOTH) & mode); }


x86 assembly (clang, -O0):
<S_ISEXE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
mov    0x2ec1(%rip),%rcx
or     (%rcx),%eax
mov    0x2ec8(%rip),%rcx
or     (%rcx),%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_ISEXE>:
mov    0x2ed9(%rip),%rcx
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2ecf(%rip),%rcx
or     (%rcx),%eax
and    %edi,%eax
ret

LLVM IR (-O0):
@S_IXUSR = global i32 0
@S_IXGRP = global i32 0
@S_IXOTH = global i32 0
define i32 @S_ISEXE(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @S_IXUSR
%4 = load i32, i32* @S_IXGRP
%5 = or i32 %3, %4
%6 = load i32, i32* @S_IXOTH
%7 = or i32 %5, %6
%8 = load i32, i32* %2
%9 = and i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
@S_IXUSR = global i32 0
@S_IXGRP = global i32 0
@S_IXOTH = global i32 0
define i32 @S_ISEXE(i32 %0) {
%2 = load i32, i32* @S_IXUSR
%3 = load i32, i32* @S_IXGRP
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IXOTH
%6 = or i32 %4, %5
%7 = and i32 %6, %0
ret i32 %7
}
int do_096() { return 96; }


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

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

LLVM IR (-O0):
define i32 @do_096() {
ret i32 96
}

LLVM IR (-O2):
define i32 @do_096() {
ret i32 96
}
int main() {
  int i, j, k, true = 0;
  char ss;
  scanf("%s", ss);
  printf("Abbreviation ==> Full Name");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movsbl -0x15(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [27 x i8] c"Abbreviation ==> Full Name\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [27 x i8] c"Abbreviation ==> Full Name\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t aeron_logbuffer_compute_term_offset_from_position(
    int64_t position, size_t position_bits_to_shift) {
  int64_t mask = (1l << position_bits_to_shift) - 1l;
  return (int32_t)(position & mask);
}


x86 assembly (clang, -O0):
<aeron_logbuffer_compute_term_offset_from_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_logbuffer_compute_term_offset_from_position>:
mov    %rsi,%rcx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @aeron_logbuffer_compute_term_offset_from_position(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = shl i64 1, %6
%8 = sub nsw i64 %7, 1
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = and i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @aeron_logbuffer_compute_term_offset_from_position(i32 %0, i64 %1) {
%3 = shl nsw i64 -1, %1
%4 = trunc i64 %3 to i32
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
ret i32 %6
}
char *strcpy(char *d, const char *s) {
  char *r = d;
  for (; *s; s++, d++)
    *d = *s;
  return r;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <strcpy+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1120 <strcpy+0x20>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_split() {
  printf("NOT IMPLEMENTED:"
         "pa_split"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"NOT IMPLEMENTED:pa_split\0A\00"
define i32 @pa_split() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [25 x i8] c"NOT IMPLEMENTED:pa_split\00"
define i32 @pa_split() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_RenderingControl_SetRedVideoGain(
    struct UPnPService *Service, int ErrorCode, void *User) {
  printf("RND Invoke Response: "
         "RenderingControl/SetRedVideoGain[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_SetRedVideoGain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [72 x i8] c"RND Invoke Response: RenderingControl/SetRedVideoGain[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetRedVideoGain(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [72 x i8] c"RND Invoke Response: RenderingControl/SetRedVideoGain[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetRedVideoGain(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handle_signal(int sig) { printf("OK\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define void @handle_signal(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int GLubyte;
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
GLdouble extractUbyte(int isSwap, const void *ubyte) {
  isSwap = isSwap;
  assert(*((const GLubyte *)ubyte) <= 255);
  return (GLdouble)(*((const GLubyte *)ubyte));
}


x86 assembly (clang, -O0):
<extractUbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xff,(%rax)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractUbyte>:
push   %rbx
mov    %rsi,%rbx
xor    %edi,%edi
cmpl   $0x100,(%rsi)
setl   %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @extractUbyte(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
store i32 %5, i32* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, 255
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @extractUbyte(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 256
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ arc1(double, double, double, double, double);
int /*<<< orphan*/ default_line_gwt();
int /*<<< orphan*/ set_line_gwt(double, double, int);
void arc(double x1, double y1, double r1, double t1, double t2, double g,
         double w, int it) {
  set_line_gwt(g, w, it);
  arc1(x1, y1, r1, t1, t2);
  default_line_gwt();
  return;
}


x86 assembly (clang, -O0):
<arc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
mov    %edi,-0x3c(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mov    -0x3c(%rbp),%edi
call   1030 <set_line_gwt@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
call   1050 <arc1@plt>
mov    $0x0,%al
call   1040 <default_line_gwt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc>:
sub    $0x28,%rsp
movsd  %xmm4,0x20(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movaps %xmm5,%xmm0
movaps %xmm6,%xmm1
call   1030 <set_line_gwt@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
movsd  0x20(%rsp),%xmm4
call   1050 <arc1@plt>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1040 <default_line_gwt@plt>

LLVM IR (-O0):
define void @arc(double %0, double %1, double %2, double %3, double %4, double %5, double %6, i32 %7) {
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca i32
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store i32 %7, i32* %16
%17 = load double, double* %14
%18 = load double, double* %15
%19 = load i32, i32* %16
%20 = call i32 @set_line_gwt(double %17, double %18, i32 %19)
%21 = load double, double* %9
%22 = load double, double* %10
%23 = load double, double* %11
%24 = load double, double* %12
%25 = load double, double* %13
%26 = call i32 @arc1(double %21, double %22, double %23, double %24, double %25)
%27 = call i32 (...) @default_line_gwt()
ret void
}

LLVM IR (-O2):
define void @arc(double %0, double %1, double %2, double %3, double %4, double %5, double %6, i32 %7) {
%9 = tail call i32 @set_line_gwt(double %5, double %6, i32 %7)
%10 = tail call i32 @arc1(double %0, double %1, double %2, double %3, double %4)
%11 = tail call i32 (...) @default_line_gwt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void checkpoint_now() { printf("Checkpoint now.\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Checkpoint now.\00"
define void @checkpoint_now() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void puts(char *s) {
  while (*s) {
    putchar(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <puts+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void pthread_exit(void *retval) { _exit(*(int *)retval); }


x86 assembly (clang, -O0):
<pthread_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<pthread_exit>:
push   %rax
mov    (%rdi),%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define void @pthread_exit(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @_exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ load_date(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int solve(int /*<<< orphan*/, int /*<<< orphan*/);
void load(FILE *in) {
  time_t actual = load_date(in);
  time_t expected = load_date(in);
  printf("%d\n", solve(actual, expected));
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <load_date@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <load_date@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <solve@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <load_date@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <load_date@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <solve@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @load(i32* %0) {
%2 = tail call i32 @load_date(i32* %0)
%3 = tail call i32 @load_date(i32* %0)
%4 = tail call i32 @solve(i32 %2, i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
size_t wcsxfrm(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, size_t);
size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t n, locale_t locale) {
  return wcsxfrm(dest, src, n);
}


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

x86 assembly (clang, -O2):
<wcsxfrm_l>:
jmp    1030 <wcsxfrm@plt>

LLVM IR (-O0):
define i64 @wcsxfrm_l(i32* %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i64, i64* %7
%12 = call i64 @wcsxfrm(i32* %9, i32* %10, i64 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @wcsxfrm_l(i32* %0, i32* %1, i64 %2, i32 %3) {
%5 = tail call i64 @wcsxfrm(i32* %0, i32* %1, i64 %2)
ret i64 %5
}
/* Variables and functions */
int listen(int, int);
int /*<<< orphan*/ unix_error(char *);
int Listen(int s, int backlog) {
  int rc;
  if ((rc = listen(s, backlog)) < 0)
    unix_error("Listen error");
  return rc;
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <listen@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1151 <Listen+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rbx
call   1040 <listen@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Listen+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Listen error\00"
define i32 @Listen(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 = load i32, i32* %4
%8 = call i32 @listen(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"Listen error\00"
define i32 @Listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int vmemmap_find_next_valid_pfn(int node, int i) { return i + 1; }


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

x86 assembly (clang, -O2):
<vmemmap_find_next_valid_pfn>:
lea    0x1(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @vmemmap_find_next_valid_pfn(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void internal_error() {
  fflush(stdout);
  fprintf(stderr, "\n\nShrinkler has encountered an internal error.\n"
                  "Please send a bug report to blueberry@loonies.dk,\n"
                  "providing the file you tried to compress.\n"
                  "\n"
                  "Thanks, and apologies for the inconvenience.\n\n");
  fflush(stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<internal_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<internal_error>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e9a(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [187 x i8] c"\0A\0AShrinkler has encountered an internal error.\0APlease send a bug report to blueberry@loonies.dk,\0Aproviding the file you tried to compress.\0A\0AThanks, and apologies for the inconvenience.\0A\0A\00"
define void @internal_error() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [187 x i8] c"\0A\0AShrinkler has encountered an internal error.\0APlease send a bug report to blueberry@loonies.dk,\0Aproviding the file you tried to compress.\0A\0AThanks, and apologies for the inconvenience.\0A\0A\00"
define void @internal_error() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @exit(i32 1)
unreachable
}
int postinc_arg_idx(int *p, int i) {
  int j = i + 1;
  __builtin_prefetch(&p[i++], 0, 0);
  return i == j;
}


x86 assembly (clang, -O0):
<postinc_arg_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
prefetchnta (%rax)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<postinc_arg_idx>:
movslq %esi,%rax
prefetchnta (%rdi,%rax,4)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @postinc_arg_idx(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* %4
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
%13 = bitcast i32* %12 to i8*
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp eq i32 %14, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @postinc_arg_idx(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = bitcast i32* %4 to i8*
tail call void @llvm.prefetch.p0i8(i8* %5, i32 0, i32 0, i32 1)
ret i32 1
}
char *strchr_replace(char *s, int c, char r) {
  char *p;
  for (p = s; *p != '\0'; p++)
    if (*p == c)
      *p = r;
  return s;
}


x86 assembly (clang, -O0):
<strchr_replace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <strchr_replace+0x57>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1141 <strchr_replace+0x41>
mov    -0xd(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1146 <strchr_replace+0x46>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <strchr_replace+0x18>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr_replace>:
mov    %rdi,%rax
mov    (%rdi),%dil
test   %dil,%dil
je     1139 <strchr_replace+0x39>
lea    0x1(%rax),%rcx
jmp    112c <strchr_replace+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rcx),%edi
add    $0x1,%rcx
test   %dil,%dil
je     1139 <strchr_replace+0x39>
movsbl %dil,%edi
cmp    %esi,%edi
jne    1120 <strchr_replace+0x20>
mov    %dl,-0x1(%rcx)
jmp    1120 <strchr_replace+0x20>
ret

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

LLVM IR (-O2):
define i8* @strchr_replace(i8* returned %0, i32 %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %12
%7 = phi i8 [ %14, %12 ], [ %4, %3 ]
%8 = phi i8* [ %13, %12 ], [ %0, %3 ]
%9 = sext i8 %7 to i32
%10 = icmp eq i32 %9, %1
br i1 %10, label %11, label %12
11: ; preds = %6
store i8 %2, i8* %8
br label %12
12: ; preds = %6, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %12, %3
ret i8* %0
}
void dv3o_division(double *output, double *a, double b) {
  output[0] = a[0] / b;
  output[1] = a[1] / b;
  output[2] = a[2] / b;
}


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

x86 assembly (clang, -O2):
<dv3o_division>:
movsd  (%rsi),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x8(%rsi),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdi)
movsd  0x10(%rsi),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdi)
ret

LLVM IR (-O0):
define void @dv3o_division(double* %0, double* %1, double %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double %2, double* %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double, double* %6
%11 = fdiv double %9, %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double, double* %6
%18 = fdiv double %16, %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 1
store double %18, double* %20
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 2
%23 = load double, double* %22
%24 = load double, double* %6
%25 = fdiv double %23, %24
%26 = load double*, double** %4
%27 = getelementptr inbounds double, double* %26, i64 2
store double %25, double* %27
ret void
}

LLVM IR (-O2):
define void @dv3o_division(double* nocapture writeonly %0, double* nocapture %1, double %2) {
%4 = load double, double* %1
%5 = fdiv double %4, %2
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fdiv double %7, %2
%9 = getelementptr inbounds double, double* %0, i64 1
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = fdiv double %11, %2
%13 = getelementptr inbounds double, double* %0, i64 2
store double %12, double* %13
ret void
}
int Ten90ModeSMessageLenByType(int type) {
  return (type & 0x10) ? (14 * 8) : (7 * 8);
}


x86 assembly (clang, -O0):
<Ten90ModeSMessageLenByType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x10,%edx
mov    $0x38,%eax
mov    $0x70,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ten90ModeSMessageLenByType>:
test   $0x10,%dil
mov    $0x38,%ecx
mov    $0x70,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Ten90ModeSMessageLenByType(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 112, i32 56
ret i32 %7
}

LLVM IR (-O2):
define i32 @Ten90ModeSMessageLenByType(i32 %0) {
%2 = and i32 %0, 16
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 56, i32 112
ret i32 %4
}
unsigned short int f5(unsigned short int x, int y) {
  return (x << y) | (x >> ((-y) & (8 * 2 - 1)));
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0xf,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0xf,%cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f5(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = and i32 %12, 15
%14 = ashr i32 %10, %13
%15 = or i32 %8, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @f5(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = shl i32 %3, %1
%5 = sub nsw i32 0, %1
%6 = and i32 %5, 15
%7 = lshr i32 %3, %6
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Variables and functions */
scalar_t__ ft_is_delimeter(char);
void ft_advance_whitespace(char **str) {
  while (**str && ft_is_delimeter(**str))
    ++(*str);
}


x86 assembly (clang, -O0):
<ft_advance_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114d <ft_advance_whitespace+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <ft_is_delimeter@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115d <ft_advance_whitespace+0x4d>
jmp    1170 <ft_advance_whitespace+0x60>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <ft_advance_whitespace+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_advance_whitespace>:
push   %rbx
mov    (%rdi),%rax
mov    (%rax),%al
test   %al,%al
je     113f <ft_advance_whitespace+0x2f>
mov    %rdi,%rbx
nopl   (%rax)
movsbl %al,%edi
call   1030 <ft_is_delimeter@plt>
test   %rax,%rax
je     113f <ft_advance_whitespace+0x2f>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movzbl 0x1(%rax),%eax
test   %al,%al
jne    1120 <ft_advance_whitespace+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_advance_whitespace(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %17, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%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 = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = call i64 @ft_is_delimeter(i8 signext %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %9, %3
%16 = phi i1 [ false, %3 ], [ %14, %9 ]
br i1 %16, label %17, label %21
17: ; preds = %15
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
br label %3
21: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @ft_advance_whitespace(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i8 [ %12, %9 ], [ %3, %1 ]
%7 = tail call i64 @ft_is_delimeter(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = load i8*, i8** %0
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %0
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset_snake();
void Reset_Snake() { reset_snake(); }


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

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

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

LLVM IR (-O2):
define void @Reset_Snake() {
%1 = tail call i32 (...) @reset_snake()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cordic(int, int *, int *);
void gc_main(const int *g, const int *e, int *o) {
  int theta = g[0] ^ e[0];
  cordic(theta, &o[0], &o[1]);
}


x86 assembly (clang, -O0):
<gc_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
xor    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x4,%rdx
call   1030 <cordic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gc_main>:
mov    (%rsi),%eax
xor    (%rdi),%eax
lea    0x4(%rdx),%rcx
mov    %eax,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <cordic@plt>

LLVM IR (-O0):
define void @gc_main(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = xor i32 %10, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = call i32 @cordic(i32 %15, i32* %17, i32* %19)
ret void
}

LLVM IR (-O2):
define void @gc_main(i32* nocapture %0, i32* nocapture %1, i32* %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = xor i32 %5, %4
%7 = getelementptr inbounds i32, i32* %2, i64 1
%8 = tail call i32 @cordic(i32 %6, i32* %2, i32* %7)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read_16_le(unsigned char bytes[2]) {
  uint32_t result = 0;
  for (int i = 1; i >= 0; i--)
    result = (result << 8) | bytes[i];
  return result;
}


x86 assembly (clang, -O0):
<read_16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1145 <read_16_le+0x45>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read_16_le+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_16_le>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read_16_le(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ geteuid();
int /*<<< orphan*/ getgid();
int ssh_getpeereid(int s, uid_t *euid, gid_t *gid) {
  *euid = geteuid();
  *gid = getgid();
  return (0);
}


x86 assembly (clang, -O0):
<ssh_getpeereid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <geteuid@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <getgid@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssh_getpeereid>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <geteuid@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1040 <getgid@plt>
mov    %eax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ssh_getpeereid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 (...) @geteuid()
store i32 %4, i32* %1
%5 = tail call i32 (...) @getgid()
store i32 %5, i32* %2
ret i32 0
}
/* Variables and functions */
scalar_t__ strstr(char const *, char const *);
int strpos(const char *s1, const char *s2) {
  char *p = (char *)strstr(s1, s2);
  if (p) {
    return p - s1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114f <strpos+0x3f>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1156 <strpos+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @strpos(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %3, %5
%7 = trunc i64 %6 to i32
%8 = select i1 %4, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t detexPixel32GetA8(uint32_t pixel) {
  return (pixel & 0xFF000000) >> 24;
}


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

x86 assembly (clang, -O2):
<detexPixel32GetA8>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @detexPixel32GetA8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
ret i32 %5
}

LLVM IR (-O2):
define i32 @detexPixel32GetA8(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}