xunge/DecIR huggingface dataset:
/* Variables and functions */
char EOF;
char getchar();
void clear_stdin(void) {
  char x = 0;
  while (1) {
    x = getchar();
    if (x == '\n' || x == EOF)
      break;
  }
}


x86 assembly (clang, -O0):
<clear_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1149 <clear_stdin+0x39>
movsbl -0x1(%rbp),%eax
mov    0x2eaa(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    114e <clear_stdin+0x3e>
jmp    1153 <clear_stdin+0x43>
jmp    111c <clear_stdin+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_stdin>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     112f <clear_stdin+0x1f>
cmp    (%rbx),%al
jne    1120 <clear_stdin+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @clear_stdin() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %0, %14
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 10
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = load i8, i8* @EOF
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %14
13: ; preds = %7, %2
br label %15
14: ; preds = %7
br label %2
15: ; preds = %13
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @clear_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %2, %4
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS7_SIGNER_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS7_SIGNER_INFO_it;
int i2d_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &PKCS7_SIGNER_INFO_it);
}


x86 assembly (clang, -O0):
<i2d_PKCS7_SIGNER_INFO>:
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    0x2eb9(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_PKCS7_SIGNER_INFO>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@PKCS7_SIGNER_INFO_it = global i32 0
define i32 @i2d_PKCS7_SIGNER_INFO(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @PKCS7_SIGNER_INFO_it)
ret i32 %3
}
/* Variables and functions */
int nepim_str_split(char, char *, int, char **);
int nepim_str_split_plus(char *buf, int buf_size, char **next) {
  return nepim_str_split('+', buf, buf_size, next);
}


x86 assembly (clang, -O0):
<nepim_str_split_plus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x2b,%edi
call   1030 <nepim_str_split@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nepim_str_split_plus>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x2b,%edi
jmp    1030 <nepim_str_split@plt>

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

LLVM IR (-O2):
define i32 @nepim_str_split_plus(i8* %0, i32 %1, i8** %2) {
%4 = tail call i32 @nepim_str_split(i8 signext 43, i8* %0, i32 %1, i8** %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_takes_place(int);
int main(void) { ft_takes_place(23); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1030 <ft_takes_place@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x17,%edi
call   1030 <ft_takes_place@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @ft_takes_place(i32 23)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ft_takes_place(i32 23)
ret i32 0
}
/* Variables and functions */
char *calloc(size_t, int);
char *memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *mystrdup(const char *str) {
  size_t len = strlen(str);
  char *temp = calloc(len + 1, sizeof(char));
  if (!temp) {
    return NULL;
  }
  return memcpy(temp, str, len);
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1177 <mystrdup+0x47>
movq   $0x0,-0x8(%rbp)
jmp    118c <mystrdup+0x5c>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <mystrdup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @mystrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @calloc(i64 %3, i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %0, i64 %2, i1 false)
br label %7
7: ; preds = %1, %6
ret i8* %4
}
unsigned short bitreverse8(unsigned short i) {
  return ((i & 0x00FF) << 8) | ((i & 0xFF00) >> 8);
}


x86 assembly (clang, -O0):
<bitreverse8>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitreverse8>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @bitreverse8(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @bitreverse8(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, unsigned int *);
int /*<<< orphan*/ *strstr(char const *, char *);
unsigned int iDecHexToInt(const char *sStringVal) {
  unsigned int retVal = 0;
  if (strstr(sStringVal, "0x") != NULL) {
    sscanf(sStringVal, "%x", &retVal);
  } else {
    sscanf(sStringVal, "%d", &retVal);
  }
  return retVal;
}


x86 assembly (clang, -O0):
<iDecHexToInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1166 <iDecHexToInt+0x46>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
jmp    117a <iDecHexToInt+0x5a>
mov    -0x8(%rbp),%rdi
lea    0xe95(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iDecHexToInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
lea    0xec0(%rip),%rax
lea    0xeb6(%rip),%rsi
cmove  %rax,%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1030 <sscanf@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"0x\00"
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @iDecHexToInt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32* @strstr(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"0x\00"
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @iDecHexToInt(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%7 = call i32 @sscanf(i8* %0, i8* %6, i32* %2)
%8 = load i32, i32* %2
ret i32 %8
}
int digit(int n) {
  while (n >= 10) {
    n /= 10;
  }
  return n;
}


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1124 <digit+0x24>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1107 <digit+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
cmp    $0xa,%edi
jl     1122 <digit+0x22>
mov    $0xcccccccd,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
imul   %rcx,%rax
shr    $0x23,%rax
cmp    $0x63,%edi
mov    %eax,%edi
ja     1110 <digit+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = udiv i32 %4, 10
%6 = icmp ugt i32 %4, 99
br i1 %6, label %3, label %7
7: ; preds = %3, %1
%8 = phi i32 [ %0, %1 ], [ %5, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ kruskal(int);
int main() {
  kruskal(8);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <kruskal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @kruskal(i32 8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @kruskal(i32 8)
ret i32 0
}
/* Variables and functions */
int ad9361_spi_op(int, int);
int ad9361_spi_read(int addr, int data) {
  addr &= 0x3ff;
  return ad9361_spi_op(addr, 0xff);
}


x86 assembly (clang, -O0):
<ad9361_spi_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xff,%esi
call   1030 <ad9361_spi_op@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ad9361_spi_read>:
and    $0x3ff,%edi
mov    $0xff,%esi
jmp    1030 <ad9361_spi_op@plt>

LLVM IR (-O0):
define i32 @ad9361_spi_read(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 = and i32 %5, 1023
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @ad9361_spi_op(i32 %7, i32 255)
ret i32 %8
}

LLVM IR (-O2):
define i32 @ad9361_spi_read(i32 %0, i32 %1) {
%3 = and i32 %0, 1023
%4 = tail call i32 @ad9361_spi_op(i32 %3, i32 255)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *mymalloc(int /*<<< orphan*/, size_t);
int strlen(char const *);
char *qstrdup(const char *str) {
  size_t len = strlen(str) + 1;
  char *dup = mymalloc(0, len);
  memcpy(dup, str, len);
  return dup;
}


x86 assembly (clang, -O0):
<qstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1050 <mymalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
xor    %edi,%edi
mov    %r15,%rsi
call   1050 <mymalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @qstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @mymalloc(i32 0, i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @qstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @mymalloc(i32 0, i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int MakeSpecialColormap(int index) {
  assert(index >= 0 && index < 65536);
  return index | 0x00b60000;
}


x86 assembly (clang, -O0):
<MakeSpecialColormap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1137 <MakeSpecialColormap+0x27>
cmpl   $0x10000,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
or     $0xb60000,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeSpecialColormap>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x10000,%ebx
setb   %dil
call   1030 <assert@plt>
or     $0xb60000,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @MakeSpecialColormap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 65536
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = or i32 %12, 11927552
ret i32 %13
}

LLVM IR (-O2):
define i32 @MakeSpecialColormap(i32 %0) {
%2 = icmp ult i32 %0, 65536
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = or i32 %0, 11927552
ret i32 %5
}
unsigned xrop3_5_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D | T;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

x86 assembly (clang, -O2):
<xrop3_5_1_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
not    %ecx
shl    $0x8,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_5_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = load i32, i32* %7
%23 = or i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = xor i32 %24, -1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = xor i32 %27, -1
%29 = and i32 %26, %28
%30 = load i32, i32* %7
%31 = xor i32 %30, -1
%32 = and i32 %29, %31
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = and i32 %33, %34
%36 = or i32 %32, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %7
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_5_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %5, -1
%7 = shl nsw i32 %6, 8
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i8 %1, %0
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
ret i32 %12
}
/* Variables and functions */
void *threadproc(void *ctx) {
  while (true)
    ;
  return NULL;
}


x86 assembly (clang, -O0):
<threadproc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    1108 <threadproc+0x8>

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

LLVM IR (-O0):
define i8* @threadproc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define noalias i8* @threadproc(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
int fastRead_int();
int /*<<< orphan*/ fastRead_string(char *, char);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n;
  char s[100];
  n = fastRead_int();
  printf("%d\n", n);
  fastRead_string(s, '\n');
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fastRead_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    $0xa,%esi
call   1050 <fastRead_string@plt>
lea    -0x70(%rbp),%rsi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
xor    %eax,%eax
call   1040 <fastRead_int@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <fastRead_string@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = call i32 (...) @fastRead_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i32 @fastRead_string(i8* %7, i8 signext 10)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @fastRead_int()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @fastRead_string(i8* %2, i8 signext 10)
%6 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ process_sites();
int /*<<< orphan*/ reset_sites();
int /*<<< orphan*/ upgrade_outposts();
void turn() {
  process_sites();
  reset_sites();
  upgrade_outposts();
}


x86 assembly (clang, -O0):
<turn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <process_sites@plt>
mov    $0x0,%al
call   1040 <reset_sites@plt>
mov    $0x0,%al
call   1030 <upgrade_outposts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn>:
push   %rax
xor    %eax,%eax
call   1050 <process_sites@plt>
xor    %eax,%eax
call   1040 <reset_sites@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <upgrade_outposts@plt>

LLVM IR (-O0):
define void @turn() {
%1 = call i32 (...) @process_sites()
%2 = call i32 (...) @reset_sites()
%3 = call i32 (...) @upgrade_outposts()
ret void
}

LLVM IR (-O2):
define void @turn() {
%1 = tail call i32 (...) @process_sites()
%2 = tail call i32 (...) @reset_sites()
%3 = tail call i32 (...) @upgrade_outposts()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_event_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_event_callback"
         "\n");
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _ack_cq_events(struct ibv_cq *, unsigned int);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
void ibv_ack_cq_events(struct ibv_cq *cq, unsigned int nevents) {
  dmtcp_plugin_disable_ckpt();
  _ack_cq_events(cq, nevents);
  dmtcp_plugin_enable_ckpt();
}


x86 assembly (clang, -O0):
<ibv_ack_cq_events>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <_ack_cq_events@plt>
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_ack_cq_events>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <_ack_cq_events@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <dmtcp_plugin_enable_ckpt@plt>

LLVM IR (-O0):
%struct.ibv_cq = type { i32 }
define void @ibv_ack_cq_events(%struct.ibv_cq* %0, i32 %1) {
%3 = alloca %struct.ibv_cq*
%4 = alloca i32
store %struct.ibv_cq* %0, %struct.ibv_cq** %3
store i32 %1, i32* %4
%5 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%6 = load %struct.ibv_cq*, %struct.ibv_cq** %3
%7 = load i32, i32* %4
%8 = call i32 @_ack_cq_events(%struct.ibv_cq* %6, i32 %7)
%9 = call i32 (...) @dmtcp_plugin_enable_ckpt()
ret void
}

LLVM IR (-O2):
%struct.ibv_cq = type { i32 }
define void @ibv_ack_cq_events(%struct.ibv_cq* %0, i32 %1) {
%3 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%4 = tail call i32 @_ack_cq_events(%struct.ibv_cq* %0, i32 %1)
%5 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret void
}
void _Jv_NewStringUTF() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_NewStringUTF() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CompileConstant(int);
void DoConstant(void) { CompileConstant(50); }


x86 assembly (clang, -O0):
<DoConstant>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
call   1030 <CompileConstant@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoConstant>:
mov    $0x32,%edi
jmp    1030 <CompileConstant@plt>

LLVM IR (-O0):
define void @DoConstant() {
%1 = call i32 @CompileConstant(i32 50)
ret void
}

LLVM IR (-O2):
define void @DoConstant() {
%1 = tail call i32 @CompileConstant(i32 50)
ret void
}
void gtk_statusbar_pop() {}


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

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

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

LLVM IR (-O2):
define void @gtk_statusbar_pop() {
ret void
}
void main() { printf((((2) << 16) + ((6) << 8) + (23))); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x20617,%edi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 132631 to i8*))
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 132631 to i8*))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(char *, char *);
void swap(char *a, char *b) {
  char c[81];
  strcpy(c, a);
  strcpy(a, b);
  strcpy(b, c);
  memset(c, 0, sizeof(c));
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1040 <memset@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1040 <memset@plt>
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = alloca [81 x i8]
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strcpy(i8* %0, i8* %1)
%7 = call i32 @strcpy(i8* %1, i8* %4)
%8 = call i32 @memset(i8* %4, i32 0, i32 81)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ system(char *);
int if_manul_shutdown_client() {
  FILE *fp;
  int ret = 0;
  if ((fp = fopen("/tmp/manul_shutdown_client", "r")) != NULL) {
    ret = 1;
    fclose(fp);
    system("rm -f /tmp/manul_shutdown_client");
  } else
    ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<if_manul_shutdown_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xec2(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1181 <if_manul_shutdown_client+0x51>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xe8b(%rip),%rdi
call   1040 <system@plt>
jmp    1188 <if_manul_shutdown_client+0x58>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_manul_shutdown_client>:
push   %rax
lea    0xed0(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1164 <if_manul_shutdown_client+0x34>
mov    %rax,%rdi
call   1030 <fclose@plt>
lea    0xeaa(%rip),%rdi
call   1040 <system@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"/tmp/manul_shutdown_client\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [33 x i8] c"rm -f /tmp/manul_shutdown_client\00"
define i32 @if_manul_shutdown_client() {
%1 = alloca i32*
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32* @fopen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
store i32 1, i32* %2
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
%8 = call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %10
9: ; preds = %0
store i32 0, i32* %2
br label %10
10: ; preds = %9, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"/tmp/manul_shutdown_client\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [33 x i8] c"rm -f /tmp/manul_shutdown_client\00"
define i32 @if_manul_shutdown_client() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @fclose(i32* %1)
%5 = tail call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vprintf(char *, int /*<<< orphan*/);
void torture(va_list v8) { vprintf("%*.*d", v8); }


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

x86 assembly (clang, -O2):
<torture>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <vprintf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%*.*d\00"
define void @torture(i32 %0) {
%2 = tail call i32 @vprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
signed char d_getsb(const unsigned char *ptr) { return ptr[0]; }


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

x86 assembly (clang, -O2):
<d_getsb>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @d_getsb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @d_getsb(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
void int_to_leds_m$input$init(void) {
  int_to_leds_m$leds$init();
  int_to_leds_m$leds$red_off();
  int_to_leds_m$leds$yellow_off();
  int_to_leds_m$leds$green_off();
}


x86 assembly (clang, -O0):
<int_to_leds_m$input$init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <int_to_leds_m$leds$init@plt>
mov    $0x0,%al
call   1030 <int_to_leds_m$leds$red_off@plt>
mov    $0x0,%al
call   1060 <int_to_leds_m$leds$yellow_off@plt>
mov    $0x0,%al
call   1050 <int_to_leds_m$leds$green_off@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_leds_m$input$init>:
push   %rax
xor    %eax,%eax
call   1040 <int_to_leds_m$leds$init@plt>
xor    %eax,%eax
call   1030 <int_to_leds_m$leds$red_off@plt>
xor    %eax,%eax
call   1060 <int_to_leds_m$leds$yellow_off@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <int_to_leds_m$leds$green_off@plt>

LLVM IR (-O0):
define void @"int_to_leds_m$input$init"() {
%1 = call i32 (...) @"int_to_leds_m$leds$init"()
%2 = call i32 (...) @"int_to_leds_m$leds$red_off"()
%3 = call i32 (...) @"int_to_leds_m$leds$yellow_off"()
%4 = call i32 (...) @"int_to_leds_m$leds$green_off"()
ret void
}

LLVM IR (-O2):
define void @"int_to_leds_m$input$init"() {
%1 = tail call i32 (...) @"int_to_leds_m$leds$init"()
%2 = tail call i32 (...) @"int_to_leds_m$leds$red_off"()
%3 = tail call i32 (...) @"int_to_leds_m$leds$yellow_off"()
%4 = tail call i32 (...) @"int_to_leds_m$leds$green_off"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, bill!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, bill!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, bill!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void DL_InitDownload() {}


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

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

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

LLVM IR (-O2):
define void @DL_InitDownload() {
ret void
}
int test_imm_27int16_mem(short *val) {
  return ((*val) & (0x27 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_27int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x27,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_27int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 39
%7 = icmp ne i32 %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_27int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 39
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *xstrcut(char const *, size_t);
__attribute__((__warn_unused_result__)) __attribute__((__malloc__))
__attribute__((__returns_nonnull__)) __attribute__((__nonnull__)) char *
xstrslice(const char *str, size_t pos, size_t end) {
  return xstrcut(str + pos, end - pos);
}


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

x86 assembly (clang, -O2):
<xstrslice>:
add    %rsi,%rdi
sub    %rsi,%rdx
mov    %rdx,%rsi
jmp    1030 <xstrcut@plt>

LLVM IR (-O0):
define noalias i8* @xstrslice(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = sub i64 %10, %11
%13 = call i8* @xstrcut(i8* %9, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @xstrslice(i8* %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = sub i64 %2, %1
%6 = tail call i8* @xstrcut(i8* %4, i64 %5)
ret i8* %6
}
/* Variables and functions */
int _asn1_check_infinite_end(unsigned char const **, long);
int ASN1_check_infinite_end(unsigned char **p, long len) {
  return _asn1_check_infinite_end((const unsigned char **)p, len);
}


x86 assembly (clang, -O0):
<ASN1_check_infinite_end>:
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 <_asn1_check_infinite_end@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_check_infinite_end>:
jmp    1030 <_asn1_check_infinite_end@plt>

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

LLVM IR (-O2):
define i32 @ASN1_check_infinite_end(i8** %0, i64 %1) {
%3 = tail call i32 @_asn1_check_infinite_end(i8** %0, i64 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, double);
char *mixed_str(char *a, double b) {
  static char buf[32];
  if (b)
    snprintf(buf, sizeof(buf), "%.2f", b);
  return b ? buf : "return";
}


x86 assembly (clang, -O0):
<mixed_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113e <mixed_str+0x2e>
jp     113e <mixed_str+0x2e>
jmp    115b <mixed_str+0x4b>
movsd  -0x10(%rbp),%xmm0
lea    0x2ef6(%rip),%rdi
mov    $0x20,%esi
lea    0xeaa(%rip),%rdx
call   1030 <snprintf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
lea    0xe9b(%rip),%rax
lea    0x2ecf(%rip),%rcx
ucomisd %xmm1,%xmm0
setp   %sil
setne  %dl
or     %sil,%dl
cmovne %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixed_str>:
push   %rbx
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    111d <mixed_str+0xd>
jnp    113a <mixed_str+0x2a>
lea    0x2f1c(%rip),%rbx
lea    0xed5(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
jmp    1141 <mixed_str+0x31>
lea    0xec4(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@mixed_str.buf = internal global [32 x i8] zeroinitializer
@.str = [5 x i8] c"%.2f\00"
@.str.1 = [7 x i8] c"return\00"
define i8* @mixed_str(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp une double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %4
%9 = call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mixed_str.buf, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %8)
br label %10
10: ; preds = %7, %2
%11 = load double, double* %4
%12 = fcmp une double %11, 0.000000e+00
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mixed_str.buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
ret i8* %14
}

LLVM IR (-O2):
@mixed_str.buf = internal global [32 x i8] zeroinitializer
@.str = [5 x i8] c"%.2f\00"
@.str.1 = [7 x i8] c"return\00"
define i8* @mixed_str(i8* nocapture readnone %0, double %1) {
%3 = fcmp une double %1, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mixed_str.buf, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %1)
br label %6
6: ; preds = %4, %2
%7 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @mixed_str.buf, i64 0, i64 0), %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %2 ]
ret i8* %7
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *(wcscchr)(const wchar_t *string, wchar_t c, wchar_t stop) {
  for (;;)
    if (*string == c)
      return string;
    else if (!*string || (*string++ == stop))
      return NULL;
}


x86 assembly (clang, -O0):
<wcscchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    112e <wcscchr+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <wcscchr+0x6f>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1158 <wcscchr+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jne    1165 <wcscchr+0x65>
movq   $0x0,-0x8(%rbp)
jmp    116f <wcscchr+0x6f>
jmp    116a <wcscchr+0x6a>
jmp    1110 <wcscchr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcscchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rdi),%rcx
cmp    %rsi,%rcx
je     1127 <wcscchr+0x27>
test   %rcx,%rcx
je     1126 <wcscchr+0x26>
add    $0x8,%rdi
cmp    %rdx,%rcx
jne    1110 <wcscchr+0x10>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64* @wcscchr(i64* %0, i64 %1, i64 %2) {
br label %4
4: ; preds = %8, %3
%5 = phi i64* [ %0, %3 ], [ %10, %8 ]
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, %1
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = icmp eq i64 %6, 0
%10 = getelementptr inbounds i64, i64* %5, i64 1
%11 = icmp eq i64 %6, %2
%12 = or i1 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %8, %4
%14 = phi i64* [ %5, %4 ], [ null, %8 ]
ret i64* %14
}
void regulator_put(struct regulator *regulator) {}


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

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

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

LLVM IR (-O2):
%struct.regulator = type opaque
define void @regulator_put(%struct.regulator* nocapture %0) {
ret void
}
char *xmalloc(size)
unsigned size;
{
  register char *tem = malloc(size);
  if (!tem)
    memory_out();
  return tem;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @memory_out()
br label %7
7: ; preds = %5, %1
ret i8* %3
}
void equeue_event_period(void *event, int ms) {}


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

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

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

LLVM IR (-O2):
define void @equeue_event_period(i8* nocapture %0, i32 %1) {
ret void
}