xunge/DecIR huggingface dataset:
char cast_ushort_char(unsigned short int x) { return (char)x; }


x86 assembly (clang, -O0):
<cast_ushort_char>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_ushort_char>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @cast_ushort_char(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = trunc i16 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @cast_ushort_char(i16 zeroext %0) {
%2 = trunc i16 %0 to i8
ret i8 %2
}
/* Type definitions */
struct dm_interface {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DM_DEV_SUSPEND;
int /*<<< orphan*/ DM_SUSPEND_FLAG;
int dev_cmd(struct dm_interface *, char const *, int /*<<< orphan*/,
            int /*<<< orphan*/);
int dm_suspend_device(struct dm_interface *dmi, const char *name) {
  return dev_cmd(dmi, name, DM_DEV_SUSPEND, DM_SUSPEND_FLAG);
}


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

x86 assembly (clang, -O2):
<dm_suspend_device>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    0x2ed8(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <dev_cmd@plt>

LLVM IR (-O0):
%struct.dm_interface = type { i32 }
@DM_DEV_SUSPEND = global i32 0
@DM_SUSPEND_FLAG = global i32 0
define i32 @dm_suspend_device(%struct.dm_interface* %0, i8* %1) {
%3 = alloca %struct.dm_interface*
%4 = alloca i8*
store %struct.dm_interface* %0, %struct.dm_interface** %3
store i8* %1, i8** %4
%5 = load %struct.dm_interface*, %struct.dm_interface** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @DM_DEV_SUSPEND
%8 = load i32, i32* @DM_SUSPEND_FLAG
%9 = call i32 @dev_cmd(%struct.dm_interface* %5, i8* %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.dm_interface = type { i32 }
@DM_DEV_SUSPEND = global i32 0
@DM_SUSPEND_FLAG = global i32 0
define i32 @dm_suspend_device(%struct.dm_interface* %0, i8* %1) {
%3 = load i32, i32* @DM_DEV_SUSPEND
%4 = load i32, i32* @DM_SUSPEND_FLAG
%5 = tail call i32 @dev_cmd(%struct.dm_interface* %0, i8* %1, i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int gfx_i2c_write(int, int, unsigned char, int, unsigned char *);
int saa7114_write_reg(unsigned char reg, unsigned char val) {
  return gfx_i2c_write(2, 0x42, reg, 1, &val);
}


x86 assembly (clang, -O0):
<saa7114_write_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x2,%edi
mov    $0x42,%esi
mov    $0x1,%ecx
lea    -0x2(%rbp),%r8
movzbl -0x1(%rbp),%edx
call   1030 <gfx_i2c_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saa7114_write_reg>:
push   %rax
mov    %edi,%edx
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%r8
mov    $0x2,%edi
mov    $0x42,%esi
mov    $0x1,%ecx
call   1030 <gfx_i2c_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @saa7114_write_reg(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @gfx_i2c_write(i32 2, i32 66, i8 zeroext %5, i32 1, i8* %4)
ret i32 %6
}

LLVM IR (-O2):
define i32 @saa7114_write_reg(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @gfx_i2c_write(i32 2, i32 66, i8 zeroext %0, i32 1, i8* %3)
ret i32 %4
}
/* Variables and functions */
int __fixdfsi(double);
int __fixsfsi(float a1) {
  double foo = a1;
  return __fixdfsi(foo);
}


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

x86 assembly (clang, -O2):
<__fixsfsi>:
cvtss2sd %xmm0,%xmm0
jmp    1030 <__fixdfsi@plt>

LLVM IR (-O0):
define i32 @__fixsfsi(float %0) {
%2 = alloca float
%3 = alloca double
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @__fixdfsi(double %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__fixsfsi(float %0) {
%2 = fpext float %0 to double
%3 = tail call i32 @__fixdfsi(double %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void print_char(char c) { write(1, &c, 1); }


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
int x() { return 1; }


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

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

LLVM IR (-O0):
define i32 @x() {
ret i32 1
}

LLVM IR (-O2):
define i32 @x() {
ret i32 1
}
int max(int a, int b, int c) {
  return a >= b && a >= c ? a : b >= a && b >= c ? b : c;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1130 <max+0x30>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1130 <max+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115f <max+0x5f>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1153 <max+0x53>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1153 <max+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <max+0x59>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
cmp    %edx,%esi
mov    %esi,%ecx
cmovl  %edx,%ecx
cmp    %edi,%esi
cmovl  %edx,%ecx
cmp    %edx,%edi
mov    %edi,%eax
cmovl  %ecx,%eax
cmp    %esi,%edi
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp sge i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sge i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %4
br label %30
16: ; preds = %10, %3
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = icmp sge i32 %17, %18
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp sge i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %5
br label %28
26: ; preds = %20, %16
%27 = load i32, i32* %6
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %14
%31 = phi i32 [ %15, %14 ], [ %29, %28 ]
ret i32 %31
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp slt i32 %0, %2
%6 = or i1 %4, %5
%7 = icmp slt i32 %1, %0
%8 = icmp slt i32 %1, %2
%9 = or i1 %7, %8
%10 = select i1 %9, i32 %2, i32 %1
%11 = select i1 %6, i32 %10, i32 %0
ret i32 %11
}
int callee_function(int my_arg) { return my_arg; }


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

x86 assembly (clang, -O2):
<callee_function>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @callee_function(i32 returned %0) {
ret i32 %0
}
void dbg_dump_lpt_node(const struct ubifs_info *c, void *node, int lnum,
                       int offs) {
  return;
}


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

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
define void @dbg_dump_lpt_node(%struct.ubifs_info* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.ubifs_info*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store %struct.ubifs_info* %0, %struct.ubifs_info** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define void @dbg_dump_lpt_node(%struct.ubifs_info* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
ret void
}
int byte_col_gbk1(int byte) {
  if (byte >= 0x40 && byte < 0x7f)
    return byte - 0x40;
  else if (byte >= 0x80 && byte < 0xff)
    return byte - 0x41;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_col_gbk1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jl     1129 <byte_col_gbk1+0x29>
cmpl   $0x7f,-0x8(%rbp)
jge    1129 <byte_col_gbk1+0x29>
mov    -0x8(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_gbk1+0x58>
cmpl   $0x80,-0x8(%rbp)
jl     1151 <byte_col_gbk1+0x51>
cmpl   $0xff,-0x8(%rbp)
jge    1151 <byte_col_gbk1+0x51>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_gbk1+0x58>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_col_gbk1>:
lea    -0x80(%rdi),%eax
lea    -0x41(%rdi),%ecx
cmp    $0x7f,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
lea    -0x40(%rdi),%ecx
cmp    $0x3f,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @byte_col_gbk1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 64
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 127
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 64
store i32 %11, i32* %2
br label %22
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 128
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 255
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
store i32 %20, i32* %2
br label %22
21: ; preds = %15, %12
store i32 -1, i32* %2
br label %22
22: ; preds = %21, %18, %9
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @byte_col_gbk1(i32 %0) {
%2 = add i32 %0, -64
%3 = icmp ult i32 %2, 63
%4 = add i32 %0, -128
%5 = icmp ult i32 %4, 127
%6 = add nsw i32 %0, -65
%7 = select i1 %5, i32 %6, i32 -1
%8 = select i1 %3, i32 %2, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assertStringsEqual(char *, int /*<<< orphan*/);
int /*<<< orphan*/ call_vsnprintf(char *, char *);
void test_vsnprintf() {
  assertStringsEqual("Hello World", call_vsnprintf("Hello %s", "World"));
}


x86 assembly (clang, -O0):
<test_vsnprintf>:
push   %rbp
mov    %rsp,%rbp
lea    0xee1(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <call_vsnprintf@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1040 <assertStringsEqual@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vsnprintf>:
push   %rax
lea    0xee4(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <call_vsnprintf@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <assertStringsEqual@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [9 x i8] c"Hello %s\00"
@.str.2 = [6 x i8] c"World\00"
define void @test_vsnprintf() {
%1 = call i32 @call_vsnprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @assertStringsEqual(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [9 x i8] c"Hello %s\00"
@.str.2 = [6 x i8] c"World\00"
define void @test_vsnprintf() {
%1 = tail call i32 @call_vsnprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @assertStringsEqual(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exchange(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
void main() {
  int a, b, c, *p1, *p2, *p3;
  scanf("%d %d %d", &a, &b, &c);
  p1 = &a;
  p2 = &b;
  p3 = &c;
  exchange(p1, p2, p3);
  printf("\n%d,%d,%d\n", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1050 <exchange@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%r14
lea    0x4(%rsp),%r15
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <exchange@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [11 x i8] c"\0A%d,%d,%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = call i32 @exchange(i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret void
}
void initialize_gpio(void) {}


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

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

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

LLVM IR (-O2):
define void @initialize_gpio() {
ret void
}
/* Variables and functions */
int lower(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int n = 'A';
  while (n <= 'Z') {
    printf("lower(%c)=%c\n", n, lower(n));
    n++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x41,-0x8(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jg     116d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <lower@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x41,%ebx
lea    0xed0(%rip),%r14
mov    %ebx,%edi
call   1040 <lower@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x5b,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"lower(%c)=%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 65, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 90
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @lower(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"lower(%c)=%c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 65, %0 ], [ %5, %1 ]
%3 = tail call i32 @lower(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 91
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
char *strcpy(char *dst, const char *src) {
  size_t idx = 0;
  while ((dst[idx] = src[idx]) != '\0') {
    ++idx;
  }
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Type definitions */
struct stat64 {
  int dummy;
};

/* Variables and functions */
int dll_stat64(char const *, struct stat64 *);
int __wrap___lxstat64(int __ver, const char *__filename,
                      struct stat64 *__stat_buf) {
  return dll_stat64(__filename, __stat_buf);
}


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

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

LLVM IR (-O0):
%struct.stat64 = type { i32 }
define i32 @__wrap___lxstat64(i32 %0, i8* %1, %struct.stat64* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat64*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat64* %2, %struct.stat64** %6
%7 = load i8*, i8** %5
%8 = load %struct.stat64*, %struct.stat64** %6
%9 = call i32 @dll_stat64(i8* %7, %struct.stat64* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.stat64 = type { i32 }
define i32 @__wrap___lxstat64(i32 %0, i8* %1, %struct.stat64* %2) {
%4 = tail call i32 @dll_stat64(i8* %1, %struct.stat64* %2)
ret i32 %4
}
int isDalvikReturn(int opcode) {
  return ((opcode >= 0x0e) && (opcode <= 0x11));
}


x86 assembly (clang, -O0):
<isDalvikReturn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xe,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isDalvikReturn+0x20>
cmpl   $0x11,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDalvikReturn>:
add    $0xfffffff2,%edi
xor    %eax,%eax
cmp    $0x4,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isDalvikReturn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 14
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 17
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isDalvikReturn(i32 %0) {
%2 = add i32 %0, -14
%3 = icmp ult i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ play_tuturu();
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *sound_thread(void *data) {
  play_tuturu();
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<sound_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <play_tuturu@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sound_thread>:
push   %rax
xor    %eax,%eax
call   1040 <play_tuturu@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @sound_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @play_tuturu()
%5 = call i32 @pthread_exit(i32* null)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @sound_thread(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @play_tuturu()
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
int test_write(char *cmd, int cmd_len) {
  char *param, *val, *next;
  int ret = 0;
  char *intf, *tmp;
  cmd[cmd_len] = '\0';
  printf("%s:%d cmd = %s, cmd_len: %d\n", __FUNCTION__, 57, cmd, cmd_len);
  return ret;
}


x86 assembly (clang, -O0):
<test_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
lea    0xebf(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x39,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_write>:
push   %rax
mov    %rdi,%rcx
movslq %esi,%r8
movb   $0x0,(%rdi,%r8,1)
lea    0xedd(%rip),%rdi
lea    0xef3(%rip),%rsi
mov    $0x39,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"%s:%d cmd = %s, cmd_len: %d\0A\00"
@__FUNCTION__.test_write = [11 x i8] c"test_write\00"
define i32 @test_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %8
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.test_write, i64 0, i64 0), i32 57, i8* %15, i32 %16)
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s:%d cmd = %s, cmd_len: %d\0A\00"
@__FUNCTION__.test_write = [11 x i8] c"test_write\00"
define i32 @test_write(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.test_write, i64 0, i64 0), i32 57, i8* %0, i32 %1)
ret i32 0
}
/* Variables and functions */
int _write_sysfs_int(char const *, char const *, int, int /*<<< orphan*/);
int write_sysfs_int(const char *filename, const char *basedir, int val) {
  return _write_sysfs_int(filename, basedir, val, 0);
}


x86 assembly (clang, -O0):
<write_sysfs_int>:
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
xor    %ecx,%ecx
call   1030 <_write_sysfs_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @write_sysfs_int(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 i32 @_write_sysfs_int(i8* %7, i8* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_sysfs_int(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_write_sysfs_int(i8* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void bail(void) {
  printf("invalid file format while parsing display entry\n");
  exit(1);
}


x86 assembly (clang, -O0):
<bail>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [49 x i8] c"invalid file format while parsing display entry\0A\00"
define void @bail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [48 x i8] c"invalid file format while parsing display entry\00"
define void @bail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void i2sStopPlay(void) {
  *((volatile unsigned int *)((0xB0009000 + 0x04))) =
      (*((volatile unsigned int *)((0xB0009000 + 0x04)))) & ~(1 << 5);
}


x86 assembly (clang, -O0):
<i2sStopPlay>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0009004,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    $0xb0009004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2sStopPlay>:
mov    $0xb0009004,%eax
andl   $0xffffffdf,(%rax)
ret

LLVM IR (-O0):
define void @i2sStopPlay() {
%1 = load volatile i32, i32* inttoptr (i64 2952826884 to i32*)
%2 = and i32 %1, -33
store volatile i32 %2, i32* inttoptr (i64 2952826884 to i32*)
ret void
}

LLVM IR (-O2):
define void @i2sStopPlay() {
%1 = load volatile i32, i32* inttoptr (i64 2952826884 to i32*)
%2 = and i32 %1, -33
store volatile i32 %2, i32* inttoptr (i64 2952826884 to i32*)
ret void
}
void _Jv_divI() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_divI() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fftss_cleanup_threads();
void FFTSS_CLEANUP_THREADS_(void) { fftss_cleanup_threads(); }


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

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

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

LLVM IR (-O2):
define void @FFTSS_CLEANUP_THREADS_() {
%1 = tail call i32 (...) @fftss_cleanup_threads()
ret void
}
float sqr(float a) {
  float b = a * a;
  return b;
}


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

x86 assembly (clang, -O2):
<sqr>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sqr(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
define float @sqr(float %0) {
%2 = fmul float %0, %0
ret float %2
}
int fun625() { return 625; }


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

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

LLVM IR (-O0):
define i32 @fun625() {
ret i32 625
}

LLVM IR (-O2):
define i32 @fun625() {
ret i32 625
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ gcd(int, int);
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  gcd(x, y);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <gcd@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @gcd(i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @gcd(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dec_lock_count();
int get_lock_count_and_add();
int /*<<< orphan*/ long_printf(char *);
int main(void) {
  int lock_count = get_lock_count_and_add();
  if (lock_count == 0)
    long_printf("The first .....");
  else
    long_printf("The second ....");
  dec_lock_count();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <get_lock_count_and_add@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1164 <main+0x34>
lea    0xea6(%rip),%rdi
call   1030 <long_printf@plt>
jmp    1170 <main+0x40>
lea    0xea5(%rip),%rdi
call   1030 <long_printf@plt>
mov    $0x0,%al
call   1040 <dec_lock_count@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <get_lock_count_and_add@plt>
test   %eax,%eax
lea    0xebf(%rip),%rax
lea    0xec8(%rip),%rdi
cmove  %rax,%rdi
call   1030 <long_printf@plt>
xor    %eax,%eax
call   1040 <dec_lock_count@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"The first .....\00"
@.str.1 = [16 x i8] c"The second ....\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @get_lock_count_and_add()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @long_printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @long_printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = call i32 (...) @dec_lock_count()
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"The first .....\00"
@.str.1 = [16 x i8] c"The second ....\00"
define i32 @main() {
%1 = tail call i32 (...) @get_lock_count_and_add()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @long_printf(i8* %3)
%5 = tail call i32 (...) @dec_lock_count()
ret i32 0
}
/* Type definitions */
typedef size_t uint32_t;
typedef size_t uint16_t;

/* Variables and functions */
uint32_t schema_rt_search16(const uint16_t *tab, uint32_t k, size_t n) {
  uint32_t i = 0;
  while (i != n - 1 && tab[i] != k)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<schema_rt_search16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x21(%rbp)
je     1148 <schema_rt_search16+0x48>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x10(%rbp),%rax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1158 <schema_rt_search16+0x58>
jmp    1169 <schema_rt_search16+0x69>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <schema_rt_search16+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<schema_rt_search16>:
xor    %eax,%eax
add    $0xffffffffffffffff,%rdx
je     1122 <schema_rt_search16+0x22>
nopl   0x0(%rax,%rax,1)
cmp    %rsi,(%rdi,%rax,8)
je     1122 <schema_rt_search16+0x22>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <schema_rt_search16+0x10>
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @schema_rt_search16(i64* nocapture %0, i64 %1, i64 %2) {
%4 = add i64 %2, -1
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %11
%7 = phi i64 [ %12, %11 ], [ 0, %3 ]
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, %1
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw i64 %7, 1
%13 = icmp eq i64 %12, %4
br i1 %13, label %14, label %6
14: ; preds = %6, %11, %3
%15 = phi i64 [ 0, %3 ], [ %4, %11 ], [ %7, %6 ]
ret i64 %15
}
int isL_sch(double xo, double xmin, double hs) {
  int i;
  double z;
  z = xo;
  for (i = 0; z >= xmin;) {
    i++;
    z = xo - hs * i;
  }
  return --i;
}


x86 assembly (clang, -O0):
<isL_sch>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
movsd  -0x28(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1175 <isL_sch+0x75>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1124 <isL_sch+0x24>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<isL_sch>:
mov    $0xffffffff,%eax
ucomisd %xmm1,%xmm0
jb     113b <isL_sch+0x3b>
xorpd  0xeed(%rip),%xmm2
mov    $0xffffffff,%eax
nopl   0x0(%rax,%rax,1)
lea    0x2(%rax),%ecx
xorps  %xmm3,%xmm3
cvtsi2sd %ecx,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
add    $0x1,%eax
ucomisd %xmm1,%xmm3
jae    1120 <isL_sch+0x20>
ret

LLVM IR (-O0):
define i32 @isL_sch(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
store double %9, double* %8
store i32 0, i32* %7
br label %10
10: ; preds = %14, %3
%11 = load double, double* %8
%12 = load double, double* %5
%13 = fcmp oge double %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i32, i32* %7
%16 = add nsw i32 %15, 1
store i32 %16, i32* %7
%17 = load double, double* %4
%18 = load double, double* %6
%19 = load i32, i32* %7
%20 = sitofp i32 %19 to double
%21 = fneg double %18
%22 = call double @llvm.fmuladd.f64(double %21, double %20, double %17)
store double %22, double* %8
br label %10
23: ; preds = %10
%24 = load i32, i32* %7
%25 = add nsw i32 %24, -1
store i32 %25, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @isL_sch(double %0, double %1, double %2) {
%4 = fcmp ult double %0, %1
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = fneg double %2
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ 0, %5 ], [ %9, %7 ]
%9 = add nuw nsw i32 %8, 1
%10 = sitofp i32 %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %6, double %10, double %0)
%12 = fcmp ult double %11, %1
br i1 %12, label %13, label %7
13: ; preds = %7, %3
%14 = phi i32 [ -1, %3 ], [ %8, %7 ]
ret i32 %14
}
/* Variables and functions */
int isocket_option(int, int, int /*<<< orphan*/);
int isocket_disable(int fd, int mode) { return isocket_option(fd, mode, 0); }


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

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

LLVM IR (-O0):
define i32 @isocket_disable(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 @isocket_option(i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @isocket_disable(i32 %0, i32 %1) {
%3 = tail call i32 @isocket_option(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ tc_sleep(unsigned int);
unsigned int tc_time();
int /*<<< orphan*/ tc_toggle_led_0();
void blink1() {
  unsigned int now = tc_time();
  while (1) {
    now += 250;
    tc_sleep(now);
    tc_toggle_led_0();
  }
}


x86 assembly (clang, -O0):
<blink1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <tc_time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfa,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tc_sleep@plt>
mov    $0x0,%al
call   1040 <tc_toggle_led_0@plt>
jmp    1142 <blink1+0x12>

x86 assembly (clang, -O2):
<blink1>:
push   %rbx
xor    %eax,%eax
call   1050 <tc_time@plt>
mov    %eax,%ebx
add    $0xfa,%ebx
mov    %ebx,%edi
call   1030 <tc_sleep@plt>
xor    %eax,%eax
call   1040 <tc_toggle_led_0@plt>
add    $0xfa,%ebx
jmp    1140 <blink1+0x10>

LLVM IR (-O0):
define void @blink1() {
%1 = alloca i32
%2 = call i32 (...) @tc_time()
store i32 %2, i32* %1
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %1
%5 = add i32 %4, 250
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @tc_sleep(i32 %6)
%8 = call i32 (...) @tc_toggle_led_0()
br label %3
}

LLVM IR (-O2):
define void @blink1() {
%1 = tail call i32 (...) @tc_time()
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ %1, %0 ], [ %4, %2 ]
%4 = add i32 %3, 250
%5 = tail call i32 @tc_sleep(i32 %4)
%6 = tail call i32 (...) @tc_toggle_led_0()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void sys_error(const char *msg, int line) {
  char syserr_msg[256];
  sprintf(syserr_msg, "%s: %s\n", msg, strerror(errno));
  error(syserr_msg, line);
}


x86 assembly (clang, -O0):
<sys_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x120(%rbp),%rdi
mov    -0x118(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7f(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <error@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_error>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeaa(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <sprintf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1030 <error@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @sys_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%12 = load i32, i32* %4
%13 = call i32 @error(i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @sys_error(i8* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6)
%8 = call i32 @error(i8* %4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int const);
void management_sleep(const int n) { sleep(n); }


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

x86 assembly (clang, -O2):
<management_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @management_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
int hashKey(char *s) {
  int key = 0;
  int position = 0;
  while (*s != '\0') {
    key += (int)*s * (position + 1);
    s++;
    position++;
  }
  return key % 2069 - 1;
}


x86 assembly (clang, -O0):
<hashKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <hashKey+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hashKey+0x16>
mov    -0xc(%rbp),%eax
mov    $0x815,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashKey>:
mov    (%rdi),%dl
test   %dl,%dl
je     1145 <hashKey+0x45>
xor    %eax,%eax
mov    $0x1,%ecx
nopl   (%rax)
movsbl %dl,%edx
imul   %ecx,%edx
add    %edx,%eax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hashKey+0x10>
cltq
imul   $0x7eb3690d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2a,%rcx
add    %edx,%ecx
imul   $0x815,%ecx,%ecx
not    %ecx
add    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @hashKey(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = phi i8* [ %13, %4 ], [ %0, %1 ]
%9 = sext i8 %5 to i32
%10 = add nuw nsw i32 %6, 1
%11 = mul nsw i32 %10, %9
%12 = add nsw i32 %11, %7
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = srem i32 %12, 2069
%18 = add nsw i32 %17, -1
br label %19
19: ; preds = %16, %1
%20 = phi i32 [ -1, %1 ], [ %18, %16 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void exit_with_system_message(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<exit_with_system_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_system_message>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @exit_with_system_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @exit_with_system_message(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}