xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ string(char *);
void space(void) { string(" "); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @space() {
%1 = tail call i32 @string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
long long int llabs(long long int j) { return (j > 0) ? (j) : (-j); }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <llabs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llabs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
int inet6_opt_get_val(void *databuf, int offset, void *val, socklen_t vallen) {
  memcpy(val, (u_int8_t *)databuf + offset, vallen);
  return (offset + vallen);
}


x86 assembly (clang, -O0):
<inet6_opt_get_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_opt_get_val>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
movslq %esi,%rbx
lea    (%rdi,%rbx,4),%rsi
mov    %rdx,%rdi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inet6_opt_get_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %8
%16 = call i32 @memcpy(i8* %9, i32* %14, i32 %15)
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @inet6_opt_get_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = tail call i32 @memcpy(i8* %2, i32* %7, i32 %3)
%9 = add nsw i32 %3, %1
ret i32 %9
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *c_strcpy(char *arg0, const char *arg1) { return strcpy(arg0, arg1); }


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

x86 assembly (clang, -O2):
<c_strcpy>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @c_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strcpy(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @c_strcpy(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  assume(x < 0);
  assume(y > 0);
  assert((x ^ y) < 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assume(i32 %6)
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assume(i32 %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = xor i32 %12, %13
%15 = icmp slt i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assume(i32 0)
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int mutt_strcmp(const char *a, const char *b) {
  return strcmp(a ? a : "", b ? b : "");
}


x86 assembly (clang, -O0):
<mutt_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <mutt_strcmp+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <mutt_strcmp+0x38>
lea    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <mutt_strcmp+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <mutt_strcmp+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <mutt_strcmp+0x68>
lea    0xe91(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <mutt_strcmp+0x68>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_strcmp>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
test   %rsi,%rsi
cmove  %rax,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @mutt_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i8*, i8** %3
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i8* [ %8, %7 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %9 ]
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i8*, i8** %4
br label %17
16: ; preds = %10
br label %17
17: ; preds = %16, %14
%18 = phi i8* [ %15, %14 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %16 ]
%19 = call i32 @strcmp(i8* %11, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @mutt_strcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void AESLengthSet(uint32_t ui32Base, uint64_t ui64Length) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000054))) = (uint32_t)(ui64Length);
  (*((volatile uint32_t *)(ui32Base + 0x00000058))) =
      (uint32_t)(ui64Length >> 32);
}


x86 assembly (clang, -O0):
<AESLengthSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x54(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x58(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESLengthSet>:
movslq %esi,%rax
mov    %rax,0x54(%rdi)
ret

LLVM IR (-O0):
define void @AESLengthSet(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = load i64, i64* %3
%8 = add nsw i64 %7, 84
%9 = inttoptr i64 %8 to i64*
store volatile i64 %6, i64* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 32
%12 = sext i32 %11 to i64
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 88
%15 = inttoptr i64 %14 to i64*
store volatile i64 %12, i64* %15
ret void
}

LLVM IR (-O2):
define void @AESLengthSet(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = add nsw i64 %0, 84
%5 = inttoptr i64 %4 to i64*
store volatile i64 %3, i64* %5
%6 = add nsw i64 %0, 88
%7 = inttoptr i64 %6 to i64*
store volatile i64 poison, i64* %7
ret void
}
void print_intel_cstates(void) {}


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

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

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

LLVM IR (-O2):
define void @print_intel_cstates() {
ret void
}
/* Variables and functions */
char getchar();
scalar_t__ isalpha(char);
int /*<<< orphan*/ putchar(char);
int main() {
  char ch;
  while ((ch = getchar()) != '\n') {
    if (isalpha(ch))
      putchar(ch + 1);
    else
      putchar(ch);
  }
  putchar(ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     118a <main+0x5a>
movsbl -0x5(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
je     117c <main+0x4c>
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1185 <main+0x55>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1166 <main+0x36>
movsbl %al,%ebx
mov    %ebx,%edi
call   1050 <isalpha@plt>
cmp    $0x1,%rax
sbb    $0xff,%bl
movsbl %bl,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %12, label %3
3: ; preds = %0, %3
%4 = phi i8 [ %10, %3 ], [ %1, %0 ]
%5 = tail call i64 @isalpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i8
%8 = add i8 %4, %7
%9 = tail call i32 @putchar(i8 signext %8)
%10 = tail call signext i8 (...) @getchar()
%11 = icmp eq i8 %10, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %0
%13 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ grava_li(int, char *);
void rot8_sem() { grava_li(2, "$S"); }


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

x86 assembly (clang, -O2):
<rot8_sem>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <grava_li@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"$S\00"
define void @rot8_sem() {
%1 = tail call i32 @grava_li(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
void smacUartDebug_byte(char byte) {}


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

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

LLVM IR (-O0):
define void @smacUartDebug_byte(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret void
}

LLVM IR (-O2):
define void @smacUartDebug_byte(i8 signext %0) {
ret void
}
int sliceModeIfReal(int mrcMode) {
  if (mrcMode == 0)
    return 0;
  else if (mrcMode == 1)
    return 1;
  else if (mrcMode == 6)
    return 6;
  else if (mrcMode == 2)
    return 2;
  return -1;
}


x86 assembly (clang, -O0):
<sliceModeIfReal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <sliceModeIfReal+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1175 <sliceModeIfReal+0x75>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <sliceModeIfReal+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1175 <sliceModeIfReal+0x75>
cmpl   $0x6,-0x8(%rbp)
jne    1149 <sliceModeIfReal+0x49>
movl   $0x6,-0x4(%rbp)
jmp    1175 <sliceModeIfReal+0x75>
cmpl   $0x2,-0x8(%rbp)
jne    115f <sliceModeIfReal+0x5f>
movl   $0x2,-0x4(%rbp)
jmp    1175 <sliceModeIfReal+0x75>
jmp    1164 <sliceModeIfReal+0x64>
jmp    1169 <sliceModeIfReal+0x69>
jmp    116e <sliceModeIfReal+0x6e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sliceModeIfReal>:
mov    $0xffffffff,%eax
cmp    $0x6,%edi
ja     1117 <sliceModeIfReal+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.sliceModeIfReal = [7 x i32] [i32 0, i32 1, i32 2, i32 -1, i32 -1, i32 -1, i32 6]
define i32 @sliceModeIfReal(i32 %0) {
%2 = icmp ult i32 %0, 7
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.sliceModeIfReal, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
int f(int i) { return 3 + i; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ rot13c(int);
void main(void) {
  int c;
  while ((c = getchar()) != EOF)
    putchar(rot13c(c));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
je     1165 <main+0x35>
mov    -0x4(%rbp),%edi
call   1040 <rot13c@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1138 <main+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%eax
je     1169 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1040 <rot13c@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @main() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @rot13c(i32 %7)
%9 = call i32 @putchar(i32 %8)
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @rot13c(i32 %5)
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int ia_bit64(int /*<<< orphan*/ const, int);
bool ia_bitv64(const uint64_t *words, int i) {
  return ia_bit64(words[i / 64], i % 64);
}


x86 assembly (clang, -O0):
<ia_bitv64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
call   1030 <ia_bit64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ia_bitv64>:
lea    0x3f(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
sar    $0x6,%ecx
movslq %ecx,%rcx
mov    (%rdi,%rcx,4),%edi
and    $0xffffffc0,%eax
sub    %eax,%esi
jmp    1030 <ia_bit64@plt>

LLVM IR (-O0):
define i32 @ia_bitv64(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 64
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = srem i32 %11, 64
%13 = call i32 @ia_bit64(i32 %10, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @ia_bitv64(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 64
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = srem i32 %1, 64
%8 = tail call i32 @ia_bit64(i32 %6, i32 %7)
ret i32 %8
}
int quad(int x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i32 @quad(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
char *malloc(unsigned long);
void doit(unsigned long chunk_size) {
  char *buf;
  buf = malloc(chunk_size);
}


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

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

LLVM IR (-O0):
define void @doit(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
ret void
}

LLVM IR (-O2):
define void @doit(i64 %0) {
ret void
}
unsigned char njClip(const int x) {
  return (x < 0) ? 0 : ((x > 0xFF) ? 0xFF : (unsigned char)x);
}


x86 assembly (clang, -O0):
<njClip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <njClip+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <njClip+0x44>
cmpl   $0xff,-0x4(%rbp)
jle    1135 <njClip+0x35>
mov    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <njClip+0x3e>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<njClip>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @njClip(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %6
br label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
%13 = zext i8 %12 to i32
br label %14
14: ; preds = %10, %9
%15 = phi i32 [ 255, %9 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %5
%17 = phi i32 [ 0, %5 ], [ %15, %14 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @njClip(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ wFree(char *);
scalar_t__ wMalloc(int);
scalar_t__ wStackPopNumber();
int /*<<< orphan*/ wStackPushChar(char *, int /*<<< orphan*/);
void wBuiltinHex() {
  int i;
  char *buffer = (char *)wMalloc(16);
  i = (int)wStackPopNumber();
  sprintf(buffer, "%x", i);
  wStackPushChar(buffer, 0);
  wFree(buffer);
}


x86 assembly (clang, -O0):
<wBuiltinHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1040 <wMalloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <wStackPopNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe82(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1070 <wStackPushChar@plt>
mov    -0x10(%rbp),%rdi
call   1050 <wFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinHex>:
push   %rbx
mov    $0x10,%edi
call   1040 <wMalloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <wStackPopNumber@plt>
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <wStackPushChar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <wFree@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define void @wBuiltinHex() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i64 @wMalloc(i32 16)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = call i64 (...) @wStackPopNumber()
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = load i8*, i8** %2
%8 = load i32, i32* %1
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %2
%11 = call i32 @wStackPushChar(i8* %10, i32 0)
%12 = load i8*, i8** %2
%13 = call i32 @wFree(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define void @wBuiltinHex() {
%1 = tail call i64 @wMalloc(i32 16)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 (...) @wStackPopNumber()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @wStackPushChar(i8* %2, i32 0)
%7 = tail call i32 @wFree(i8* %2)
ret void
}
/* Type definitions */
typedef void pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ event_mm_free_(void *);
void *event_mm_malloc_(int);
scalar_t__ pthread_cond_init(void *, int /*<<< orphan*/ *);
void *evthread_posix_cond_alloc(unsigned condflags) {
  pthread_cond_t *cond = event_mm_malloc_(sizeof(pthread_cond_t));
  if (!cond)
    return NULL;
  if (pthread_cond_init(cond, NULL)) {
    event_mm_free_(cond);
    return NULL;
  }
  return cond;
}


x86 assembly (clang, -O0):
<evthread_posix_cond_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <event_mm_malloc_@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <evthread_posix_cond_alloc+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1196 <evthread_posix_cond_alloc+0x66>
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_cond_init@plt>
cmp    $0x0,%rax
je     118e <evthread_posix_cond_alloc+0x5e>
mov    -0x18(%rbp),%rdi
call   1050 <event_mm_free_@plt>
movq   $0x0,-0x8(%rbp)
jmp    1196 <evthread_posix_cond_alloc+0x66>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evthread_posix_cond_alloc>:
push   %rbx
mov    $0x1,%edi
call   1030 <event_mm_malloc_@plt>
test   %rax,%rax
je     115a <evthread_posix_cond_alloc+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <pthread_cond_init@plt>
test   %rax,%rax
je     115c <evthread_posix_cond_alloc+0x2c>
mov    %rbx,%rdi
call   1050 <event_mm_free_@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @evthread_posix_cond_alloc(i32 %0) {
%2 = tail call i8* @event_mm_malloc_(i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @pthread_cond_init(i8* %2, i32* null)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @event_mm_free_(i8* %2)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i8* [ null, %7 ], [ null, %1 ], [ %2, %4 ]
ret i8* %10
}
int ROUND(double x) { return (int)(x + 0.5); }


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

x86 assembly (clang, -O2):
<ROUND>:
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @ROUND(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ROUND(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = fptosi double %2 to i32
ret i32 %3
}
void swapInt(void *a, void *b) {
  int *x = *(int *)a;
  int *y = *(int *)b;
  int aux = *x;
  *x = *y;
  *y = aux;
}


x86 assembly (clang, -O0):
<swapInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapInt>:
movslq (%rdi),%rax
movslq (%rsi),%rcx
mov    (%rax),%edx
mov    (%rcx),%esi
mov    %esi,(%rax)
mov    %edx,(%rcx)
ret

LLVM IR (-O0):
define void @swapInt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %5
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store i32* %17, i32** %6
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
store i32 %19, i32* %7
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = load i32*, i32** %5
store i32 %21, i32* %22
%23 = load i32, i32* %7
%24 = load i32*, i32** %6
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @swapInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = bitcast i8* %1 to i32*
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* %6
%12 = load i32, i32* %10
store i32 %12, i32* %6
store i32 %11, i32* %10
ret void
}
/* Variables and functions */
int huix_rand(int);
int time(int /*<<< orphan*/ *);
int get_rand_num() {
  int seed = time(NULL);
  return huix_rand(seed);
}


x86 assembly (clang, -O0):
<get_rand_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <huix_rand@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_rand_num() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @huix_rand(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_rand_num() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @huix_rand(i32 %1)
ret i32 %2
}
/* Variables and functions */
double app_tminterval(int, int);
double tm_Time_F(int s) { return app_tminterval(s, 1); }


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

x86 assembly (clang, -O2):
<tm_Time_F>:
mov    $0x1,%esi
jmp    1030 <app_tminterval@plt>

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

LLVM IR (-O2):
define double @tm_Time_F(i32 %0) {
%2 = tail call double @app_tminterval(i32 %0, i32 1)
ret double %2
}
int output_frames_src_16_to_48(int input_frames) {
  if (input_frames > 320)
    return -1;
  return 3 * input_frames;
}


x86 assembly (clang, -O0):
<output_frames_src_16_to_48>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x140,-0x8(%rbp)
jle    1120 <output_frames_src_16_to_48+0x20>
movl   $0xffffffff,-0x4(%rbp)
jmp    1127 <output_frames_src_16_to_48+0x27>
imul   $0x3,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_frames_src_16_to_48>:
cmp    $0x141,%edi
lea    (%rdi,%rdi,2),%ecx
mov    $0xffffffff,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @output_frames_src_16_to_48(i32 %0) {
%2 = icmp sgt i32 %0, 320
%3 = mul nsw i32 %0, 3
%4 = select i1 %2, i32 -1, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  if (argc != 2)
    usage();
  test(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1130 <main+0x10>
xor    %eax,%eax
call   1030 <usage@plt>
mov    0x8(%rbx),%rdi
call   1040 <test@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @test(i8* %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int mktime(struct tm *);
int mu_utc_offset(void) {
  time_t t = 0;
  struct tm *tm = gmtime(&t);
  return -mktime(tm);
}


x86 assembly (clang, -O0):
<mu_utc_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mktime@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_utc_offset>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <gmtime@plt>
mov    %rax,%rdi
call   1030 <mktime@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @mu_utc_offset() {
%1 = alloca i32
%2 = alloca %struct.tm*
store i32 0, i32* %1
%3 = call %struct.tm* @gmtime(i32* %1)
store %struct.tm* %3, %struct.tm** %2
%4 = load %struct.tm*, %struct.tm** %2
%5 = call i32 @mktime(%struct.tm* %4)
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @mu_utc_offset() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call %struct.tm* @gmtime(i32* %1)
%4 = call i32 @mktime(%struct.tm* %3)
%5 = sub nsw i32 0, %4
ret i32 %5
}
void *swap_value(void **location, void *new_value) {
  void *old_value = *location;
  *location = new_value;
  return old_value;
}


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

x86 assembly (clang, -O2):
<swap_value>:
mov    (%rdi),%rax
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define i8* @swap_value(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
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %3
store i8* %8, i8** %9
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define i8* @swap_value(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
store i8* %1, i8** %0
ret i8* %3
}
void INT_Excep_TMR3_OVI3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TMR3_OVI3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_arithm_shift_right(void) {
  gen_pop();
  gen_call("ccasr");
}


x86 assembly (clang, -O0):
<gen_arithm_shift_right>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_arithm_shift_right>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"ccasr\00"
define void @gen_arithm_shift_right() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int ld_eq_mr2(long double *a1, long double a2) { return !(((*a1) == (a2))); }


x86 assembly (clang, -O0):
<ld_eq_mr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_eq_mr2>:
fldt   0x8(%rsp)
fldt   (%rdi)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ld_eq_mr2(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp oeq x86_fp80 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_eq_mr2(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp une x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int setpgrp();
int Setpgrp(int pid, int gid) { return setpgrp(); }


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

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

LLVM IR (-O0):
define i32 @Setpgrp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @setpgrp()
ret i32 %5
}

LLVM IR (-O2):
define i32 @Setpgrp(i32 %0, i32 %1) {
%3 = tail call i32 (...) @setpgrp()
ret i32 %3
}
/* Variables and functions */
scalar_t__ is_sep(char const);
int __sep_len(const char *s) {
  int l;
  for (l = 0; is_sep(*s); l++)
    s++;
  return l;
}


x86 assembly (clang, -O0):
<__sep_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_sep@plt>
cmp    $0x0,%rax
je     1153 <__sep_len+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <__sep_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sep_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <is_sep@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1144 <__sep_len+0x34>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_sep@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <__sep_len+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @__sep_len(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 i8, i8* %5
%7 = call i64 @is_sep(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @__sep_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_sep(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = tail call i64 @is_sep(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/ *);
void uninitvar_freopen(void) {
  char *filename;
  char *mode;
  FILE *stream;
  FILE *p = freopen(filename, mode, stream);
  free(p);
}


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

x86 assembly (clang, -O2):
<uninitvar_freopen>:
push   %rax
call   1040 <freopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @uninitvar_freopen() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32*
%5 = load i8*, i8** %1
%6 = load i8*, i8** %2
%7 = load i32*, i32** %3
%8 = call i32* @freopen(i8* %5, i8* %6, i32* %7)
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @uninitvar_freopen() {
%1 = tail call i32* @freopen(i8* undef, i8* undef, i32* undef)
%2 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outportb(int, int);
extern void WriteEDAC(int index, int val) {
  outportb(0x83C8, index);
  outportb(0x83C6, val);
}


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

x86 assembly (clang, -O2):
<WriteEDAC>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x83c8,%edi
call   1030 <outportb@plt>
mov    $0x83c6,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outportb@plt>

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

LLVM IR (-O2):
define void @WriteEDAC(i32 %0, i32 %1) {
%3 = tail call i32 @outportb(i32 33736, i32 %0)
%4 = tail call i32 @outportb(i32 33734, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint64_t decode_uint64(uint8_t *buf) {
  uint64_t upper = (uint64_t)ntohl(*(uint32_t *)buf);
  uint64_t lower = (uint64_t)ntohl(*(uint32_t *)(buf + 4));
  return (upper << 32) + lower;
}


x86 assembly (clang, -O0):
<decode_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
call   1030 <ntohl@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_uint64>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <ntohl@plt>
mov    0x10(%rbx),%edi
pop    %rbx
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @decode_uint64(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 @ntohl(i32 %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 4
%10 = load i32, i32* %9
%11 = call i32 @ntohl(i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = shl i32 %12, 32
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @decode_uint64(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ntohl(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = load i32, i32* %4
%6 = tail call i32 @ntohl(i32 %5)
ret i32 poison
}
unsigned xrop3_85_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  stk1 = ~D;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_85_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_85_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_85_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = xor i32 %14, -1
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = xor i32 %17, -1
%19 = and i32 %16, %18
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = and i32 %20, %21
%23 = or i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @xrop3_85_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -256
ret i32 %5
}