xunge/DecIR huggingface dataset:
char *env_eol(char *env) {
  while (*env && *env != '\n')
    ++env;
  return env;
}


x86 assembly (clang, -O0):
<env_eol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <env_eol+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <env_eol+0x3d>
jmp    114e <env_eol+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <env_eol+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_eol>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <env_eol+0x22>
cmp    $0xa,%cl
je     1122 <env_eol+0x22>
add    $0x1,%rax
jmp    1110 <env_eol+0x10>
ret

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

LLVM IR (-O2):
define i8* @env_eol(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ SC68little_endian();
int SC68big_endian(void) { return !SC68little_endian(); }


x86 assembly (clang, -O0):
<SC68big_endian>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SC68little_endian@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SC68big_endian() {
%1 = call i32 (...) @SC68little_endian()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @SC68big_endian() {
%1 = tail call i32 (...) @SC68little_endian()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
__attribute__((always_)) int get_bit(const unsigned char *a, unsigned int pos) {
  unsigned int ofs;
  ofs = pos >> 3;
  pos = ~pos & 7;
  return (a[ofs] >> pos) & 1;
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%eax
not    %cl
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_bit(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = and i32 %1, 7
%5 = xor i32 %4, 7
%6 = zext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = lshr i32 %9, %5
%11 = and i32 %10, 1
ret i32 %11
}
/* Type definitions */
union i2c_smbus_data {
  int byte;
};
typedef int __s32;

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_BYTE;
int /*<<< orphan*/ I2C_SMBUS_READ;
int i2c_smbus_access(int, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/, union i2c_smbus_data *);
__s32 i2c_smbus_read_byte(int file) {
  union i2c_smbus_data data;
  int err;
  err = i2c_smbus_access(file, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &data);
  if (err < 0)
    return err;
  return 0x0FF & data.byte;
}


x86 assembly (clang, -O0):
<i2c_smbus_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1153 <i2c_smbus_read_byte+0x43>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <i2c_smbus_read_byte+0x4e>
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_read_byte>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%r8
xor    %edx,%edx
call   1030 <i2c_smbus_access@plt>
test   %eax,%eax
movzbl (%rsp),%ecx
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %union.i2c_smbus_data
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @I2C_SMBUS_READ
%8 = load i32, i32* @I2C_SMBUS_BYTE
%9 = call i32 @i2c_smbus_access(i32 %6, i32 %7, i32 0, i32 %8, %union.i2c_smbus_data* %4)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* %5
store i32 %13, i32* %2
br label %18
14: ; preds = %1
%15 = bitcast %union.i2c_smbus_data* %4 to i32*
%16 = load i32, i32* %15
%17 = and i32 255, %16
store i32 %17, i32* %2
br label %18
18: ; preds = %14, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca %union.i2c_smbus_data
%3 = bitcast %union.i2c_smbus_data* %2 to i8*
%4 = load i32, i32* @I2C_SMBUS_READ
%5 = load i32, i32* @I2C_SMBUS_BYTE
%6 = call i32 @i2c_smbus_access(i32 %0, i32 %4, i32 0, i32 %5, %union.i2c_smbus_data* %2)
%7 = icmp slt i32 %6, 0
%8 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = and i32 %9, 255
%11 = select i1 %7, i32 %6, i32 %10
ret i32 %11
}
int IsBlank(char *s) { return (*s == ' ' || *s == '\t' || *s == '\n') ? 1 : 0; }


x86 assembly (clang, -O0):
<IsBlank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1142 <IsBlank+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1142 <IsBlank+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsBlank>:
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    $0x9,%cl
je     1111 <IsBlank+0x11>
cmp    $0x20,%cl
jne    1112 <IsBlank+0x12>
ret
xor    %eax,%eax
cmp    $0xa,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @IsBlank(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %3 [
i8 32, label %6
i8 9, label %6
]
3: ; preds = %1
%4 = icmp eq i8 %2, 10
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %3
%7 = phi i32 [ 1, %1 ], [ %5, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ mvaddch(int, int, char);
void output_cell(int y, int x, int state) {
  mvaddch(y, x, (state == 1) ? 'x' : ' ');
}


x86 assembly (clang, -O0):
<output_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x20,%eax
mov    $0x78,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
movsbl %al,%edx
call   1030 <mvaddch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_cell>:
cmp    $0x1,%edx
mov    $0x78,%eax
mov    $0x20,%edx
cmove  %eax,%edx
jmp    1030 <mvaddch@plt>

LLVM IR (-O0):
define void @output_cell(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 120, i32 32
%13 = trunc i32 %12 to i8
%14 = call i32 @mvaddch(i32 %7, i32 %8, i8 signext %13)
ret void
}

LLVM IR (-O2):
define void @output_cell(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 1
%5 = select i1 %4, i8 120, i8 32
%6 = tail call i32 @mvaddch(i32 %0, i32 %1, i8 signext %5)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void enable_emif_clocks_x(void) {
  *(uint32_t *)(0x44E000D0) = (uint32_t)(0x00000002);
  *(uint32_t *)(0x44E00028) = (uint32_t)(0x00000002);
  while ((*(uint32_t *)(0x44E00028)) != 0x02)
    ;
}


x86 assembly (clang, -O0):
<enable_emif_clocks_x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e000d0,%eax
movl   $0x2,(%rax)
mov    $0x44e00028,%eax
movl   $0x2,(%rax)
mov    $0x44e00028,%eax
cmpl   $0x2,(%rax)
je     112d <enable_emif_clocks_x+0x2d>
jmp    111a <enable_emif_clocks_x+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_emif_clocks_x>:
movl   $0x2,0x44e000d0
movl   $0x2,0x44e00028
ret

LLVM IR (-O0):
define void @enable_emif_clocks_x() {
store i32 2, i32* inttoptr (i64 1155530960 to i32*)
store i32 2, i32* inttoptr (i64 1155530792 to i32*)
br label %1
1: ; preds = %4, %0
%2 = load i32, i32* inttoptr (i64 1155530792 to i32*)
%3 = icmp ne i32 %2, 2
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @enable_emif_clocks_x() {
store i32 2, i32* inttoptr (i64 1155530960 to i32*)
store i32 2, i32* inttoptr (i64 1155530792 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, float);
char *swirjson_szSerialize(char *, char *, unsigned long);
char *swirjson_fSerialize(char *szKey, float fValue,
                          unsigned long ulTimestamp) {
  char szValue[16];
  sprintf(szValue, "%.2f", fValue);
  return swirjson_szSerialize(szKey, szValue, ulTimestamp);
}


x86 assembly (clang, -O0):
<swirjson_fSerialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
lea    0xebb(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <swirjson_szSerialize@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swirjson_fSerialize>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <swirjson_szSerialize@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.2f\00"
define i8* @swirjson_fSerialize(i8* %0, float %1, i64 %2) {
%4 = alloca i8*
%5 = alloca float
%6 = alloca i64
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store float %1, float* %5
store i64 %2, i64* %6
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%9 = load float, float* %5
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %9)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%13 = load i64, i64* %6
%14 = call i8* @swirjson_szSerialize(i8* %11, i8* %12, i64 %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define i8* @swirjson_fSerialize(i8* %0, float %1, i64 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %1)
%7 = call i8* @swirjson_szSerialize(i8* %0, i8* %5, i64 %2)
ret i8* %7
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void print_error(const char *msg) {
  if (errno) {
    perror(msg);
  } else {
    fputs(msg, stderr);
  }
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     114b <print_error+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    115d <print_error+0x3d>
mov    -0x8(%rbp),%rdi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
mov    0x2eb1(%rip),%rax
cmpq   $0x0,(%rax)
jne    113b <print_error+0x1b>
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>
jmp    1040 <perror@plt>

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %12
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* %9, i32 %10)
br label %12
12: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
define void @print_error(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i8* %0, i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ joystick_set_value_and(int, unsigned char);
int /*<<< orphan*/ joystick_set_value_or(int, unsigned char);
void lightpen_check_button_mask(unsigned char mask, int pressed) {
  if (!mask) {
    return;
  }
  if (pressed) {
    joystick_set_value_or(1, mask);
  } else {
    joystick_set_value_and(1, (unsigned char)~mask);
  }
}


x86 assembly (clang, -O0):
<lightpen_check_button_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    1140 <lightpen_check_button_mask+0x20>
jmp    1171 <lightpen_check_button_mask+0x51>
cmpl   $0x0,-0x8(%rbp)
je     115d <lightpen_check_button_mask+0x3d>
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <joystick_set_value_or@plt>
jmp    1171 <lightpen_check_button_mask+0x51>
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    $0x1,%edi
movzbl %al,%esi
call   1040 <joystick_set_value_and@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lightpen_check_button_mask>:
test   %edi,%edi
je     1136 <lightpen_check_button_mask+0x16>
test   %esi,%esi
je     1137 <lightpen_check_button_mask+0x17>
movzbl %dil,%esi
mov    $0x1,%edi
jmp    1030 <joystick_set_value_or@plt>
ret
not    %dil
movzbl %dil,%esi
mov    $0x1,%edi
jmp    1040 <joystick_set_value_and@plt>

LLVM IR (-O0):
define void @lightpen_check_button_mask(i8 zeroext %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 = icmp ne i8 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
br label %20
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i8, i8* %3
%13 = call i32 @joystick_set_value_or(i32 1, i8 zeroext %12)
br label %20
14: ; preds = %8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
%19 = call i32 @joystick_set_value_and(i32 1, i8 zeroext %18)
br label %20
20: ; preds = %7, %14, %11
ret void
}

LLVM IR (-O2):
define void @lightpen_check_button_mask(i8 zeroext %0, i32 %1) {
%3 = icmp eq i8 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @joystick_set_value_or(i32 1, i8 zeroext %0)
br label %11
8: ; preds = %4
%9 = xor i8 %0, -1
%10 = tail call i32 @joystick_set_value_and(i32 1, i8 zeroext %9)
br label %11
11: ; preds = %2, %8, %6
ret void
}
/* Variables and functions */
void *memmove(void *, void const *, int);
void *memcpy(void *dest, const void *src, int n) {
  return memmove(dest, src, n);
}


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

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define i8* @memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @memmove(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void refcnt_decref_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_refcnt@%p::decref (refcnt_decref) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_refcnt@%p::decref (refcnt_decref) is invoked after destruction\0A\00"
define void @refcnt_decref_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_refcnt@%p::decref (refcnt_decref) is invoked after destruction\0A\00"
define void @refcnt_decref_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htole32(int /*<<< orphan*/);
void cpu_to_le32_hash(uint32_t buf[4]) {
  int i;
  for (i = 0; i < 4; i++)
    buf[i] = htole32(buf[i]);
}


x86 assembly (clang, -O0):
<cpu_to_le32_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1158 <cpu_to_le32_hash+0x48>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <htole32@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <cpu_to_le32_hash+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_le32_hash>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <htole32@plt>
mov    %eax,(%rbx)
mov    0x4(%rbx),%edi
call   1030 <htole32@plt>
mov    %eax,0x4(%rbx)
mov    0x8(%rbx),%edi
call   1030 <htole32@plt>
mov    %eax,0x8(%rbx)
mov    0xc(%rbx),%edi
call   1030 <htole32@plt>
mov    %eax,0xc(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cpu_to_le32_hash(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @htole32(i32 %2)
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @htole32(i32 %5)
store i32 %6, i32* %4
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 @htole32(i32 %8)
store i32 %9, i32* %7
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = load i32, i32* %10
%12 = tail call i32 @htole32(i32 %11)
store i32 %12, i32* %10
ret void
}
void help(void) {}


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

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

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

LLVM IR (-O2):
define void @help() {
ret void
}
int ola() {
  int a = 2;
  if ((0, (int)a) & 2) {
    return 1;
  }
  return 2;
}


x86 assembly (clang, -O0):
<ola>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1126 <ola+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <ola+0x2d>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ola() {
ret i32 1
}
/* Variables and functions */
scalar_t__ log10(double);
float log10f(float x) { return (float)log10((double)x); }


x86 assembly (clang, -O0):
<log10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log10@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10f>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <log10@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log10f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @log10(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @log10f(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @log10(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ PacketLinkLayerP__0__send__postTask();
void PacketLinkLayerP__0__DelayTimer__fired(void) {
  for (; 0;)
    ;
  PacketLinkLayerP__0__send__postTask();
}


x86 assembly (clang, -O0):
<PacketLinkLayerP__0__DelayTimer__fired>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <PacketLinkLayerP__0__DelayTimer__fired+0x9>
xor    %eax,%eax
test   $0x1,%al
jne    1128 <PacketLinkLayerP__0__DelayTimer__fired+0x18>
jmp    112d <PacketLinkLayerP__0__DelayTimer__fired+0x1d>
jmp    1119 <PacketLinkLayerP__0__DelayTimer__fired+0x9>
mov    $0x0,%al
call   1030 <PacketLinkLayerP__0__send__postTask@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PacketLinkLayerP__0__DelayTimer__fired() {
br label %1
1: ; preds = %2, %0
br i1 false, label %2, label %3
2: ; preds = %1
br label %1
3: ; preds = %1
%4 = call i32 (...) @PacketLinkLayerP__0__send__postTask()
ret void
}

LLVM IR (-O2):
define void @PacketLinkLayerP__0__DelayTimer__fired() {
%1 = tail call i32 (...) @PacketLinkLayerP__0__send__postTask()
ret void
}
void gtk_text_view_add_child_at_anchor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_add_child_at_anchor() {
ret void
}
int compare(const void *a, const void *b) {
  long double _a = *(long double *)a;
  long double _b = *(long double *)b;
  if (_a > _b) {
    return 1;
  } else if (_a < _b) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fstpt  -0x30(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1141 <compare+0x41>
jmp    1135 <compare+0x35>
movl   $0x1,-0x4(%rbp)
jmp    116e <compare+0x6e>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jbe    1162 <compare+0x62>
jmp    1156 <compare+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <compare+0x6e>
jmp    1167 <compare+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
fldt   (%rdi)
fldt   (%rsi)
xor    %ecx,%ecx
fucomi %st(1),%st
seta   %cl
neg    %ecx
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to x86_fp80*
%4 = load x86_fp80, x86_fp80* %3
%5 = bitcast i8* %1 to x86_fp80*
%6 = load x86_fp80, x86_fp80* %5
%7 = fcmp ogt x86_fp80 %4, %6
%8 = fcmp olt x86_fp80 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ data_packing(int, int);
void write_data(int digit, int data) { data_packing(digit, data); }


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

x86 assembly (clang, -O2):
<write_data>:
jmp    1030 <data_packing@plt>

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

LLVM IR (-O2):
define void @write_data(i32 %0, i32 %1) {
%3 = tail call i32 @data_packing(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmf_generic(int, unsigned long, int /*<<< orphan*/);
void pmf_intervalls(int pid, unsigned long int time) {
  pmf_generic(pid, time, 0);
}


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

x86 assembly (clang, -O2):
<pmf_intervalls>:
xor    %edx,%edx
jmp    1030 <pmf_generic@plt>

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

LLVM IR (-O2):
define void @pmf_intervalls(i32 %0, i64 %1) {
%3 = tail call i32 @pmf_generic(i32 %0, i64 %1, i32 0)
ret void
}
/* Variables and functions */
int errno;
int tcp_errno(void *arg) { return errno; }


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

x86 assembly (clang, -O2):
<tcp_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @tcp_errno(i8* nocapture readnone %0) {
%2 = load i32, i32* @errno
ret i32 %2
}
/* Variables and functions */
scalar_t__ strlen(char *);
char tolower(char);
char *stolower(char *s) {
  if (strlen(s) == 0)
    return s;
  char *p = s;
  while (*p = tolower(*p))
    p++;
  return s;
}


x86 assembly (clang, -O0):
<stolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    114c <stolower+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <stolower+0x67>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     117f <stolower+0x5f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1154 <stolower+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1142 <stolower+0x32>
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,(%r14)
test   %al,%al
je     1142 <stolower+0x32>
lea    0x1(%r14),%rbx
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1130 <stolower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @stolower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = tail call signext i8 @tolower(i8 signext %2)
store i8 %5, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %9, %7 ], [ %0, %4 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = tail call signext i8 @tolower(i8 signext %10)
store i8 %11, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %7
13: ; preds = %7, %4, %1
ret i8* %0
}
char hexlowtoasc11(int xxc) {
  xxc &= 0x0f;
  if (xxc < 0x0a)
    xxc += '0';
  else
    xxc += 0x37;
  return (char)xxc;
}


x86 assembly (clang, -O0):
<hexlowtoasc11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <hexlowtoasc11+0x28>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <hexlowtoasc11+0x31>
mov    -0x4(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexlowtoasc11>:
and    $0xf,%edi
lea    0x37(%rdi),%eax
lea    0x30(%rdi),%ecx
cmp    $0xa,%edi
movzbl %cl,%ecx
movzbl %al,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @hexlowtoasc11(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 48
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 55
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @hexlowtoasc11(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp ult i32 %2, 10
%4 = or i32 %2, 48
%5 = add nuw nsw i32 %2, 55
%6 = select i1 %3, i32 %4, i32 %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ clrbit(unsigned int *, unsigned int);
int tstbit(unsigned int *, unsigned int);
int tstclr(unsigned int *w, unsigned int flags) {
  int res = tstbit(w, flags);
  clrbit(w, flags);
  return res;
}


x86 assembly (clang, -O0):
<tstclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <tstbit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <clrbit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tstclr>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <tstbit@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <clrbit@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @tstclr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @tstbit(i32* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = call i32 @clrbit(i32* %9, i32 %10)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @tstclr(i32* %0, i32 %1) {
%3 = tail call i32 @tstbit(i32* %0, i32 %1)
%4 = tail call i32 @clrbit(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *energymon_strencpy(char *, char *, size_t);
char *energymon_get_source_cray_pm(char *buffer, size_t n) {
  return energymon_strencpy(buffer, "Cray Power Monitoring files", n);
}


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

x86 assembly (clang, -O2):
<energymon_get_source_cray_pm>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <energymon_strencpy@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Cray Power Monitoring files\00"
define i8* @energymon_get_source_cray_pm(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 i8* @energymon_strencpy(i8* %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [28 x i8] c"Cray Power Monitoring files\00"
define i8* @energymon_get_source_cray_pm(i8* %0, i64 %1) {
%3 = tail call i8* @energymon_strencpy(i8* %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i8* %3
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
void testenv() {
  char *p;
  if ((p = getenv("USER")) != NULL)
    printf("USER=%s\n", p);
}


x86 assembly (clang, -O0):
<testenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1152 <testenv+0x32>
mov    -0x8(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testenv>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1142 <testenv+0x22>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"USER\00"
@.str.1 = [9 x i8] c"USER=%s\0A\00"
define void @testenv() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = icmp ne i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"USER\00"
@.str.1 = [9 x i8] c"USER=%s\0A\00"
define void @testenv() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ shorten(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "usage: %s <path>\n", argv[0]);
    return 1;
  }
  shorten(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1168 <main+0x48>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117c <main+0x5c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <shorten@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1145 <main+0x25>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1030 <shorten@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"usage: %s <path>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %3
br label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @shorten(i8* %17)
store i32 0, i32* %3
br label %19
19: ; preds = %14, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"usage: %s <path>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @shorten(i8* %10)
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ 1, %4 ], [ 0, %8 ]
ret i32 %13
}
void xslk2(unsigned char *accessmassive, int startpostion, int amount) {}


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

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

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

LLVM IR (-O2):
define void @xslk2(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ glob_t;

/* Variables and functions */
void globfree(glob_t *pglob) { return; }


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

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

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

LLVM IR (-O2):
define void @globfree(i32* nocapture %0) {
ret void
}
int Q_bitcount(int v) {
  int c;
  v = v - ((v >> 1) & 0x55555555);
  v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
  c = (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
  return c;
}


x86 assembly (clang, -O0):
<Q_bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
sar    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_bitcount>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @Q_bitcount(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = sub nsw i32 %4, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = ashr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add nsw i32 %10, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = ashr i32 %16, 4
%18 = add nsw i32 %15, %17
%19 = and i32 %18, 252645135
%20 = mul nsw i32 %19, 16843009
%21 = ashr i32 %20, 24
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @Q_bitcount(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul nsw i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
int aaip_local_attr_support(int flag) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @aaip_local_attr_support(i32 %0) {
ret i32 0
}
void mwrite(unsigned int fd, char *data) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @startConversion_dummy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InitNoise();
int /*<<< orphan*/ ResetImages();
void InitTextures(void) {
  InitNoise();
  ResetImages();
}


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

x86 assembly (clang, -O2):
<InitTextures>:
push   %rax
xor    %eax,%eax
call   1030 <InitNoise@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ResetImages@plt>

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

LLVM IR (-O2):
define void @InitTextures() {
%1 = tail call i32 (...) @InitNoise()
%2 = tail call i32 (...) @ResetImages()
ret void
}
int col_byte_gbk1(int col) { return (col >= 0x3f ? 0x41 : 0x40) + col; }


x86 assembly (clang, -O0):
<col_byte_gbk1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x40,%eax
mov    $0x41,%ecx
cmp    $0x3f,%edx
cmovge %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_byte_gbk1>:
xor    %eax,%eax
cmp    $0x3f,%edi
setge  %al
add    %edi,%eax
add    $0x40,%eax
ret

LLVM IR (-O0):
define i32 @col_byte_gbk1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 63
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 65, i32 64
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @col_byte_gbk1(i32 %0) {
%2 = icmp sgt i32 %0, 62
%3 = select i1 %2, i32 65, i32 64
%4 = add nsw i32 %3, %0
ret i32 %4
}