xunge/DecIR huggingface dataset:
/* Variables and functions */
int partition(int *, int);
void Qsort(int a[], int n) {
  int pindex;
  if (n <= 1)
    return;
  else {
    pindex = partition(a, n);
    Qsort(a, pindex);
    Qsort(a + pindex + 1, n - pindex - 1);
  }
}


x86 assembly (clang, -O0):
<Qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     113e <Qsort+0x1e>
jmp    117a <Qsort+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <Qsort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1040 <Qsort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qsort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     115f <Qsort+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <Qsort@plt>
movslq %ebp,%rax
lea    (%rbx,%rax,4),%rbx
add    $0x4,%rbx
not    %eax
add    %r14d,%eax
mov    %eax,%r14d
cmp    $0x1,%eax
jg     1130 <Qsort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Qsort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @partition(i32* %6, i32 %5)
tail call void @Qsort(i32* %6, i32 %7)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = getelementptr inbounds i32, i32* %9, i64 %8
%11 = xor i32 %7, -1
%12 = add i32 %5, %11
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret void
}
int test_imm_BEint64_midword_reg(long long val) {
  return ((val >> 16) & (0xBE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BEint64_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, 190
%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_BEint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12451840
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned short *__ia64_mk_io_addr(unsigned long);
int /*<<< orphan*/ ia64_mfa();
void ___ia64_outw(unsigned short val, unsigned long port) {
  volatile unsigned short *addr = __ia64_mk_io_addr(port);
  *addr = val;
  ia64_mfa();
}


x86 assembly (clang, -O0):
<___ia64_outw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__ia64_mk_io_addr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    $0x0,%al
call   1040 <ia64_mfa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___ia64_outw>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <__ia64_mk_io_addr@plt>
mov    %bx,(%rax)
xor    %eax,%eax
pop    %rbx
jmp    1040 <ia64_mfa@plt>

LLVM IR (-O0):
define void @___ia64_outw(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
%5 = alloca i16*
store i16 %0, i16* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i16* @__ia64_mk_io_addr(i64 %6)
store i16* %7, i16** %5
%8 = load i16, i16* %3
%9 = load i16*, i16** %5
store volatile i16 %8, i16* %9
%10 = call i32 (...) @ia64_mfa()
ret void
}

LLVM IR (-O2):
define void @___ia64_outw(i16 zeroext %0, i64 %1) {
%3 = tail call i16* @__ia64_mk_io_addr(i64 %1)
store volatile i16 %0, i16* %3
%4 = tail call i32 (...) @ia64_mfa()
ret void
}
const char *__attribute__((long_call)) __attribute__((section(".test.a")))
__attribute__((no)) strong_l2(void) {
  return "strong_l2";
}


x86 assembly (clang, -O0):
<strong_l2>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strong_l2>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"strong_l2\00"
define i8* @strong_l2() section ".test.a" {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"strong_l2\00"
define i8* @strong_l2() section ".test.a" {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
unsigned int shn_uchar_to_ulong_le(unsigned char *buf) {
  return (unsigned int)((buf[3] << 24) + (buf[2] << 16) + (buf[1] << 8) +
                        buf[0]);
}


x86 assembly (clang, -O0):
<shn_uchar_to_ulong_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @shn_uchar_to_ulong_le(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int input;
  scanf("%d", &input);
  printf("input number is %d\n", input);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [20 x i8] c"input number is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int test_imm_E2int16_reg(short val) {
  return ((val) & (0xE2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E2int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xe2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E2int16_reg(i16 signext %0) {
%2 = and i16 %0, 226
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printSudoku(int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void animateSudoku(int S[][9]) {
  printf("\033c");
  printSudoku(S);
  usleep(10000);
}


x86 assembly (clang, -O0):
<animateSudoku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <printSudoku@plt>
mov    $0x2710,%edi
call   1050 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<animateSudoku>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <printSudoku@plt>
mov    $0x2710,%edi
pop    %rbx
jmp    1050 <usleep@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1Bc\00"
define void @animateSudoku([9 x i32]* %0) {
%2 = alloca [9 x i32]*
store [9 x i32]* %0, [9 x i32]** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load [9 x i32]*, [9 x i32]** %2
%5 = bitcast [9 x i32]* %4 to i32**
%6 = call i32 @printSudoku(i32** %5)
%7 = call i32 @usleep(i32 10000)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1Bc\00"
define void @animateSudoku([9 x i32]* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = bitcast [9 x i32]* %0 to i32**
%4 = tail call i32 @printSudoku(i32** %3)
%5 = tail call i32 @usleep(i32 10000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenFileW314(short const *);
void openfilew(const short int *s) { OpenFileW314(s); }


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

x86 assembly (clang, -O2):
<openfilew>:
jmp    1030 <OpenFileW314@plt>

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

LLVM IR (-O2):
define void @openfilew(i16* %0) {
%2 = tail call i32 @OpenFileW314(i16* %0)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int greatest_string_equal_cb(const void *exp, const void *got, void *udata) {
  (void)udata;
  return (0 == strcmp((const char *)exp, (const char *)got));
}


x86 assembly (clang, -O0):
<greatest_string_equal_cb>:
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
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greatest_string_equal_cb>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @greatest_string_equal_cb(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp eq i64 0, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @greatest_string_equal_cb(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void Usage(const char *prog_name) {
  fprintf(stderr,
          "Usage is:\n%s [options] ip-address\n\nOptions:\n\t-s: silent mode, "
          "print nothing but the exit value is the ASN\n\t-h: help, print this "
          "message\n",
          prog_name);
  exit(1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [137 x i8] c"Usage is:\0A%s [options] ip-address\0A\0AOptions:\0A\09-s: silent mode, print nothing but the exit value is the ASN\0A\09-h: help, print this message\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [137 x i8] c"Usage is:\0A%s [options] ip-address\0A\0AOptions:\0A\09-s: silent mode, print nothing but the exit value is the ASN\0A\09-h: help, print this message\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
int /*<<< orphan*/ putnegd(int);
void putd(int i) {
  if (i < 0) {
    putc('-');
  } else {
    i = -i;
  }
  putnegd(i);
}


x86 assembly (clang, -O0):
<putd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1144 <putd+0x24>
mov    $0x2d,%edi
call   1040 <putc@plt>
jmp    114c <putd+0x2c>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putnegd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putd>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
js     112b <putd+0xb>
neg    %ebx
jmp    1135 <putd+0x15>
mov    $0x2d,%edi
call   1040 <putc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putnegd@plt>

LLVM IR (-O0):
define void @putd(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 %7
5: ; preds = %1
%6 = call i32 @putc(i8 signext 45)
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %2
%12 = call i32 @putnegd(i32 %11)
ret void
}

LLVM IR (-O2):
define void @putd(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putc(i8 signext 45)
br label %7
5: ; preds = %1
%6 = sub nsw i32 0, %0
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %0, %3 ], [ %6, %5 ]
%9 = tail call i32 @putnegd(i32 %8)
ret void
}
int Operand_my_decode(unsigned int *valp) {
  *valp += 2;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_my_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_my_decode>:
addl   $0x2,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_my_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 2
store i32 %3, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int match(const char *x, const char *a, const char *b) {
  return (!strcmp(x, a)) || (!strcmp(x, b));
}


x86 assembly (clang, -O0):
<match>:
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
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1159 <match+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcmp@plt>
test   %eax,%eax
je     1139 <match+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
jmp    113e <match+0x2e>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %2)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
int write_audio(int line, char *buf, int bytes) { return (-1); }


x86 assembly (clang, -O0):
<write_audio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @write_audio(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
bool can_go_u(int y, int n) { return y - n >= 0; }


x86 assembly (clang, -O0):
<can_go_u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_go_u>:
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @can_go_u(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 = sub nsw i32 %5, %6
%8 = icmp sge i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @can_go_u(i32 %0, i32 %1) {
%3 = icmp sge i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void EC_get_builtin_curves(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_get_builtin_curves() {
ret void
}
double ReturnDoubleFromFloat(float f) { return f; }


x86 assembly (clang, -O0):
<ReturnDoubleFromFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnDoubleFromFloat>:
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ReturnDoubleFromFloat(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
ret double %4
}

LLVM IR (-O2):
define double @ReturnDoubleFromFloat(float %0) {
%2 = fpext float %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: smtpsink [-v] [-p port]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"usage: smtpsink [-v] [-p port]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"usage: smtpsink [-v] [-p port]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  (void)fprintf(stderr, "USAGE: %s [-l database]\n", name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"USAGE: %s [-l database]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"USAGE: %s [-l database]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int mod(int f, int s) { return (f % s); }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int test_imm_F5uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xF5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F5uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0xf5,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F5uint64_highword_mem>:
testb  $0xf5,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F5uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1052266987520
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void strconcat(char *dest, char *src) {
  while (*dest != '\0')
    dest++;
  while (*src != 0x00) {
    *dest = *src;
    dest++;
    src++;
  }
  *dest = 0x00;
}


x86 assembly (clang, -O0):
<strconcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <strconcat+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strconcat+0xc>
jmp    1132 <strconcat+0x32>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116b <strconcat+0x6b>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1132 <strconcat+0x32>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strconcat>:
mov    %rdi,%rcx
add    $0x1,%rdi
cmpb   $0x0,(%rcx)
jne    1100 <strconcat>
mov    (%rsi),%al
test   %al,%al
je     1136 <strconcat+0x36>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
mov    %al,(%rdi,%rcx,1)
movzbl 0x2(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1120 <strconcat+0x20>
add    %rcx,%rdi
mov    %rdi,%rcx
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define void @strconcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %16, %11 ], [ %1, %8 ]
%14 = phi i8* [ %15, %11 ], [ %4, %8 ]
store i8 %12, i8* %14
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = getelementptr inbounds i8, i8* %13, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %15, %11 ]
store i8 0, i8* %20
ret void
}
int mem_setoptions(int options) {
  options = 0;
  return (options);
}


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

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

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

LLVM IR (-O2):
define i32 @mem_setoptions(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ R_TAU0_Channel3_Start();
int /*<<< orphan*/ __EI();
int /*<<< orphan*/ com_init();
int /*<<< orphan*/ mode_init();
void R_MAIN_UserInit(void) {
  com_init();
  mode_init();
  R_TAU0_Channel3_Start();
  __EI();
}


x86 assembly (clang, -O0):
<R_MAIN_UserInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <com_init@plt>
mov    $0x0,%al
call   1060 <mode_init@plt>
mov    $0x0,%al
call   1040 <R_TAU0_Channel3_Start@plt>
mov    $0x0,%al
call   1030 <__EI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_MAIN_UserInit>:
push   %rax
xor    %eax,%eax
call   1050 <com_init@plt>
xor    %eax,%eax
call   1060 <mode_init@plt>
xor    %eax,%eax
call   1040 <R_TAU0_Channel3_Start@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__EI@plt>

LLVM IR (-O0):
define void @R_MAIN_UserInit() {
%1 = call i32 (...) @com_init()
%2 = call i32 (...) @mode_init()
%3 = call i32 (...) @R_TAU0_Channel3_Start()
%4 = call i32 (...) @__EI()
ret void
}

LLVM IR (-O2):
define void @R_MAIN_UserInit() {
%1 = tail call i32 (...) @com_init()
%2 = tail call i32 (...) @mode_init()
%3 = tail call i32 (...) @R_TAU0_Channel3_Start()
%4 = tail call i32 (...) @__EI()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void swap_int64(void *a, void *b) {
  do {
    int64_t temp = *(int64_t *)a;
    *(int64_t *)a = *(int64_t *)b;
    *(int64_t *)b = temp;
  } while (0);
}


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

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

LLVM IR (-O0):
define void @swap_int64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
%15 = load i32, i32* %5
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i32*
store i32 %15, i32* %17
br label %18
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @swap_int64(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
store i32 %4, i32* %5
ret void
}
void port_disable(void) { __asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @port_disable() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
bool str_eq(const char *s1, const char *s2) { return !strcmp(s1, s2); }


x86 assembly (clang, -O0):
<str_eq>:
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 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_eq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @str_eq(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 i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @str_eq(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SCB_I2CInit();
void SCB_Init(void) { SCB_I2CInit(); }


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

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

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

LLVM IR (-O2):
define void @SCB_Init() {
%1 = tail call i32 (...) @SCB_I2CInit()
ret void
}
/* Variables and functions */
unsigned char VIM_HAPI_SetCaptureRatio(unsigned char);
unsigned char V5H_Capture_CompressionRatio(unsigned char ratio) {
  return (VIM_HAPI_SetCaptureRatio(ratio));
}


x86 assembly (clang, -O0):
<V5H_Capture_CompressionRatio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <VIM_HAPI_SetCaptureRatio@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V5H_Capture_CompressionRatio>:
jmp    1030 <VIM_HAPI_SetCaptureRatio@plt>

LLVM IR (-O0):
define zeroext i8 @V5H_Capture_CompressionRatio(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @VIM_HAPI_SetCaptureRatio(i8 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @V5H_Capture_CompressionRatio(i8 zeroext %0) {
%2 = tail call zeroext i8 @VIM_HAPI_SetCaptureRatio(i8 zeroext %0)
ret i8 %2
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
bool sancus_get_u16ll(long long v, uint16_t *out) {
  if ((v >= 0) && (v <= 0xffff)) {
    if (out != NULL)
      *out = (uint16_t)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_u16ll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1147 <sancus_get_u16ll+0x47>
cmpq   $0xffff,-0x10(%rbp)
jg     1147 <sancus_get_u16ll+0x47>
cmpq   $0x0,-0x18(%rbp)
je     113b <sancus_get_u16ll+0x3b>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    114e <sancus_get_u16ll+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_u16ll>:
xor    %eax,%eax
cmp    $0xffff,%rdi
ja     1118 <sancus_get_u16ll+0x18>
mov    $0x1,%eax
test   %rsi,%rsi
je     1118 <sancus_get_u16ll+0x18>
mov    %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @sancus_get_u16ll(i64 %0, i64* writeonly %1) {
%3 = icmp ult i64 %0, 65536
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp eq i64* %1, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i64 %0, i64* %1
br label %7
7: ; preds = %2, %4, %6
%8 = phi i32 [ 1, %6 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
void foo534(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo534(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printCommandlineHelp();
int /*<<< orphan*/ printf(char *, char const *);
void badArgument(const char *arg) {
  printf("Bad argument: %s\n\n", arg);
  printCommandlineHelp();
}


x86 assembly (clang, -O0):
<badArgument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <printCommandlineHelp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badArgument>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <printCommandlineHelp@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Bad argument: %s\0A\0A\00"
define void @badArgument(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @printCommandlineHelp()
ret void
}
/* Variables and functions */
unsigned int GET32(int);
unsigned int sda_read(void) {
  unsigned int ra;
  ra = GET32(0x20200034);
  ra &= (1 << 2);
  return (ra);
}


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

x86 assembly (clang, -O2):
<sda_read>:
push   %rax
mov    $0x20200034,%edi
call   1030 <GET32@plt>
and    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sda_read() {
%1 = alloca i32
%2 = call i32 @GET32(i32 538968116)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 4
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @sda_read() {
%1 = tail call i32 @GET32(i32 538968116)
%2 = and i32 %1, 4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void copy_block(void *p, const void *q) { memcpy(p, q, 16); }


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

x86 assembly (clang, -O2):
<copy_block>:
mov    $0x10,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy_block(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 i32 @memcpy(i8* %5, i8* %6, i32 16)
ret void
}

LLVM IR (-O2):
define void @copy_block(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 16)
ret void
}
void check(a, b) int a;
int b;
{
  if (a == b)
    exit(0);
  else
    abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <check+0x21>
xor    %edi,%edi
call   1040 <exit@plt>
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<check>:
push   %rax
cmp    %esi,%edi
jne    112c <check+0xc>
xor    %edi,%edi
call   1040 <exit@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
define void @check(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 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
unreachable
9: ; preds = %2
unreachable
}

LLVM IR (-O2):
define void @check(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @exit(i32 0)
unreachable
5: ; preds = %2
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ POSIX_FADV_DONTNEED;
int /*<<< orphan*/ perror(char *);
int posix_fadvise(int, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/);
int fd_flush(int fd) {
  int ret;
  ret = posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
  if (ret)
    perror("posix_fadvise() failed");
  return ret;
}


x86 assembly (clang, -O0):
<fd_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
mov    %edx,%esi
call   1030 <posix_fadvise@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1159 <fd_flush+0x39>
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_flush>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <posix_fadvise@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    113d <fd_flush+0x1d>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
jmp    1139 <fd_flush+0x19>

LLVM IR (-O0):
@POSIX_FADV_DONTNEED = global i32 0
@.str = [23 x i8] c"posix_fadvise() failed\00"
define i32 @fd_flush(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @POSIX_FADV_DONTNEED
%6 = call i32 @posix_fadvise(i32 %4, i32 0, i32 0, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@POSIX_FADV_DONTNEED = global i32 0
@.str = [23 x i8] c"posix_fadvise() failed\00"
define i32 @fd_flush(i32 %0) {
%2 = load i32, i32* @POSIX_FADV_DONTNEED
%3 = tail call i32 @posix_fadvise(i32 %0, i32 0, i32 0, i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 %3
}
int cal(int c, int num, char op) {
  if (op == '+')
    c += num;
  else if (op == '-')
    c -= num;
  else if (op == '*')
    c *= num;
  else if (op == '/')
    c /= num;
  return c;
}


x86 assembly (clang, -O0):
<cal>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x2b,%eax
jne    112a <cal+0x2a>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118b <cal+0x8b>
movsbl -0x9(%rbp),%eax
cmp    $0x2d,%eax
jne    1147 <cal+0x47>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <cal+0x86>
movsbl -0x9(%rbp),%eax
cmp    $0x2a,%eax
jne    1163 <cal+0x63>
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <cal+0x81>
movsbl -0x9(%rbp),%eax
cmp    $0x2f,%eax
jne    117c <cal+0x7c>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1181 <cal+0x81>
jmp    1186 <cal+0x86>
jmp    118b <cal+0x8b>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal>:
mov    %edi,%eax
add    $0xd6,%dl
cmp    $0x5,%dl
ja     112a <cal+0x2a>
movzbl %dl,%ecx
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
imul   %esi,%eax
ret
add    %esi,%eax
ret
sub    %esi,%eax
ret
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @cal(i32 %0, i32 %1, i8 signext %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
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 43
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = add nsw i32 %12, %11
store i32 %13, i32* %4
br label %41
14: ; preds = %3
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 45
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = sub nsw i32 %20, %19
store i32 %21, i32* %4
br label %40
22: ; preds = %14
%23 = load i8, i8* %6
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 42
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i32, i32* %5
%28 = load i32, i32* %4
%29 = mul nsw i32 %28, %27
store i32 %29, i32* %4
br label %39
30: ; preds = %22
%31 = load i8, i8* %6
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 47
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = load i32, i32* %5
%36 = load i32, i32* %4
%37 = sdiv i32 %36, %35
store i32 %37, i32* %4
br label %38
38: ; preds = %34, %30
br label %39
39: ; preds = %38, %26
br label %40
40: ; preds = %39, %18
br label %41
41: ; preds = %40, %10
%42 = load i32, i32* %4
ret i32 %42
}

LLVM IR (-O2):
define i32 @cal(i32 %0, i32 %1, i8 signext %2) {
switch i8 %2, label %12 [
i8 43, label %4
i8 45, label %6
i8 42, label %8
i8 47, label %10
]
4: ; preds = %3
%5 = add nsw i32 %1, %0
br label %12
6: ; preds = %3
%7 = sub nsw i32 %0, %1
br label %12
8: ; preds = %3
%9 = mul nsw i32 %1, %0
br label %12
10: ; preds = %3
%11 = sdiv i32 %0, %1
br label %12
12: ; preds = %3, %6, %10, %8, %4
%13 = phi i32 [ %5, %4 ], [ %7, %6 ], [ %9, %8 ], [ %11, %10 ], [ %0, %3 ]
ret i32 %13
}
int gauche(int _index) { return (_index < 0 ? -1 : 2 * _index + 1); }


x86 assembly (clang, -O0):
<gauche>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <gauche+0x1e>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <gauche+0x2a>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauche>:
lea    (%rdi,%rdi,1),%ecx
add    $0x1,%ecx
test   %edi,%edi
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gauche(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 %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = mul nsw i32 2, %7
%9 = add nsw i32 %8, 1
br label %10
10: ; preds = %6, %5
%11 = phi i32 [ -1, %5 ], [ %9, %6 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @gauche(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}