xunge/DecIR huggingface dataset:
/* Variables and functions */
char *config_get(char const *);
int config_get_bool(const char *key) {
  const char *r = config_get(key);
  if (!r)
    return -1;
  if ((r[0] == 'y') || (r[0] == 'Y'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<config_get_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <config_get@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1140 <config_get_bool+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <config_get_bool+0x63>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x79,%eax
je     1160 <config_get_bool+0x50>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x59,%eax
jne    116c <config_get_bool+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <config_get_bool+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_get_bool>:
push   %rax
call   1030 <config_get@plt>
test   %rax,%rax
je     112a <config_get_bool+0x1a>
mov    (%rax),%cl
and    $0xdf,%cl
xor    %eax,%eax
cmp    $0x59,%cl
sete   %al
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @config_get_bool(i8* %0) {
%2 = tail call i8* @config_get(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = and i8 %5, -33
%7 = icmp eq i8 %6, 89
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ -1, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Type definitions */
struct __String {
  int dummy;
};

/* Variables and functions */
struct __String *allocString();
struct __String *allocTmpString(void) {
  return allocString();
}


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

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

LLVM IR (-O0):
%struct.__String = type { i32 }
define %struct.__String* @allocTmpString() {
%1 = call %struct.__String* (...) @allocString()
ret %struct.__String* %1
}

LLVM IR (-O2):
%struct.__String = type { i32 }
define %struct.__String* @allocTmpString() {
%1 = tail call %struct.__String* (...) @allocString()
ret %struct.__String* %1
}
int bytes_to_int(unsigned char *bytes) {
  return (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | (bytes[3]);
}


x86 assembly (clang, -O0):
<bytes_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_to_int>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @bytes_to_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @bytes_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_cfg_discovery_period_usage(void) {
  printf(
      "Usage : wfd_cfg_discovery_period [<MinDiscPeriod> <MaxDiscPeriod>]\n");
  printf(
      "For 'Set' both MinDiscPeriod and MaxDiscPeriod should be specified.\n");
  printf("If no parameter is given, 'get' is performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wfd_cfg_discovery_period_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf57(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"Usage : wfd_cfg_discovery_period [<MinDiscPeriod> <MaxDiscPeriod>]\0A\00"
@.str.1 = [69 x i8] c"For 'Set' both MinDiscPeriod and MaxDiscPeriod should be specified.\0A\00"
@.str.2 = [47 x i8] c"If no parameter is given, 'get' is performed.\0A\00"
define void @print_wfd_cfg_discovery_period_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [67 x i8] c"Usage : wfd_cfg_discovery_period [<MinDiscPeriod> <MaxDiscPeriod>]\00"
@str.3 = [68 x i8] c"For 'Set' both MinDiscPeriod and MaxDiscPeriod should be specified.\00"
@str.4 = [46 x i8] c"If no parameter is given, 'get' is performed.\00"
define void @print_wfd_cfg_discovery_period_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.4, i64 0, i64 0))
ret void
}
void dump(void) {}


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

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

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

LLVM IR (-O2):
define void @dump() {
ret void
}
int f17(int x, int y) {
  if (y < -13 || y > 15)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfffffff3,-0xc(%rbp)
jl     111e <f17+0x1e>
cmpl   $0xf,-0xc(%rbp)
jle    1131 <f17+0x31>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1138 <f17+0x38>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f17>:
lea    -0x10(%rsi),%ecx
mov    $0x22,%eax
cmp    $0xffffffe2,%ecx
ja     1116 <f17+0x16>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f17(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, -13
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 15
br i1 %10, label %11, label %16
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 0, %13
%15 = srem i32 %12, %14
store i32 %15, i32* %3
br label %17
16: ; preds = %8
store i32 34, i32* %3
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @f17(i32 %0, i32 %1) {
%3 = add i32 %1, -16
%4 = icmp ult i32 %3, -29
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = sub nsw i32 0, %1
%7 = srem i32 %0, %6
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ 34, %2 ]
ret i32 %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ keycode;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
unsigned get_XKeyPressedEvent_keycode(void *_p) {
  return (unsigned)((XKeyPressedEvent *)_p)->keycode;
}


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

x86 assembly (clang, -O2):
<get_XKeyPressedEvent_keycode>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_XKeyPressedEvent_keycode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_XKeyPressedEvent_keycode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int CheckX(float X, float x, float X_tile, float x_tile) {
  if (X < x_tile)
    return 0;
  if (x > X_tile)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<CheckX>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1137 <CheckX+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1159 <CheckX+0x59>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1152 <CheckX+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1159 <CheckX+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckX>:
ucomiss %xmm0,%xmm3
setbe  %al
ucomiss %xmm2,%xmm1
setbe  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @CheckX(float %0, float %1, float %2, float %3) {
%5 = fcmp uge float %0, %3
%6 = fcmp ule float %1, %2
%7 = and i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct linkedlist {
  int dummy;
};

/* Variables and functions */
struct linkedlist *linkedlist_new(void) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.linkedlist = type { i32 }
define %struct.linkedlist* @linkedlist_new() {
ret %struct.linkedlist* null
}

LLVM IR (-O2):
%struct.linkedlist = type { i32 }
define noalias %struct.linkedlist* @linkedlist_new() {
ret %struct.linkedlist* null
}
/* Variables and functions */
short printFloat(double, int);
scalar_t__ println();
short printFloat_ln(double num, int digits) {
  short n = 0;
  n = printFloat(num, digits);
  n += println();
  return n;
}


x86 assembly (clang, -O0):
<printFloat_ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movw   $0x0,-0xe(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1040 <printFloat@plt>
mov    %ax,-0xe(%rbp)
mov    $0x0,%al
call   1030 <println@plt>
mov    %rax,%rcx
movswq -0xe(%rbp),%rax
add    %rcx,%rax
mov    %ax,-0xe(%rbp)
movswl -0xe(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFloat_ln>:
push   %rbx
call   1040 <printFloat@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <println@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i16 @printFloat_ln(double %0, i32 %1) {
%3 = tail call signext i16 @printFloat(double %0, i32 %1)
%4 = tail call i64 (...) @println()
%5 = trunc i64 %4 to i16
%6 = add i16 %3, %5
ret i16 %6
}
/* Variables and functions */
int M_PI;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sin(int);
int hello(void) {
  printf("hello sin(2*Pi)=%lg\n", sin(2 * M_PI));
  return 0;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
shl    $0x1,%edi
call   1040 <sin@plt>
mov    %eax,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
add    %edi,%edi
call   1040 <sin@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"hello sin(2*Pi)=%lg\0A\00"
@M_PI = global i32 0
define i32 @hello() {
%1 = load i32, i32* @M_PI
%2 = mul nsw i32 2, %1
%3 = call i32 @sin(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"hello sin(2*Pi)=%lg\0A\00"
@M_PI = global i32 0
define i32 @hello() {
%1 = load i32, i32* @M_PI
%2 = shl nsw i32 %1, 1
%3 = tail call i32 @sin(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void gtc_rd_init(const char *fname) {
  fatal("gtc"
        ": this format does not support reading.\n");
}


x86 assembly (clang, -O0):
<gtc_rd_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [44 x i8] c"gtc: this format does not support reading.\0A\00"
define void @gtc_rd_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"gtc: this format does not support reading.\0A\00"
define void @gtc_rd_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int tuner_i2c_read(void *, unsigned char, unsigned char, unsigned char *,
                   unsigned char);
signed int bbm_com_tuner_read(void *handle, unsigned char addr,
                              unsigned char alen, unsigned char *buffer,
                              unsigned char len) {
  signed int res;
  res = tuner_i2c_read(handle, addr, alen, buffer, len);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_tuner_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %dl,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%dl
mov    -0xa(%rbp),%al
mov    -0x18(%rbp),%rcx
movzbl %dl,%esi
movzbl %al,%edx
movzbl -0x19(%rbp),%r8d
call   1030 <tuner_i2c_read@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_tuner_read>:
jmp    1030 <tuner_i2c_read@plt>

LLVM IR (-O0):
define i32 @bbm_com_tuner_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4) {
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i8
%11 = alloca i32
store i8* %0, i8** %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i8 %4, i8* %10
%12 = load i8*, i8** %6
%13 = load i8, i8* %7
%14 = load i8, i8* %8
%15 = load i8*, i8** %9
%16 = load i8, i8* %10
%17 = call i32 @tuner_i2c_read(i8* %12, i8 zeroext %13, i8 zeroext %14, i8* %15, i8 zeroext %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
ret i32 %18
}

LLVM IR (-O2):
define i32 @bbm_com_tuner_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4) {
%6 = tail call i32 @tuner_i2c_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4)
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;
typedef char int32_t;

/* Variables and functions */
__attribute__((unused)) uint32_t string_hash(const char *str) {
  uint32_t hash = 0;
  int32_t c;
  while ((c = *str++)) {
    hash = c + (hash << 6) + (hash << 16) - hash;
  }
  return hash;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
cmp    $0x0,%al
je     114a <string_hash+0x4a>
movsbl -0xd(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <string_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <string_hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i32
%10 = mul i32 %7, 65599
%11 = add i32 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_INTEGER;

/* Variables and functions */
int /*<<< orphan*/ ASN1_INTEGER_valid(int /*<<< orphan*/ const *);
int /*<<< orphan*/ *ASN1_STRING_dup(int /*<<< orphan*/ const *);
ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x) {
  if (!ASN1_INTEGER_valid(x))
    return NULL;
  return ASN1_STRING_dup(x);
}


x86 assembly (clang, -O0):
<ASN1_INTEGER_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ASN1_INTEGER_valid@plt>
cmp    $0x0,%eax
jne    114b <ASN1_INTEGER_dup+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1158 <ASN1_INTEGER_dup+0x38>
mov    -0x10(%rbp),%rdi
call   1040 <ASN1_STRING_dup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_INTEGER_dup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ASN1_INTEGER_valid@plt>
test   %eax,%eax
je     1136 <ASN1_INTEGER_dup+0x16>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <ASN1_STRING_dup@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @ASN1_INTEGER_dup(i32* %0) {
%2 = tail call i32 @ASN1_INTEGER_valid(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32* @ASN1_STRING_dup(i32* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32* [ %5, %4 ], [ null, %1 ]
ret i32* %7
}
/* Type definitions */
struct ip6_rthdr {
  int ip6r_type;
  int ip6r_len;
};
struct in6_addr {
  int dummy;
};

/* Variables and functions */
#define IPV6_RTHDR_TYPE_0 128
int inet6_rth_segments(const void *bp) {
  struct ip6_rthdr *rthdr = (struct ip6_rthdr *)bp;
  switch (rthdr->ip6r_type) {
  case IPV6_RTHDR_TYPE_0:
    return rthdr->ip6r_len * 8 / sizeof(struct in6_addr);
  }
  return -1;
}


x86 assembly (clang, -O0):
<inet6_rth_segments>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
sub    $0x80,%eax
jne    113e <inet6_rth_segments+0x3e>
jmp    1126 <inet6_rth_segments+0x26>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x3,%eax
cltq
shr    $0x2,%rax
mov    %eax,-0x4(%rbp)
jmp    1145 <inet6_rth_segments+0x45>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_rth_segments>:
mov    $0xffffffff,%eax
cmpl   $0x80,(%rdi)
jne    1112 <inet6_rth_segments+0x12>
mov    0x4(%rdi),%eax
add    %eax,%eax
ret

LLVM IR (-O0):
%struct.ip6_rthdr = type { i32, i32 }
define i32 @inet6_rth_segments(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.ip6_rthdr*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.ip6_rthdr*
store %struct.ip6_rthdr* %6, %struct.ip6_rthdr** %4
%7 = load %struct.ip6_rthdr*, %struct.ip6_rthdr** %4
%8 = getelementptr inbounds %struct.ip6_rthdr, %struct.ip6_rthdr* %7, i32 0, i32 0
%9 = load i32, i32* %8
switch i32 %9, label %18 [
i32 128, label %10
]
10: ; preds = %1
%11 = load %struct.ip6_rthdr*, %struct.ip6_rthdr** %4
%12 = getelementptr inbounds %struct.ip6_rthdr, %struct.ip6_rthdr* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = mul nsw i32 %13, 8
%15 = sext i32 %14 to i64
%16 = udiv i64 %15, 4
%17 = trunc i64 %16 to i32
store i32 %17, i32* %2
br label %19
18: ; preds = %1
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @inet6_rth_segments(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 128
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = shl nsw i32 %8, 1
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
/* Type definitions */
struct line {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int line_write_range_to(struct line *, int /*<<< orphan*/, int,
                        int /*<<< orphan*/ *);
int line_write_to(struct line *l, FILE *s) {
  return line_write_range_to(l, 0, -1, s);
}


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

x86 assembly (clang, -O2):
<line_write_to>:
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0xffffffff,%edx
jmp    1030 <line_write_range_to@plt>

LLVM IR (-O0):
%struct.line = type { i32 }
define i32 @line_write_to(%struct.line* %0, i32* %1) {
%3 = alloca %struct.line*
%4 = alloca i32*
store %struct.line* %0, %struct.line** %3
store i32* %1, i32** %4
%5 = load %struct.line*, %struct.line** %3
%6 = load i32*, i32** %4
%7 = call i32 @line_write_range_to(%struct.line* %5, i32 0, i32 -1, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.line = type { i32 }
define i32 @line_write_to(%struct.line* %0, i32* %1) {
%3 = tail call i32 @line_write_range_to(%struct.line* %0, i32 0, i32 -1, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_buffer(int *);
int *create_shared_mem_buffer();
int /*<<< orphan*/ insert_item(int, int *);
int /*<<< orphan*/ print_buffer(int *);
int produce_item();
int /*<<< orphan*/ sleep(int);
int main() {
  int *shared_buffer = create_shared_mem_buffer();
  clear_buffer(shared_buffer);
  int item;
  while (1) {
    item = produce_item();
    sleep(1);
    insert_item(item, shared_buffer);
    print_buffer(shared_buffer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <create_shared_mem_buffer@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <clear_buffer@plt>
mov    $0x0,%al
call   1050 <produce_item@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <insert_item@plt>
mov    -0x10(%rbp),%rdi
call   1070 <print_buffer@plt>
jmp    1183 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <create_shared_mem_buffer@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <clear_buffer@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <produce_item@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <insert_item@plt>
mov    %rbx,%rdi
call   1070 <print_buffer@plt>
jmp    1180 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32* (...) @create_shared_mem_buffer()
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @clear_buffer(i32* %5)
br label %7
7: ; preds = %0, %7
%8 = call i32 (...) @produce_item()
store i32 %8, i32* %3
%9 = call i32 @sleep(i32 1)
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
%12 = call i32 @insert_item(i32 %10, i32* %11)
%13 = load i32*, i32** %2
%14 = call i32 @print_buffer(i32* %13)
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @create_shared_mem_buffer()
%2 = tail call i32 @clear_buffer(i32* %1)
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @produce_item()
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @insert_item(i32 %4, i32* %1)
%7 = tail call i32 @print_buffer(i32* %1)
br label %3
}
double decimal_part(double num) { return (double)(num - (int)num); }


x86 assembly (clang, -O0):
<decimal_part>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal_part>:
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @decimal_part(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fsub double %3, %6
ret double %7
}

LLVM IR (-O2):
define double @decimal_part(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ track_stats(void *);
double quadratic(double x, void *params) {
  track_stats(params);
  return x * x;
}


x86 assembly (clang, -O0):
<quadratic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <track_stats@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <track_stats@plt>
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @quadratic(double %0, i8* %1) {
%3 = tail call i32 @track_stats(i8* %1)
%4 = fmul double %0, %0
ret double %4
}
/* Variables and functions */
int bit_get(unsigned int, int);
int bits_rol(unsigned int x) {
  int leftmost = bit_get(x, sizeof(int) * 8 - 1);
  int res = x << 1;
  if (leftmost == 1) {
    res = res | 1;
  }
  return res;
}


x86 assembly (clang, -O0):
<bits_rol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1f,%esi
call   1030 <bit_get@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1147 <bits_rol+0x37>
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_rol>:
push   %rbx
mov    %edi,%ebx
mov    $0x1f,%esi
call   1030 <bit_get@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
lea    (%rcx,%rbx,2),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bits_rol(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @bit_get(i32 %5, i32 31)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = shl i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = or i32 %12, 1
store i32 %13, i32* %4
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
define i32 @bits_rol(i32 %0) {
%2 = tail call i32 @bit_get(i32 %0, i32 31)
%3 = shl i32 %0, 1
%4 = icmp eq i32 %2, 1
%5 = zext i1 %4 to i32
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
bool istreq(const char *s1, const char *s2) { return strcasecmp(s1, s2) == 0; }


x86 assembly (clang, -O0):
<istreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @istreq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcasecmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @istreq(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
extern void writeb(unsigned short b, unsigned long addr) {
  *(volatile unsigned int *)((addr << 7) +
                             ((0xfffffc0000000000UL) + 0x200000000UL) + 0x00) =
      b * 0x01010101;
}


x86 assembly (clang, -O0):
<writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
imul   $0x1010101,%eax,%ecx
mov    -0x10(%rbp),%rax
shl    $0x7,%rax
movabs $0xfffffc0200000000,%rdx
fc ff ff
add    %rdx,%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb>:
imul   $0x1010101,%edi,%eax
shl    $0x7,%rsi
movabs $0xfffffc0200000000,%rcx
fc ff ff
mov    %eax,(%rsi,%rcx,1)
ret

LLVM IR (-O0):
define void @writeb(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = mul nsw i32 %6, 16843009
%8 = load i64, i64* %4
%9 = shl i64 %8, 7
%10 = add i64 %9, -4389456576512
%11 = add i64 %10, 0
%12 = inttoptr i64 %11 to i32*
store volatile i32 %7, i32* %12
ret void
}

LLVM IR (-O2):
define void @writeb(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = mul nsw i32 %3, 16843009
%5 = shl i64 %1, 7
%6 = add i64 %5, -4389456576512
%7 = inttoptr i64 %6 to i32*
store volatile i32 %4, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mailimf_id_left_free(char *id_left) { free(id_left); }


x86 assembly (clang, -O0):
<mailimf_id_left_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mailimf_id_left_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mailimf_id_left_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ oblicz_brutto(float **, int);
int /*<<< orphan*/ wczyt_netto(float **, int);
int /*<<< orphan*/ wczyt_vat(float **, int);
int /*<<< orphan*/ wypisz_ceny(float **, int);
int main(void) {
  float matrix[3][5];
  wczyt_netto(matrix, 5);
  wczyt_vat(matrix, 5);
  oblicz_brutto(matrix, 5);
  wypisz_ceny(matrix, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1050 <wczyt_netto@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1040 <wczyt_vat@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1030 <oblicz_brutto@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1060 <wypisz_ceny@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <wczyt_netto@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <wczyt_vat@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <oblicz_brutto@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1060 <wypisz_ceny@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [5 x float]]
store i32 0, i32* %1
%3 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %2, i64 0, i64 0
%4 = bitcast [5 x float]* %3 to float**
%5 = call i32 @wczyt_netto(float** %4, i32 5)
%6 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %2, i64 0, i64 0
%7 = bitcast [5 x float]* %6 to float**
%8 = call i32 @wczyt_vat(float** %7, i32 5)
%9 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %2, i64 0, i64 0
%10 = bitcast [5 x float]* %9 to float**
%11 = call i32 @oblicz_brutto(float** %10, i32 5)
%12 = getelementptr inbounds [3 x [5 x float]], [3 x [5 x float]]* %2, i64 0, i64 0
%13 = bitcast [5 x float]* %12 to float**
%14 = call i32 @wypisz_ceny(float** %13, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x [5 x float]]
%2 = bitcast [3 x [5 x float]]* %1 to i8*
%3 = bitcast [3 x [5 x float]]* %1 to float**
%4 = call i32 @wczyt_netto(float** %3, i32 5)
%5 = call i32 @wczyt_vat(float** %3, i32 5)
%6 = call i32 @oblicz_brutto(float** %3, i32 5)
%7 = call i32 @wypisz_ceny(float** %3, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ register_resmelf_function_list();
void resmelf_init() { register_resmelf_function_list(); }


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

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

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

LLVM IR (-O2):
define void @resmelf_init() {
%1 = tail call i32 (...) @register_resmelf_function_list()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int go();
scalar_t__ vfork();
scalar_t__ waiting(int volatile *);
int main(int argc, char **argv) {
  volatile int a = 0;
  while (waiting(&a) == 0)
    continue;
  if (vfork() == 0) {
    int ret = go();
    (void)_exit(ret);
  }
  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)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <waiting@plt>
cmp    $0x0,%rax
jne    1175 <main+0x35>
jmp    115d <main+0x1d>
mov    $0x0,%al
call   1060 <vfork@plt>
cmp    $0x0,%rax
jne    1198 <main+0x58>
mov    $0x0,%al
call   1040 <go@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <_exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <waiting@plt>
test   %rax,%rax
je     1160 <main+0x20>
xor    %eax,%eax
call   1060 <vfork@plt>
test   %rax,%rax
je     1181 <main+0x41>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1040 <go@plt>
mov    %eax,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 0, i32* %6
br label %8
8: ; preds = %11, %2
%9 = call i64 @waiting(i32* %6)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %8
12: ; preds = %8
%13 = call i64 (...) @vfork()
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = call i32 (...) @go()
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = call i32 @_exit(i32 %17)
unreachable
19: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
br label %5
5: ; preds = %5, %2
%6 = call i64 @waiting(i32* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5
%9 = call i64 (...) @vfork()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i32 (...) @go()
%13 = call i32 @_exit(i32 %12)
unreachable
14: ; preds = %8
ret i32 0
}
int hash(int seed) {
  seed = (seed ^ 61) ^ (seed >> 16);
  seed *= 9;
  seed = seed ^ (seed >> 4);
  seed *= 0x27d4eb2d;
  seed = seed ^ (seed >> 15);
  return seed;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x3d,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x9,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x27d4eb2d,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xf,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
xor    $0x3d,%eax
lea    (%rax,%rax,8),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
xor    %eax,%ecx
imul   $0x27d4eb2d,%ecx,%ecx
mov    %ecx,%eax
sar    $0xf,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 61
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = xor i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, 9
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = xor i32 %10, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = mul nsw i32 %14, 668265261
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 15
%19 = xor i32 %16, %18
store i32 %19, i32* %2
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = xor i32 %3, 61
%5 = mul nsw i32 %4, 9
%6 = ashr i32 %5, 4
%7 = xor i32 %6, %5
%8 = mul nsw i32 %7, 668265261
%9 = ashr i32 %8, 15
%10 = xor i32 %9, %8
ret i32 %10
}
int main() {
  unsigned long a = -1;
  unsigned long b = 1;
  return (a / b) == -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
movq   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0xffffffffffffffff,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 -1, i64* %2
store i64 1, i64* %3
%4 = load i64, i64* %2
%5 = load i64, i64* %3
%6 = udiv i64 %4, %5
%7 = icmp eq i64 %6, -1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ prt(char *, int, int /*<<< orphan*/);
void clear_bldg(int min_row, int max_row) {
  int i;
  for (i = min_row; i <= max_row; i++) {
    prt("", i, 0);
  }
}


x86 assembly (clang, -O0):
<clear_bldg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114f <clear_bldg+0x3f>
mov    -0xc(%rbp),%esi
lea    0xec6(%rip),%rdi
xor    %edx,%edx
call   1030 <prt@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <clear_bldg+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bldg>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jg     1143 <clear_bldg+0x33>
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1030 <prt@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <clear_bldg+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @clear_bldg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
br label %7
7: ; preds = %14, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %5
%13 = call i32 @prt(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %12, i32 0)
br label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @clear_bldg(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = tail call i32 @prt(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %5, i32 0)
%7 = add i32 %5, 1
%8 = icmp eq i32 %5, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int intern_printf(char *, size_t, char const *, int /*<<< orphan*/);
int vsnprintf(char *buf, size_t sz, const char *fmt, va_list ap) {
  return intern_printf(buf, sz, fmt, ap);
}


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

x86 assembly (clang, -O2):
<vsnprintf>:
jmp    1030 <intern_printf@plt>

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

LLVM IR (-O2):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @intern_printf(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
char **backtrace_symbols(void *const *, int);
char **oc_backtrace_symbols(void *const *buffer, int size) {
  return backtrace_symbols(buffer, size);
}


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

x86 assembly (clang, -O2):
<oc_backtrace_symbols>:
jmp    1030 <backtrace_symbols@plt>

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

LLVM IR (-O2):
define i8** @oc_backtrace_symbols(i8** %0, i32 %1) {
%3 = tail call i8** @backtrace_symbols(i8** %0, i32 %1)
ret i8** %3
}
void XtCvtIntToBoolean() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtIntToBoolean() {
ret void
}