xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ checked_write(int, char *, int);
int /*<<< orphan*/ set_tbh_size(char *, int);
void tbh_write(int fd, char buf[], int buffsize) {
  char header_buf[2];
  ;
  set_tbh_size(header_buf, buffsize);
  checked_write(fd, header_buf, 2);
  checked_write(fd, buf, buffsize);
  return;
}


x86 assembly (clang, -O0):
<tbh_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x16(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <set_tbh_size@plt>
mov    -0x4(%rbp),%edi
lea    -0x16(%rbp),%rsi
mov    $0x2,%edx
call   1040 <checked_write@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <checked_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbh_write>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0x6(%rsp),%r15
mov    %r15,%rdi
mov    %edx,%esi
call   1030 <set_tbh_size@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x2,%edx
call   1040 <checked_write@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <checked_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @tbh_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [2 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @set_tbh_size(i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%13 = call i32 @checked_write(i32 %11, i8* %12, i32 2)
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i32 @checked_write(i32 %14, i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @tbh_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = call i32 @set_tbh_size(i8* %5, i32 %2)
%7 = call i32 @checked_write(i32 %0, i8* %5, i32 2)
%8 = call i32 @checked_write(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_parith_op();
int /*<<< orphan*/ arm_parith_qadd(int /*<<< orphan*/);
void arm_qadd() { arm_parith_qadd(arm_parith_op()); }


x86 assembly (clang, -O0):
<arm_qadd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_parith_op@plt>
mov    %eax,%edi
call   1040 <arm_parith_qadd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_qadd>:
push   %rax
xor    %eax,%eax
call   1030 <arm_parith_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_parith_qadd@plt>

LLVM IR (-O0):
define void @arm_qadd() {
%1 = call i32 (...) @arm_parith_op()
%2 = call i32 @arm_parith_qadd(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_qadd() {
%1 = tail call i32 (...) @arm_parith_op()
%2 = tail call i32 @arm_parith_qadd(i32 %1)
ret void
}
/* Variables and functions */
int option_write_string(char *, void const *, size_t);
int option_write_path(char *out, const void *in, size_t n) {
  return option_write_string(out, in, n);
}


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

x86 assembly (clang, -O2):
<option_write_path>:
jmp    1030 <option_write_string@plt>

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

LLVM IR (-O2):
define i32 @option_write_path(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @option_write_string(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
void strcpy(char *s, char *t) {
  int i;
  i = 0;
  while ((s[i] = t[i]) != '\0')
    i++;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1143 <strcpy+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
unsigned char xyToIndex(unsigned char x, unsigned char y) {
  unsigned char nChip, addr;
  if (x >= 32) {
    nChip = 3 + x / 16 + (y > 7 ? 2 : 0);
  } else {
    nChip = 1 + x / 16 + (y > 7 ? 2 : 0);
  }
  x = x % 16;
  y = y % 8;
  addr = (x << 1) + (y >> 2);
  return addr;
}


x86 assembly (clang, -O0):
<xyToIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jl     1147 <xyToIndex+0x47>
movzbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
add    $0x3,%eax
movzbl -0x2(%rbp),%esi
xor    %ecx,%ecx
mov    $0x2,%edx
cmp    $0x7,%esi
cmovg  %edx,%ecx
add    %ecx,%eax
mov    %al,-0x3(%rbp)
jmp    116c <xyToIndex+0x6c>
movzbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
movzbl -0x2(%rbp),%esi
xor    %ecx,%ecx
mov    $0x2,%edx
cmp    $0x7,%esi
cmovg  %edx,%ecx
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
movzbl -0x2(%rbp),%ecx
sar    $0x2,%ecx
add    %ecx,%eax
mov    %al,-0x4(%rbp)
movzbl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyToIndex>:
lea    (%rdi,%rdi,1),%eax
and    $0x1e,%al
shr    $0x2,%sil
and    $0x1,%sil
or     %sil,%al
ret

LLVM IR (-O0):
define zeroext i8 @xyToIndex(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = icmp sge i32 %8, 32
br i1 %9, label %10, label %22
10: ; preds = %2
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = sdiv i32 %12, 16
%14 = add nsw i32 3, %13
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = icmp sgt i32 %16, 7
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 2, i32 0
%20 = add nsw i32 %14, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
br label %34
22: ; preds = %2
%23 = load i8, i8* %3
%24 = zext i8 %23 to i32
%25 = sdiv i32 %24, 16
%26 = add nsw i32 1, %25
%27 = load i8, i8* %4
%28 = zext i8 %27 to i32
%29 = icmp sgt i32 %28, 7
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 2, i32 0
%32 = add nsw i32 %26, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %5
br label %34
34: ; preds = %22, %10
%35 = load i8, i8* %3
%36 = zext i8 %35 to i32
%37 = srem i32 %36, 16
%38 = trunc i32 %37 to i8
store i8 %38, i8* %3
%39 = load i8, i8* %4
%40 = zext i8 %39 to i32
%41 = srem i32 %40, 8
%42 = trunc i32 %41 to i8
store i8 %42, i8* %4
%43 = load i8, i8* %3
%44 = zext i8 %43 to i32
%45 = shl i32 %44, 1
%46 = load i8, i8* %4
%47 = zext i8 %46 to i32
%48 = ashr i32 %47, 2
%49 = add nsw i32 %45, %48
%50 = trunc i32 %49 to i8
store i8 %50, i8* %6
%51 = load i8, i8* %6
ret i8 %51
}

LLVM IR (-O2):
define zeroext i8 @xyToIndex(i8 zeroext %0, i8 zeroext %1) {
%3 = shl i8 %0, 1
%4 = and i8 %3, 30
%5 = lshr i8 %1, 2
%6 = and i8 %5, 1
%7 = or i8 %6, %4
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ __mriPlatform_CommSendChar(int /*<<< orphan*/);
void writeStringToSharedCommChannel(const char *pString) {
  while (*pString)
    __mriPlatform_CommSendChar(*pString++);
}


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

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

LLVM IR (-O0):
define void @writeStringToSharedCommChannel(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 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @__mriPlatform_CommSendChar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @writeStringToSharedCommChannel(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @__mriPlatform_CommSendChar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *timingString(long);
void printDiffTimer(long usecs) { printf("%s\n", timingString(usecs)); }


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

x86 assembly (clang, -O2):
<printDiffTimer>:
push   %rax
call   1040 <timingString@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printDiffTimer(i64 %0) {
%2 = tail call i8* @timingString(i64 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intro();
int /*<<< orphan*/ mainLoop();
int main(int argc, char *argv[]) {
  intro();
  mainLoop();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <intro@plt>
mov    $0x0,%al
call   1040 <mainLoop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @intro()
%4 = tail call i32 (...) @mainLoop()
ret i32 0
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
struct item *do_make_item(char *, char *, char *, char *);
struct item *make_item(char *word, char *cog, char *sim, char *syn) {
  return do_make_item(word, cog, sim, syn);
}


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

x86 assembly (clang, -O2):
<make_item>:
jmp    1030 <do_make_item@plt>

LLVM IR (-O0):
%struct.item = type { i32 }
define %struct.item* @make_item(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call %struct.item* @do_make_item(i8* %9, i8* %10, i8* %11, i8* %12)
ret %struct.item* %13
}

LLVM IR (-O2):
%struct.item = type { i32 }
define %struct.item* @make_item(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call %struct.item* @do_make_item(i8* %0, i8* %1, i8* %2, i8* %3)
ret %struct.item* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
unsigned int getraw(uint8_t *byte, uint8_t *istream) {
  *byte = *istream;
  return 1;
}


x86 assembly (clang, -O0):
<getraw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getraw(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 = load i32, i32* %5
%7 = load i32*, i32** %3
store i32 %6, i32* %7
ret i32 1
}

LLVM IR (-O2):
define i32 @getraw(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex4array_(void *x, unsigned int *n) {
  pushNarray((char *)x, (*n * 4));
}


x86 assembly (clang, -O0):
<pushcomplex4array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x2,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushcomplex4array_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex4array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 4
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushcomplex4array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
void SocketShutDown(void) {}


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

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

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

LLVM IR (-O2):
define void @SocketShutDown() {
ret void
}
int test_imm_8Eint64_midword_reg(long long val) {
  return ((val >> 16) & (0x8E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Eint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x8e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_8Eint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 142
%6 = icmp ne i64 %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_8Eint64_midword_reg(i64 %0) {
%2 = and i64 %0, 9306112
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int solution(double t, double y[], void *params) {
  double *pars = (double *)params;
  y[0] = 0.0;
  y[1] = 0.0;
  y[2] = 0.0;
  y[3] = 0.0;
  return 0;
}


x86 assembly (clang, -O0):
<solution>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<solution>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @solution(double %0, double* %1, i8* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca i8*
%7 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to double*
store double* %9, double** %7
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
store double 0.000000e+00, double* %11
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 1
store double 0.000000e+00, double* %13
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 2
store double 0.000000e+00, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 3
store double 0.000000e+00, double* %17
ret i32 0
}

LLVM IR (-O2):
define i32 @solution(double %0, double* nocapture writeonly %1, i8* nocapture readnone %2) {
%4 = bitcast double* %1 to i8*
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[20];
  scanf("%s", word);
  check(word, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <scanf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1040 <check@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <check@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @check(i8* %5, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @check(i8* %2, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() { printf("Usage: caesar_cipher shift text\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: caesar_cipher shift text\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"Usage: caesar_cipher shift text\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memory_error();
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    memory_error();
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1040 <memory_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xmalloc+0x15>
xor    %eax,%eax
call   1040 <memory_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @memory_error()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFDIR;
scalar_t__ stat(char const *, struct stat *);
int dirExists(char const *path) {
  struct stat info;
  if (stat(path, &info) != 0)
    return 0;
  else if (info.st_mode & S_IFDIR)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<dirExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <dirExists+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1167 <dirExists+0x57>
mov    -0x18(%rbp),%eax
mov    0x2e8f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1160 <dirExists+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1167 <dirExists+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirExists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1125 <dirExists+0x15>
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rsp)
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @dirExists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFDIR
%10 = and i32 %9, %8
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %1
%14 = phi i32 [ 0, %1 ], [ %12, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ myfunc();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int retv = 0;
  myfunc();
  printf("A silly test app\n");
  return retv;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <myfunc@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [17 x i8] c"A silly test app\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @myfunc()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_uni_w_qpel_hv24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv24_10_sse4() {
ret void
}
int strptrlen(char **strptr) {
  int len = 0;
  while (strptr[len++])
    ;
  return len - 1;
}


x86 assembly (clang, -O0):
<strptrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1131 <strptrlen+0x31>
jmp    110f <strptrlen+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strptrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <strptrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strptrlen(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8*, i8** %0, i64 %3
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void RTSemFastMutexDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemFastMutexDestroy() {
ret void
}
/* Variables and functions */
scalar_t__ strdup(void *);
char *toStringString(void *a) { return (char *)strdup(a); }


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

x86 assembly (clang, -O2):
<toStringString>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @toStringString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strdup(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @toStringString(i8* %0) {
%2 = tail call i64 @strdup(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
double sqrt(double const);
double magnitudeVector_double(const double *u) {
  return (sqrt(u[0] * u[0] + u[1] * u[1] + u[2] * u[2]));
}


x86 assembly (clang, -O0):
<magnitudeVector_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magnitudeVector_double>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <magnitudeVector_double+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @magnitudeVector_double(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @magnitudeVector_double(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
int howMany(const char *s, char c) {
  int n = 0;
  while (*s) {
    if (*s == c)
      ++n;
    ++s;
  }
  return n;
}


x86 assembly (clang, -O0):
<howMany>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <howMany+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <howMany+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <howMany+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<howMany>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <howMany+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <howMany+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @howMany(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Variables and functions */
void retro_cheat_set(unsigned index, bool enabled, const char *code) {}


x86 assembly (clang, -O0):
<retro_cheat_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @retro_cheat_set(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
__attribute__((no)) q() {}


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

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

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

LLVM IR (-O2):
define i32 @q() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ get_byte_code();
void get_short_code(void) {
  get_byte_code();
  get_byte_code();
}


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

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

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

LLVM IR (-O2):
define void @get_short_code() {
%1 = tail call i32 (...) @get_byte_code()
%2 = tail call i32 (...) @get_byte_code()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t eqntohint16(const uint8_t *data) { return *(int16_t *)data; }


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

x86 assembly (clang, -O2):
<eqntohint16>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @eqntohint16(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int putchar(int ch) {
  fputc(ch, stdout);
  return 1;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputc(i32 %3, i32 %4)
ret i32 1
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputc(i32 %0, i32 %2)
ret i32 1
}
void AtomicBarrier() {}


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

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

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

LLVM IR (-O2):
define void @AtomicBarrier() {
ret void
}
int pci_eth_init(struct bd_info *bis) {
  int num = 0;
  return num;
}


x86 assembly (clang, -O0):
<pci_eth_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bd_info = type opaque
define i32 @pci_eth_init(%struct.bd_info* %0) {
%2 = alloca %struct.bd_info*
%3 = alloca i32
store %struct.bd_info* %0, %struct.bd_info** %2
store i32 0, i32* %3
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.bd_info = type opaque
define i32 @pci_eth_init(%struct.bd_info* nocapture readnone %0) {
ret i32 0
}
int tosNet_getIPAddrLen(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @tosNet_getIPAddrLen() {
ret i32 4
}

LLVM IR (-O2):
define i32 @tosNet_getIPAddrLen() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(unsigned int);
void print_notice_hex32(unsigned int value) { __console_tx_hex32(value); }


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

x86 assembly (clang, -O2):
<print_notice_hex32>:
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_notice_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int n_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
  int s;
  s = vsnprintf(str, size, fmt, ap);
  if (s < 0 || (unsigned)s >= size)
    return size - 1;
  return s;
}


x86 assembly (clang, -O0):
<n_vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jl     1155 <n_vsnprintf+0x45>
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%rax
jb     1165 <n_vsnprintf+0x55>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x4(%rbp)
jmp    116b <n_vsnprintf+0x5b>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_vsnprintf>:
push   %rbx
mov    %rsi,%rbx
call   1030 <vsnprintf@plt>
mov    %eax,%ecx
lea    -0x1(%rbx),%edx
cmp    %rbx,%rcx
mov    %edx,%ecx
cmovb  %eax,%ecx
test   %eax,%eax
cmovs  %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @n_vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = icmp sgt i32 %5, -1
%7 = zext i32 %5 to i64
%8 = icmp ult i64 %7, %1
%9 = and i1 %6, %8
%10 = trunc i64 %1 to i32
%11 = add i32 %10, -1
%12 = select i1 %9, i32 %5, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void display_help(char **name) {
  printf("%s [-t][-a <address>][-p <port>][-w]\n", name[0]);
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"%s [-t][-a <address>][-p <port>][-w]\0A\00"
define void @display_help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"%s [-t][-a <address>][-p <port>][-w]\0A\00"
define void @display_help(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ y;
  int /*<<< orphan*/ x;
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ event;
};
typedef TYPE_1__ XGravityEvent;
typedef int /*<<< orphan*/ XEvent;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/);
void do_GravityNotify(XEvent *eventp) {
  XGravityEvent *e = (XGravityEvent *)eventp;
  printf("    event 0x%lx, window 0x%lx, (%d,%d)\n", e->event, e->window, e->x,
         e->y);
}


x86 assembly (clang, -O0):
<do_GravityNotify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%r8d
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_GravityNotify>:
mov    0xc(%rdi),%esi
mov    0x8(%rdi),%edx
mov    (%rdi),%r8d
mov    0x4(%rdi),%ecx
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32, i32, i32 }
@.str = [40 x i8] c" event 0x%lx, window 0x%lx, (%d,%d)\0A\00"
define void @do_GravityNotify(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.TYPE_2__*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = bitcast i32* %4 to %struct.TYPE_2__*
store %struct.TYPE_2__* %5, %struct.TYPE_2__** %3
%6 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%7 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %6, i32 0, i32 3
%8 = load i32, i32* %7
%9 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i32 0, i32 2
%11 = load i32, i32* %10
%12 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%13 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%16 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11, i32 %14, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c" event 0x%lx, window 0x%lx, (%d,%d)\0A\00"
define void @do_GravityNotify(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = load i32, i32* %0
%9 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void JobSigUnlock(sigset_t *omaskp) {
  (void)sigprocmask(SIG_SETMASK, omaskp, NULL);
}


x86 assembly (clang, -O0):
<JobSigUnlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JobSigUnlock>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
jmp    1030 <sigprocmask@plt>

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
define void @JobSigUnlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @SIG_SETMASK
%4 = load i32*, i32** %2
%5 = call i32 @sigprocmask(i32 %3, i32* %4, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
define void @JobSigUnlock(i32* %0) {
%2 = load i32, i32* @SIG_SETMASK
%3 = tail call i32 @sigprocmask(i32 %2, i32* %0, i32* null)
ret void
}