xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
unsigned int replace_byte(int, int, int);
int main() {
  unsigned A, B;
  A = replace_byte(0x12345678, 0xAB, 2);
  B = replace_byte(0x12345678, 0xAB, 0);
  printf("A=%x, B=%x.\n", A, B);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x12345678,%edi
mov    $0xab,%esi
mov    $0x2,%edx
call   1040 <replace_byte@plt>
mov    %eax,-0x8(%rbp)
mov    $0x12345678,%edi
mov    $0xab,%esi
xor    %edx,%edx
call   1040 <replace_byte@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x12345678,%edi
mov    $0xab,%esi
mov    $0x2,%edx
call   1040 <replace_byte@plt>
mov    %eax,%ebx
mov    $0x12345678,%edi
mov    $0xab,%esi
xor    %edx,%edx
call   1040 <replace_byte@plt>
lea    0xeb1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"A=%x, B=%x.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @replace_byte(i32 305419896, i32 171, i32 2)
store i32 %4, i32* %2
%5 = call i32 @replace_byte(i32 305419896, i32 171, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"A=%x, B=%x.\0A\00"
define i32 @main() {
%1 = tail call i32 @replace_byte(i32 305419896, i32 171, i32 2)
%2 = tail call i32 @replace_byte(i32 305419896, i32 171, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
unsigned char inb_p(unsigned short int port) {
  unsigned char value;
  __asm__ __volatile__("inb %w1,%0\noutb %%al,$0x80"
                       : "=a"(value)
                       : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
out    %al,$0x80
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb_p>:
mov    %edi,%edx
in     (%dx),%al
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i8 @inb_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb_p(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int chrif_mapservertag_ack(int fail) {
  if (fail)
    printf("Map Server Tag: tag name is duplicated!\a\n");
  return 0;
}


x86 assembly (clang, -O0):
<chrif_mapservertag_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1131 <chrif_mapservertag_ack+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrif_mapservertag_ack>:
test   %edi,%edi
je     1125 <chrif_mapservertag_ack+0x15>
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Map Server Tag: tag name is duplicated!\07\0A\00"
define i32 @chrif_mapservertag_ack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"Map Server Tag: tag name is duplicated!\07\00"
define i32 @chrif_mapservertag_ack(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i32 0
}
unsigned int McASPDITChanUsrDataRead(unsigned int baseAddr,
                                     unsigned int chUsrDataBits,
                                     unsigned int channel) {
  unsigned int retVal = 0;
  if ((0x000000F0) == channel) {
    retVal = (*(
        (volatile unsigned int *)(baseAddr + (0x130 + (chUsrDataBits * 4)))));
  }
  if ((0x0000000F) == channel) {
    retVal = (*(
        (volatile unsigned int *)(baseAddr + (0x148 + (chUsrDataBits * 4)))));
  }
  return retVal;
}


x86 assembly (clang, -O0):
<McASPDITChanUsrDataRead>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0xf0,%eax
cmp    -0xc(%rbp),%eax
jne    113a <McASPDITChanUsrDataRead+0x3a>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    $0x130,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0xf,%eax
cmp    -0xc(%rbp),%eax
jne    1160 <McASPDITChanUsrDataRead+0x60>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    $0x148,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPDITChanUsrDataRead>:
cmp    $0xf0,%edx
je     1116 <McASPDITChanUsrDataRead+0x16>
xor    %eax,%eax
cmp    $0xf,%edx
jne    1122 <McASPDITChanUsrDataRead+0x22>
mov    $0x148,%eax
jmp    111b <McASPDITChanUsrDataRead+0x1b>
mov    $0x130,%eax
add    %edi,%eax
lea    (%rax,%rsi,4),%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @McASPDITChanUsrDataRead(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %6
%9 = icmp eq i32 240, %8
br i1 %9, label %10, label %19
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul i32 %12, 4
%14 = add i32 304, %13
%15 = add i32 %11, %14
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
store i32 %18, i32* %7
br label %19
19: ; preds = %10, %3
%20 = load i32, i32* %6
%21 = icmp eq i32 15, %20
br i1 %21, label %22, label %31
22: ; preds = %19
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = mul i32 %24, 4
%26 = add i32 328, %25
%27 = add i32 %23, %26
%28 = zext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
%30 = load volatile i32, i32* %29
store i32 %30, i32* %7
br label %31
31: ; preds = %22, %19
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @McASPDITChanUsrDataRead(i32 %0, i32 %1, i32 %2) {
switch i32 %2, label %13 [
i32 240, label %5
i32 15, label %4
]
4: ; preds = %3
br label %5
5: ; preds = %3, %4
%6 = phi i32 [ 328, %4 ], [ 304, %3 ]
%7 = shl i32 %1, 2
%8 = add i32 %6, %0
%9 = add i32 %8, %7
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
br label %13
13: ; preds = %5, %3
%14 = phi i32 [ 0, %3 ], [ %12, %5 ]
ret i32 %14
}
int path2(int x) { return x * 42; }


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

x86 assembly (clang, -O2):
<path2>:
imul   $0x2a,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @path2(i32 %0) {
%2 = mul nsw i32 %0, 42
ret i32 %2
}
/* Variables and functions */
short printNumber_L(long, int);
scalar_t__ println();
short printNumber_I_ln(int n, int base) {
  short a = 0;
  a = printNumber_L((long)n, base);
  a += println();
  return a;
}


x86 assembly (clang, -O0):
<printNumber_I_ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movslq -0x4(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <printNumber_L@plt>
mov    %ax,-0xa(%rbp)
mov    $0x0,%al
call   1030 <println@plt>
mov    %rax,%rcx
movswq -0xa(%rbp),%rax
add    %rcx,%rax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNumber_I_ln>:
push   %rbx
movslq %edi,%rdi
call   1040 <printNumber_L@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <println@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @printNumber_I_ln(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
store i16 0, i16* %5
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i32, i32* %4
%9 = call signext i16 @printNumber_L(i64 %7, i32 %8)
store i16 %9, i16* %5
%10 = call i64 (...) @println()
%11 = load i16, i16* %5
%12 = sext i16 %11 to i64
%13 = add nsw i64 %12, %10
%14 = trunc i64 %13 to i16
store i16 %14, i16* %5
%15 = load i16, i16* %5
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @printNumber_I_ln(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = tail call signext i16 @printNumber_L(i64 %3, i32 %1)
%5 = tail call i64 (...) @println()
%6 = trunc i64 %5 to i16
%7 = add i16 %4, %6
ret i16 %7
}
int packdata(unsigned char *buf, int blkno) {
  buf[0] = 3 >> 8;
  buf[1] = 3 & 0xff;
  buf[2] = blkno >> 8;
  buf[3] = blkno & 0xff;
  return 4;
}


x86 assembly (clang, -O0):
<packdata>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x3,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<packdata>:
mov    %esi,%eax
movw   $0x300,(%rdi)
mov    %ah,0x2(%rdi)
mov    %al,0x3(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @packdata(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 3, i8* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 2
store i8 %11, i8* %13
%14 = load i32, i32* %4
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 3
store i8 %16, i8* %18
ret i32 4
}

LLVM IR (-O2):
define i32 @packdata(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 3, i8* %3
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %5, i8* %6
%7 = trunc i32 %1 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %7, i8* %8
ret i32 4
}
/* Variables and functions */
int minitest_fail(char const *, char const *, int);
int minitest_pass(char const *);
int refute_int_equal(int expected, int actual, const char *msg,
                     const char *caller, int line) {
  if (expected == actual) {
    return minitest_fail(msg, caller, line);
  } else {
    return minitest_pass(msg);
  }
}


x86 assembly (clang, -O0):
<refute_int_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    115e <refute_int_equal+0x3e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <minitest_fail@plt>
mov    %eax,-0x4(%rbp)
jmp    116a <refute_int_equal+0x4a>
mov    -0x18(%rbp),%rdi
call   1030 <minitest_pass@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refute_int_equal>:
cmp    %esi,%edi
jne    1132 <refute_int_equal+0x12>
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
jmp    1040 <minitest_fail@plt>
mov    %rdx,%rdi
jmp    1030 <minitest_pass@plt>

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

LLVM IR (-O2):
define i32 @refute_int_equal(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %0, %1
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @minitest_fail(i8* %2, i8* %3, i32 %4)
br label %11
9: ; preds = %5
%10 = tail call i32 @minitest_pass(i8* %2)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr, "Usage: i2cset [-f] [-y] [-m MASK] I2CBUS CHIP-ADDRESS "
                  "DATA-ADDRESS [VALUE [MODE]]\n"
                  "  I2CBUS is an integer or an I2C bus name\n"
                  "  ADDRESS is an integer (0x03 - 0x77)\n"
                  "  MODE is one of:\n"
                  "    b (byte, default)\n"
                  "    w (word)\n"
                  "    Append p for SMBus PEC\n");
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
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):
<help>:
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 = [243 x i8] c"Usage: i2cset [-f] [-y] [-m MASK] I2CBUS CHIP-ADDRESS DATA-ADDRESS [VALUE [MODE]]\0A I2CBUS is an integer or an I2C bus name\0A ADDRESS is an integer (0x03 - 0x77)\0A MODE is one of:\0A b (byte, default)\0A w (word)\0A Append p for SMBus PEC\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [243 x i8] c"Usage: i2cset [-f] [-y] [-m MASK] I2CBUS CHIP-ADDRESS DATA-ADDRESS [VALUE [MODE]]\0A I2CBUS is an integer or an I2C bus name\0A ADDRESS is an integer (0x03 - 0x77)\0A MODE is one of:\0A b (byte, default)\0A w (word)\0A Append p for SMBus PEC\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
extern void __outlc(unsigned int value, unsigned short port) {
  __asm__ __volatile__("out"
                       "l"
                       " %"
                       "0,%"
                       ""
                       "1"
                       :
                       : "a"(value), "id"(port));
}


x86 assembly (clang, -O0):
<__outlc>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outlc>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @__outlc(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outlc(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,$1", "{ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
ret void
}
int pl_count_nb_dec(int dec) {
  int size = 1;
  while (dec /= 10)
    size++;
  return size;
}


x86 assembly (clang, -O0):
<pl_count_nb_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1133 <pl_count_nb_dec+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <pl_count_nb_dec+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_count_nb_dec>:
lea    0x9(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x13,%ecx
jb     1145 <pl_count_nb_dec+0x45>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <pl_count_nb_dec+0x20>
ret

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

LLVM IR (-O2):
define i32 @pl_count_nb_dec(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = sdiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i32 %7, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
int portable_mode() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @portable_mode() {
ret i32 0
}
int vector_double_compare(const void *a, const void *b) {
  const double *da = (const double *)a;
  const double *db = (const double *)b;
  const double daa = *da;
  const double dbb = *db;
  return (daa > dbb) - (daa < dbb);
}


x86 assembly (clang, -O0):
<vector_double_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_double_compare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @vector_double_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to double*
store double* %10, double** %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to double*
store double* %12, double** %6
%13 = load double*, double** %5
%14 = load double, double* %13
store double %14, double* %7
%15 = load double*, double** %6
%16 = load double, double* %15
store double %16, double* %8
%17 = load double, double* %7
%18 = load double, double* %8
%19 = fcmp ogt double %17, %18
%20 = zext i1 %19 to i32
%21 = load double, double* %7
%22 = load double, double* %8
%23 = fcmp olt double %21, %22
%24 = zext i1 %23 to i32
%25 = sub nsw i32 %20, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @vector_double_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt double %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int nums[], int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d ", nums[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *wmemmove(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                             size_t);
wchar_t *wmempmove(wchar_t *whither, const wchar_t *whence, size_t size) {
  return wmemmove(whither, whence, size) + size;
}


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

x86 assembly (clang, -O2):
<wmempmove>:
push   %rbx
mov    %rdx,%rbx
call   1030 <wmemmove@plt>
lea    (%rax,%rbx,4),%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @wmempmove(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32* @wmemmove(i32* %0, i32* %1, i64 %2)
%5 = getelementptr inbounds i32, i32* %4, i64 %2
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void not_reg64(unsigned int reg64) {
  put8(0x48);
  put8(0xF7);
  put8(0xD0 + reg64);
}


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

x86 assembly (clang, -O2):
<not_reg64>:
push   %rbx
mov    %edi,%ebx
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0xf7,%edi
call   1030 <put8@plt>
add    $0xd0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @not_reg64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 72)
%4 = call i32 @put8(i32 247)
%5 = load i32, i32* %2
%6 = add i32 208, %5
%7 = call i32 @put8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @not_reg64(i32 %0) {
%2 = tail call i32 @put8(i32 72)
%3 = tail call i32 @put8(i32 247)
%4 = add i32 %0, 208
%5 = tail call i32 @put8(i32 %4)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
void Selective_GetTime(struct timeval *t, unsigned int *sec,
                       unsigned int *usec) {
  *sec = (unsigned int)t->tv_sec;
  *usec = (unsigned int)t->tv_usec;
}


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

x86 assembly (clang, -O2):
<Selective_GetTime>:
mov    0x8(%rdi),%eax
mov    %eax,(%rsi)
mov    (%rdi),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @Selective_GetTime(%struct.timeval* %0, i32* %1, i32* %2) {
%4 = alloca %struct.timeval*
%5 = alloca i32*
%6 = alloca i32*
store %struct.timeval* %0, %struct.timeval** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = load i32*, i32** %5
store i32 %10, i32* %11
%12 = load %struct.timeval*, %struct.timeval** %4
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = load i32*, i32** %6
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @Selective_GetTime(%struct.timeval* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ *ENGINE_get_first();
int /*<<< orphan*/ *ENGINE_get_next(int /*<<< orphan*/ *);
int /*<<< orphan*/ ENGINE_register_pkey_asn1_meths(int /*<<< orphan*/ *);
void ENGINE_register_all_pkey_asn1_meths(void) {
  ENGINE *e;
  for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
    ENGINE_register_pkey_asn1_meths(e);
}


x86 assembly (clang, -O0):
<ENGINE_register_all_pkey_asn1_meths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ENGINE_get_first@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <ENGINE_register_all_pkey_asn1_meths+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <ENGINE_register_pkey_asn1_meths@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ENGINE_get_next@plt>
mov    %rax,-0x8(%rbp)
jmp    1143 <ENGINE_register_all_pkey_asn1_meths+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENGINE_register_all_pkey_asn1_meths>:
push   %rbx
xor    %eax,%eax
call   1050 <ENGINE_get_first@plt>
test   %rax,%rax
je     1158 <ENGINE_register_all_pkey_asn1_meths+0x28>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1030 <ENGINE_register_pkey_asn1_meths@plt>
mov    %rbx,%rdi
call   1040 <ENGINE_get_next@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <ENGINE_register_all_pkey_asn1_meths+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ENGINE_register_all_pkey_asn1_meths() {
%1 = alloca i32*
%2 = call i32* (...) @ENGINE_get_first()
store i32* %2, i32** %1
br label %3
3: ; preds = %9, %0
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32*, i32** %1
%8 = call i32 @ENGINE_register_pkey_asn1_meths(i32* %7)
br label %9
9: ; preds = %6
%10 = load i32*, i32** %1
%11 = call i32* @ENGINE_get_next(i32* %10)
store i32* %11, i32** %1
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ENGINE_register_all_pkey_asn1_meths() {
%1 = tail call i32* (...) @ENGINE_get_first()
%2 = icmp eq i32* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32* [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @ENGINE_register_pkey_asn1_meths(i32* %4)
%6 = tail call i32* @ENGINE_get_next(i32* %4)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int bbm_hostif_select(void *, unsigned char);
int bbm_com_hostif_select(void *handle, unsigned char hostif) {
  int res;
  res = bbm_hostif_select(handle, hostif);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_hostif_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1030 <bbm_hostif_select@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_hostif_select>:
jmp    1030 <bbm_hostif_select@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_hostif_select(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @bbm_hostif_select(i8* %0, i8 zeroext %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ stress_set_str_method(char *);
void stress_str_set_default(void) { stress_set_str_method("all"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"all\00"
define void @stress_str_set_default() {
%1 = tail call i32 @stress_set_str_method(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_B6uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xB6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B6uint64_highword_reg>:
movabs $0xb600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B6uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 182
%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_B6uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 781684047872
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int);
scalar_t__ isprint(int);
int /*<<< orphan*/ isspace(int);
int ispunct(int c) { return isprint(c) && !isspace(c) && !isalnum(c); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <isprint@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115a <ispunct+0x2a>
mov    %ebp,%edi
call   1040 <isspace@plt>
test   %eax,%eax
jne    115a <ispunct+0x2a>
mov    %ebp,%edi
call   1030 <isalnum@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @isspace(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @isalnum(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
void plugin_exit_file(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_file() {
ret void
}
void ata_acpi_on_resume(struct ata_port *ap) {}


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

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

LLVM IR (-O0):
%struct.ata_port = type opaque
define void @ata_acpi_on_resume(%struct.ata_port* %0) {
%2 = alloca %struct.ata_port*
store %struct.ata_port* %0, %struct.ata_port** %2
ret void
}

LLVM IR (-O2):
%struct.ata_port = type opaque
define void @ata_acpi_on_resume(%struct.ata_port* nocapture %0) {
ret void
}
int close(int fd) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(6), "b"((long)(fd)));
  do {
    if ((unsigned long)(__res) >= (unsigned long)(-125)) {
      __res = -1;
    }
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rbx
mov    $0x6,%eax
int    $0x80
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffff83,-0x18(%rbp)
jb     112a <close+0x2a>
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbx
movslq %edi,%rbx
mov    $0x6,%eax
int    $0x80
cmp    $0xffffffffffffff83,%rax
mov    $0xffffffff,%ecx
cmovae %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 6, i64 %5)
store i64 %6, i64* %3
br label %7
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp uge i64 %8, -125
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 -1, i64* %3
br label %11
11: ; preds = %10, %7
%12 = load i64, i64* %3
%13 = trunc i64 %12 to i32
br label %14
14: ; preds = %11
ret i32 %13
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 6, i64 %2)
%4 = icmp ugt i64 %3, -126
%5 = trunc i64 %3 to i32
%6 = select i1 %4, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ fabs(double);
double _max_keep_sign(double current, double new_value) {
  if (fabs(current) < fabs(new_value)) {
    return new_value;
  } else {
    return current;
  }
}


x86 assembly (clang, -O0):
<_max_keep_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %rax,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    1159 <_max_keep_sign+0x49>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1163 <_max_keep_sign+0x53>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_max_keep_sign>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <fabs@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
call   1030 <fabs@plt>
movsd  (%rsp),%xmm0
cmp    %rax,%rbx
jl     1142 <_max_keep_sign+0x32>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @_max_keep_sign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call i64 @fabs(double %6)
%8 = load double, double* %5
%9 = call i64 @fabs(double %8)
%10 = icmp slt i64 %7, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %15
13: ; preds = %2
%14 = load double, double* %4
store double %14, double* %3
br label %15
15: ; preds = %13, %11
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @_max_keep_sign(double %0, double %1) {
%3 = tail call i64 @fabs(double %0)
%4 = tail call i64 @fabs(double %1)
%5 = icmp slt i64 %3, %4
%6 = select i1 %5, double %1, double %0
ret double %6
}
void f() {
a:
  goto a;
b:
c:
  __attribute__((unused));
d:
  __attribute__((noreturn));
  goto d;
  return;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f+0x9>
jmp    1109 <f+0x9>

x86 assembly (clang, -O2):
<f>:
jmp    1100 <f>

LLVM IR (-O0):
define void @f() {
br label %1
1: ; preds = %1, %0
br label %1
2: ; No predecessors!
br label %3
3: ; preds = %2
br label %4
4: ; preds = %4, %3
br label %4
}

LLVM IR (-O2):
define void @f() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
double log(double);
double acoth(double x) {
  double oneOverX = 1.0 / x;
  return 0.5 * log((1.0 + oneOverX) / (1.0 - oneOverX));
}


x86 assembly (clang, -O0):
<acoth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed1(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acoth>:
push   %rax
movsd  0xee7(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0xeca(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @acoth(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = fadd double 1.000000e+00, %6
%8 = load double, double* %3
%9 = fsub double 1.000000e+00, %8
%10 = fdiv double %7, %9
%11 = call double @log(double %10)
%12 = fmul double 5.000000e-01, %11
ret double %12
}

LLVM IR (-O2):
define double @acoth(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fadd double %2, 1.000000e+00
%4 = fsub double 1.000000e+00, %2
%5 = fdiv double %3, %4
%6 = tail call double @log(double %5)
%7 = fmul double %6, 5.000000e-01
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ u32;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ pgp_ntoh32(int /*<<< orphan*/);
uint32_t get_32(uint8_t *p) {
  uint32_t u32;
  memcpy(&u32, p, sizeof(u32));
  return pgp_ntoh32(u32);
}


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

x86 assembly (clang, -O2):
<get_32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1030 <pgp_ntoh32@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @memcpy(i32* %3, i32* %4, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @pgp_ntoh32(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_32(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @pgp_ntoh32(i32 %5)
ret i32 %6
}
/* Variables and functions */
unsigned int gcd(unsigned int, unsigned int);
extern unsigned int lcm(unsigned int x, unsigned int y) {
  return x * y / gcd(x, y);
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %edx,%edx
div    %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm(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 = mul i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = udiv i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i32 @gcd(i32 %0, i32 %1)
%5 = udiv i32 %3, %4
ret i32 %5
}
int test(char const *recp, int reclen,
         char const *udata __attribute__((unused)),
         int uleng __attribute__((unused))) {
  if (reclen < 2)
    return 0;
  for (; --reclen >= 0; ++recp)
    if (*recp < ' ' || *recp > '~')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1128 <test+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1188 <test+0x88>
jmp    112d <test+0x2d>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     1181 <test+0x81>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jl     115f <test+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7e,%eax
jle    116b <test+0x6b>
movl   $0x0,-0x4(%rbp)
jmp    1188 <test+0x88>
jmp    1170 <test+0x70>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112d <test+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %eax,%eax
cmp    $0x2,%esi
jl     112c <test+0x2c>
add    $0x1,%esi
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
add    $0x81,%cl
cmp    $0xa0,%cl
jbe    112c <test+0x2c>
add    $0x1,%rdi
add    $0xffffffff,%esi
cmp    $0x2,%esi
jge    1110 <test+0x10>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %4
store i32 0, i32* %5
br label %34
13: ; preds = %4
br label %14
14: ; preds = %30, %13
%15 = load i32, i32* %7
%16 = add nsw i32 %15, -1
store i32 %16, i32* %7
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %33
18: ; preds = %14
%19 = load i8*, i8** %6
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp slt i32 %21, 32
br i1 %22, label %28, label %23
23: ; preds = %18
%24 = load i8*, i8** %6
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp sgt i32 %26, 126
br i1 %27, label %28, label %29
28: ; preds = %23, %18
store i32 0, i32* %5
br label %34
29: ; preds = %23
br label %30
30: ; preds = %29
%31 = load i8*, i8** %6
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %6
br label %14
33: ; preds = %14
store i32 1, i32* %5
br label %34
34: ; preds = %33, %28, %12
%35 = load i32, i32* %5
ret i32 %35
}

LLVM IR (-O2):
define i32 @test(i8* nocapture %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = icmp slt i32 %1, 2
br i1 %5, label %16, label %10
6: ; preds = %10
%7 = add nsw i32 %11, -1
%8 = getelementptr inbounds i8, i8* %12, i64 1
%9 = icmp sgt i32 %11, 1
br i1 %9, label %10, label %16
10: ; preds = %4, %6
%11 = phi i32 [ %7, %6 ], [ %1, %4 ]
%12 = phi i8* [ %8, %6 ], [ %0, %4 ]
%13 = load i8, i8* %12
%14 = add i8 %13, -127
%15 = icmp ult i8 %14, -95
br i1 %15, label %16, label %6
16: ; preds = %10, %6, %4
%17 = phi i32 [ 0, %4 ], [ 0, %10 ], [ 1, %6 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void segv_handler(int sig) {
  printf("Segmentation fault.  Try again\n");
  exit(0);
}


x86 assembly (clang, -O0):
<segv_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<segv_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Segmentation fault. Try again\0A\00"
define void @segv_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [31 x i8] c"Segmentation fault. Try again\00"
define void @segv_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}