xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void movsx_reg32_16preg32pimm32(int reg1, int reg2, unsigned int imm32) {
  put8(0x0F);
  put8(0xBF);
  put8((reg1 << 3) | reg2 | 0x80);
  put32(imm32);
}


x86 assembly (clang, -O0):
<movsx_reg32_16preg32pimm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     -0x8(%rbp),%edi
or     $0x80,%edi
call   1030 <put8@plt>
mov    -0xc(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsx_reg32_16preg32pimm32>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0x80,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @movsx_reg32_16preg32pimm32(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 = call i32 @put8(i32 15)
%8 = call i32 @put8(i32 191)
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = load i32, i32* %5
%12 = or i32 %10, %11
%13 = or i32 %12, 128
%14 = call i32 @put8(i32 %13)
%15 = load i32, i32* %6
%16 = call i32 @put32(i32 %15)
ret void
}

LLVM IR (-O2):
define void @movsx_reg32_16preg32pimm32(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 15)
%5 = tail call i32 @put8(i32 191)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 128
%9 = tail call i32 @put8(i32 %8)
%10 = tail call i32 @put32(i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ alphabetCheck(char);
scalar_t__ digiCheck(char);
char alphabetAndDigiCheck(char in) {
  return (char)(alphabetCheck(in) || digiCheck(in));
}


x86 assembly (clang, -O0):
<alphabetAndDigiCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <alphabetCheck@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <alphabetAndDigiCheck+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <digiCheck@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphabetAndDigiCheck>:
push   %rbx
mov    %edi,%ebx
call   1040 <alphabetCheck@plt>
mov    %rax,%rcx
mov    $0x1,%al
test   %rcx,%rcx
je     1134 <alphabetAndDigiCheck+0x14>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <digiCheck@plt>
test   %rax,%rax
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @alphabetAndDigiCheck(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @alphabetCheck(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @digiCheck(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @alphabetAndDigiCheck(i8 signext %0) {
%2 = tail call i64 @alphabetCheck(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @digiCheck(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i8
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 1, %1 ], [ %7, %4 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Memory_free(void *memblock) {
  if (memblock) {
    free(memblock);
  }
}


x86 assembly (clang, -O0):
<Memory_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <Memory_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memory_free>:
test   %rdi,%rdi
je     111a <Memory_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @Memory_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
struct i2c {
  int dummy;
};

/* Variables and functions */
long getByte(struct i2c *, int, int);
long getMode(struct i2c *i2c) { return getByte(i2c, 0x69, 0x00); }


x86 assembly (clang, -O0):
<getMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x69,%esi
xor    %edx,%edx
call   1030 <getByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMode>:
mov    $0x69,%esi
xor    %edx,%edx
jmp    1030 <getByte@plt>

LLVM IR (-O0):
%struct.i2c = type { i32 }
define i64 @getMode(%struct.i2c* %0) {
%2 = alloca %struct.i2c*
store %struct.i2c* %0, %struct.i2c** %2
%3 = load %struct.i2c*, %struct.i2c** %2
%4 = call i64 @getByte(%struct.i2c* %3, i32 105, i32 0)
ret i64 %4
}

LLVM IR (-O2):
%struct.i2c = type { i32 }
define i64 @getMode(%struct.i2c* %0) {
%2 = tail call i64 @getByte(%struct.i2c* %0, i32 105, i32 0)
ret i64 %2
}
void caller_2_2_1_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_1_1_2_1() {
ret void
}
int fun1129() { return 1129; }


x86 assembly (clang, -O0):
<fun1129>:
push   %rbp
mov    %rsp,%rbp
mov    $0x469,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1129() {
ret i32 1129
}

LLVM IR (-O2):
define i32 @fun1129() {
ret i32 1129
}
/* Type definitions */
typedef unsigned int uint32_t;
typedef unsigned int n;

/* Variables and functions */
int bitmap_get(uint32_t *bitmap, size_t n) {
  return bitmap[((n) >> 5)] & (1U << (31 - ((n)&31)));
}


x86 assembly (clang, -O0):
<bitmap_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x5,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rdx
and    $0x1f,%rdx
mov    $0x1f,%ecx
sub    %rdx,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_get>:
mov    %rsi,%rcx
mov    %rsi,%rdx
not    %cl
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x5,%rdx
and    (%rdi,%rdx,4),%eax
ret

LLVM IR (-O0):
define i32 @bitmap_get(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 = lshr i64 %6, 5
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = load i64, i64* %4
%11 = and i64 %10, 31
%12 = sub i64 31, %11
%13 = trunc i64 %12 to i32
%14 = shl i32 1, %13
%15 = and i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @bitmap_get(i32* nocapture %0, i64 %1) {
%3 = lshr i64 %1, 5
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = trunc i64 %1 to i32
%7 = and i32 %6, 31
%8 = xor i32 %7, 31
%9 = shl nuw i32 1, %8
%10 = and i32 %5, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ subr(int);
main() { subr(12345); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @subr(i32 12345)
ret i32 0
}
int start_rain() {}


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

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

LLVM IR (-O0):
define i32 @start_rain() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @start_rain() {
ret i32 undef
}
/* Type definitions */
struct maze {
  int dummy;
};

/* Variables and functions */
scalar_t__ maze_get_cell_tid(struct maze *, int, int);
int maze_same_tids(struct maze *mp, int r1, int c1, int r2, int c2) {
  return maze_get_cell_tid(mp, r1, c1) == maze_get_cell_tid(mp, r2, c2);
}


x86 assembly (clang, -O0):
<maze_same_tids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <maze_get_cell_tid@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <maze_get_cell_tid@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maze_same_tids>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %rdi,%rbx
call   1030 <maze_get_cell_tid@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <maze_get_cell_tid@plt>
xor    %ecx,%ecx
cmp    %rax,%rbp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.maze = type { i32 }
define i32 @maze_same_tids(%struct.maze* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.maze*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.maze* %0, %struct.maze** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.maze*, %struct.maze** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i64 @maze_get_cell_tid(%struct.maze* %11, i32 %12, i32 %13)
%15 = load %struct.maze*, %struct.maze** %6
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = call i64 @maze_get_cell_tid(%struct.maze* %15, i32 %16, i32 %17)
%19 = icmp eq i64 %14, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
%struct.maze = type { i32 }
define i32 @maze_same_tids(%struct.maze* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i64 @maze_get_cell_tid(%struct.maze* %0, i32 %1, i32 %2)
%7 = tail call i64 @maze_get_cell_tid(%struct.maze* %0, i32 %3, i32 %4)
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printBinary(int);
int main() {
  printBinary(-10);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printBinary(i32 -10)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void put_int32le(uint32_t x, unsigned char *p) {
  p[0] = x & 0xff;
  p[1] = (x >> 8) & 0xff;
  p[2] = (x >> 16) & 0xff;
  p[3] = (x >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<put_int32le>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_int32le>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @put_int32le(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 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %3
%17 = ashr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %3
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @put_int32le(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ output_w32(int);
void emit_fcmps(int x, int y) {
  assert(x == 30);
  assert(y == 31);
  assem_debug("fcmp s%d, s%d", x, y);
  output_w32(0x1e202000 | y << 16 | x << 5);
}


x86 assembly (clang, -O0):
<emit_fcmps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1e,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x1f,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe93(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
shl    $0x10,%edi
or     $0x1e202000,%edi
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fcmps>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x1e,%ebx
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x1f,%ebp
sete   %dil
call   1050 <assert@plt>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <assem_debug@plt>
shl    $0x10,%ebp
shl    $0x5,%ebx
or     %ebp,%ebx
or     $0x1e202000,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fcmp s%d, s%d\00"
define void @emit_fcmps(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 = icmp eq i32 %5, 30
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 31
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* %4
%17 = shl i32 %16, 16
%18 = or i32 505421824, %17
%19 = load i32, i32* %3
%20 = shl i32 %19, 5
%21 = or i32 %18, %20
%22 = call i32 @output_w32(i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fcmp s%d, s%d\00"
define void @emit_fcmps(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 30
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %1, 31
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%10 = shl i32 %1, 16
%11 = shl i32 %0, 5
%12 = or i32 %11, %10
%13 = or i32 %12, 505421824
%14 = tail call i32 @output_w32(i32 %13)
ret void
}
/* Variables and functions */
unsigned char array_contains(int *a, size_t size, int key) {
  size_t i;
  for (i = 0; i < size; i++) {
    if (a[i] == key) {
      return (1);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<array_contains>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1158 <array_contains+0x58>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x1c(%rbp),%eax
jne    1142 <array_contains+0x42>
movb   $0x1,-0x1(%rbp)
jmp    115c <array_contains+0x5c>
jmp    1147 <array_contains+0x47>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <array_contains+0x17>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_contains>:
test   %rsi,%rsi
je     111e <array_contains+0x1e>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rax,4)
je     1121 <array_contains+0x21>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <array_contains+0x10>
xor    %eax,%eax
ret
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @array_contains(i32* nocapture %0, i64 %1, i32 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %13, label %7
5: ; preds = %7
%6 = icmp eq i64 %12, %1
br i1 %6, label %13, label %7
7: ; preds = %3, %5
%8 = phi i64 [ %12, %5 ], [ 0, %3 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
%12 = add nuw i64 %8, 1
br i1 %11, label %13, label %5
13: ; preds = %7, %5, %3
%14 = phi i8 [ 0, %3 ], [ 0, %5 ], [ 1, %7 ]
ret i8 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *path_alloc(int *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int size;
  char *path = path_alloc(&size);
  printf("Pathname size = %d\n", size);
  free(path);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <path_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1050 <path_alloc@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%esi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Pathname size = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* @path_alloc(i32* %6)
store i8* %8, i8** %7
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %7
%12 = call i32 @free(i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Pathname size = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i8* @path_alloc(i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @free(i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f1();
void func() { f1(); }


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

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

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

LLVM IR (-O2):
define void @func() {
%1 = tail call i32 (...) @f1()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ wait4(int /*<<< orphan*/, int *, int, int /*<<< orphan*/);
pid_t waitpid(pid_t pid, int *wait_stat, int flags) {
  return wait4(pid, wait_stat, flags, 0);
}


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

x86 assembly (clang, -O2):
<waitpid>:
xor    %ecx,%ecx
jmp    1030 <wait4@plt>

LLVM IR (-O0):
define i32 @waitpid(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 = call i32 @wait4(i32 %7, i32* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @wait4(i32 %0, i32* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *);
void free_buffer(void *buf) {
  if (buf) {
    printf("C: freeing bytes...\n");
    free(buf);
  }
}


x86 assembly (clang, -O0):
<free_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <free_buffer+0x2c>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_buffer>:
test   %rdi,%rdi
je     113e <free_buffer+0x1e>
push   %rbx
mov    %rdi,%rbx
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
@str = [20 x i8] c"C: freeing bytes...\00"
define void @free_buffer(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %3, %1
ret void
}
struct EXTRACTOR_PluginList *
EXTRACTOR_plugin_remove(struct EXTRACTOR_PluginList *prev,
                        const char *library) {
  return prev;
}


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

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

LLVM IR (-O0):
%struct.EXTRACTOR_PluginList = type opaque
define %struct.EXTRACTOR_PluginList* @EXTRACTOR_plugin_remove(%struct.EXTRACTOR_PluginList* %0, i8* %1) {
%3 = alloca %struct.EXTRACTOR_PluginList*
%4 = alloca i8*
store %struct.EXTRACTOR_PluginList* %0, %struct.EXTRACTOR_PluginList** %3
store i8* %1, i8** %4
%5 = load %struct.EXTRACTOR_PluginList*, %struct.EXTRACTOR_PluginList** %3
ret %struct.EXTRACTOR_PluginList* %5
}

LLVM IR (-O2):
%struct.EXTRACTOR_PluginList = type opaque
define %struct.EXTRACTOR_PluginList* @EXTRACTOR_plugin_remove(%struct.EXTRACTOR_PluginList* readnone returned %0, i8* nocapture readnone %1) {
ret %struct.EXTRACTOR_PluginList* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x4f() {
  Assert_real((islower(79) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              400, ("islower should be 0 for O"));
}


x86 assembly (clang, -O0):
<t_islower_0x4f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4f,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x190,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x4f>:
push   %rax
mov    $0x4f,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x190,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for O\00"
define void @t_islower_0x4f() {
%1 = call i64 @islower(i32 79)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for O\00"
define void @t_islower_0x4f() {
%1 = tail call i64 @islower(i32 79)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short);
int main(void) {
  unsigned short int x, y, z;
  x = 143;
  y = 127;
  z = x ^ y;
  printf("after xor operation: %d", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x8f,-0x6(%rbp)
movw   $0x7f,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0xa(%rbp)
lea    0xec0(%rip),%rdi
movzwl -0xa(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"after xor operation: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i32 0, i32* %1
store i16 143, i16* %2
store i16 127, i16* %3
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = xor i32 %6, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %4
%11 = load i16, i16* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i16 zeroext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"after xor operation: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i16 zeroext 240)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_pawn_defended_from_west(int);
void b_pawn_defended_from_west_test(void **state) {
  assert_int_equal(0x0000001000000000ul,
                   b_pawn_defended_from_west(0x0000081000000000ul));
}


x86 assembly (clang, -O0):
<b_pawn_defended_from_west_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <b_pawn_defended_from_west@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_pawn_defended_from_west_test>:
push   %rax
xor    %edi,%edi
call   1040 <b_pawn_defended_from_west@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_pawn_defended_from_west_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_pawn_defended_from_west(i32 0)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_pawn_defended_from_west_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_pawn_defended_from_west(i32 0)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int memfd_create(const char *name, unsigned int flags) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<memfd_create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memfd_create>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @memfd_create(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @memfd_create(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
unsigned xrop3_35_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T & stk3;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_35_1_0(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 = shl nuw nsw i32 %5, 8
%7 = or i32 %4, %6
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, size_t);
void gbk2utf8(char *in, size_t inlen, char *out, size_t outlen) {
  memmove(out, in, inlen);
}


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

x86 assembly (clang, -O2):
<gbk2utf8>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rax,%rdi
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @gbk2utf8(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @memmove(i8* %2, i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int write(int, char *, int);
void write_one_byte(int fd) {
  char c = 'b';
  if (write(fd, &c, 1) != 1) {
    exit(111);
  }
}


x86 assembly (clang, -O0):
<write_one_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x62,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
je     1153 <write_one_byte+0x33>
mov    $0x6f,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_one_byte>:
push   %rax
movb   $0x62,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
jne    113c <write_one_byte+0x1c>
pop    %rax
ret
mov    $0x6f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @write_one_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 98, i8* %3
%4 = load i32, i32* %2
%5 = call i32 @write(i32 %4, i8* %3, i32 1)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 111)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @write_one_byte(i32 %0) {
%2 = alloca i8
store i8 98, i8* %2
%3 = call i32 @write(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @exit(i32 111)
unreachable
7: ; preds = %1
ret void
}
int pathconN_nm4_f0(const double **arg, double **res, int *iw, double *w,
                    int mem) {
  return 0;
}


x86 assembly (clang, -O0):
<pathconN_nm4_f0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pathconN_nm4_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @pathconN_nm4_f0(double** nocapture readnone %0, double** nocapture readnone %1, i32* nocapture readnone %2, double* nocapture readnone %3, i32 %4) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
int /*<<< orphan*/ setbuffer(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void setbuf(FILE *stream, char *buf) { setbuffer(stream, buf, BUFSIZ); }


x86 assembly (clang, -O0):
<setbuf>:
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    0x2eb1(%rip),%rax
mov    (%rax),%edx
call   1030 <setbuffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbuf>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <setbuffer@plt>

LLVM IR (-O0):
@BUFSIZ = global i32 0
define void @setbuf(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 = load i32, i32* @BUFSIZ
%8 = call i32 @setbuffer(i32* %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
define void @setbuf(i32* %0, i8* %1) {
%3 = load i32, i32* @BUFSIZ
%4 = tail call i32 @setbuffer(i32* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int tolower(char);
int main() {
  char c;
  c = 'M';
  printf("%c", tolower(c));
  c = 'd';
  printf("\n%c", tolower(c));
  c = '9';
  printf("\n%c", tolower(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x4d,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <tolower@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
movb   $0x64,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <tolower@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
movb   $0x39,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <tolower@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4d,%edi
call   1040 <tolower@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <tolower@plt>
lea    0xeb6(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x39,%edi
call   1040 <tolower@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"\0A%c\00"
define i32 @main() {
%1 = tail call i32 @tolower(i8 signext 77)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @tolower(i8 signext 100)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @tolower(i8 signext 57)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void comparecf(_Complex float a, float r, float i) {
  comparef(__real__ a, r);
  comparef(__imag__ a, i);
}


x86 assembly (clang, -O0):
<comparecf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movlpd %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <comparef@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <comparef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparecf>:
sub    $0x28,%rsp
movss  %xmm2,0xc(%rsp)
movaps %xmm0,0x10(%rsp)
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <comparef@plt>
movaps 0x10(%rsp),%xmm0
shufps $0x55,%xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
add    $0x28,%rsp
jmp    1030 <comparef@plt>

LLVM IR (-O0):
define void @comparecf(<2 x float> %0, float %1, float %2) {
%4 = alloca { float, float }
%5 = alloca float
%6 = alloca float
%7 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %7
store float %1, float* %5
store float %2, float* %6
%8 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = load float, float* %5
%12 = fpext float %11 to double
%13 = call i32 (double, double, ...) bitcast (i32 (...)* @comparef to i32 (double, double, ...)*)(double %10, double %12)
%14 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = load float, float* %6
%18 = fpext float %17 to double
%19 = call i32 (double, double, ...) bitcast (i32 (...)* @comparef to i32 (double, double, ...)*)(double %16, double %18)
ret void
}

LLVM IR (-O2):
define void @comparecf(<2 x float> %0, float %1, float %2) {
%4 = extractelement <2 x float> %0, i64 0
%5 = fpext float %4 to double
%6 = fpext float %1 to double
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @comparef to i32 (double, double, ...)*)(double %5, double %6)
%8 = extractelement <2 x float> %0, i64 1
%9 = fpext float %8 to double
%10 = fpext float %2 to double
%11 = tail call i32 (double, double, ...) bitcast (i32 (...)* @comparef to i32 (double, double, ...)*)(double %9, double %10)
ret void
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_sec;
  int /*<<< orphan*/ tv_nsec;
};

/* Variables and functions */
struct timespec sancus_time_neg(struct timespec a) {
  if (a.tv_sec == 0)
    a.tv_nsec = -a.tv_nsec;
  else
    a.tv_sec = -a.tv_sec;
  return a;
}


x86 assembly (clang, -O0):
<sancus_time_neg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    111f <sancus_time_neg+0x1f>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <sancus_time_neg+0x27>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_time_neg>:
mov    %rdi,%rcx
shr    $0x20,%rcx
mov    %ecx,%eax
neg    %eax
xor    %edx,%edx
neg    %edi
cmovb  %rcx,%rax
cmovb  %rdi,%rdx
shl    $0x20,%rax
or     %rdx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @sancus_time_neg(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i64*
store i64 %0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sub nsw i32 0, %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %11, i32* %12
br label %18
13: ; preds = %1
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%15 = load i32, i32* %14
%16 = sub nsw i32 0, %15
%17 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %16, i32* %17
br label %18
18: ; preds = %13, %8
%19 = bitcast %struct.timespec* %2 to i8*
%20 = bitcast %struct.timespec* %3 to i8*
%21 = bitcast %struct.timespec* %2 to i64*
%22 = load i64, i64* %21
ret i64 %22
}

LLVM IR (-O2):
define i64 @sancus_time_neg(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i64 %0, 32
%4 = icmp eq i32 %2, 0
%5 = sub nsw i64 0, %3
%6 = sub i64 0, %0
%7 = and i64 %6, 4294967295
%8 = select i1 %4, i64 %5, i64 %3
%9 = select i1 %4, i64 0, i64 %7
%10 = shl i64 %8, 32
%11 = or i64 %10, %9
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *checked_malloc(size_t size) {
  void *addr = malloc(size);
  if (addr == NULL) {
    errx(1, "Failed to allocate memory: %s", strerror(errno));
  }
  return (addr);
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <checked_malloc+0x45>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe90(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115f <checked_malloc+0x2f>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xead(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Failed to allocate memory: %s\00"
@errno = global i32 0
define i8* @checked_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [30 x i8] c"Failed to allocate memory: %s\00"
@errno = global i32 0
define noalias i8* @checked_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret i8* %2
}