xunge/DecIR huggingface dataset:
int _open(const char *path, int flags, ...) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @_open(i8* nocapture readnone %0, i32 %1, ...) {
ret i32 -1
}
/* Type definitions */
struct eiwic_output {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct eiwic_output *);
void output_destroy(void *data) {
  struct eiwic_output *output = data;
  free(output);
}


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

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

LLVM IR (-O0):
%struct.eiwic_output = type { i32 }
define void @output_destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.eiwic_output*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.eiwic_output*
store %struct.eiwic_output* %5, %struct.eiwic_output** %3
%6 = load %struct.eiwic_output*, %struct.eiwic_output** %3
%7 = call i32 @free(%struct.eiwic_output* %6)
ret void
}

LLVM IR (-O2):
%struct.eiwic_output = type { i32 }
define void @output_destroy(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.eiwic_output*
%3 = tail call i32 @free(%struct.eiwic_output* %2)
ret void
}
void MD5_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @MD5_Init() {
ret void
}
int MipMapsCountFromWidth(unsigned long int width) {
  unsigned int mipMapsCount = 0;
  while (width) {
    ++mipMapsCount;
    width /= 2;
  }
  return mipMapsCount;
}


x86 assembly (clang, -O0):
<MipMapsCountFromWidth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <MipMapsCountFromWidth+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <MipMapsCountFromWidth+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MipMapsCountFromWidth>:
xor    %eax,%eax
test   %rdi,%rdi
je     111f <MipMapsCountFromWidth+0x1f>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <MipMapsCountFromWidth+0x10>
ret

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

LLVM IR (-O2):
define i32 @MipMapsCountFromWidth(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
void ff_sw_get(struct ff_sw_t *sw) {}


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

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

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

LLVM IR (-O2):
%struct.ff_sw_t = type opaque
define void @ff_sw_get(%struct.ff_sw_t* nocapture %0) {
ret void
}
int clear_motor_position_counter(int motor) {}


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

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

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

LLVM IR (-O2):
define i32 @clear_motor_position_counter(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, unsigned int *, int);
float get_float(unsigned char *d) {
  float ret;
  unsigned int inter = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
  memcpy(&ret, &inter, 4);
  return ret;
}


x86 assembly (clang, -O0):
<get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
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
mov    %eax,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_float>:
push   %rax
mov    (%rdi),%eax
bswap  %eax
mov    %eax,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @get_float(i8* nocapture %0) {
%2 = alloca float
%3 = alloca i32
%4 = bitcast float* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = shl nuw i32 %7, 24
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %12, %8
%14 = getelementptr inbounds i8, i8* %0, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw nsw i32 %16, 8
%18 = or i32 %13, %17
%19 = getelementptr inbounds i8, i8* %0, i64 3
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = or i32 %18, %21
store i32 %22, i32* %3
%23 = call i32 @memcpy(float* %2, i32* %3, i32 4)
%24 = load float, float* %2
ret float %24
}
unsigned hash(const char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++)
    hashval = *s + 31 * hashval;
  return hashval % 101;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <hash+0x47>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x446f8657,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x65,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 101
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void calculate_cost(const int i, int *end, int *cost, const int j) {}


x86 assembly (clang, -O0):
<calculate_cost>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @calculate_cost(i32 %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @calculate_cost(i32 %0, i32* nocapture %1, i32* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void __misaligned_u64(void) { panic("misaligned (__u64 *) in __xchg\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"misaligned (__u64 *) in __xchg\0A\00"
define void @__misaligned_u64() {
%1 = call i32 @panic(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"misaligned (__u64 *) in __xchg\0A\00"
define void @__misaligned_u64() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Control_RestoreConfig();
void Control_Wakeup(void) { Control_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @Control_Wakeup() {
%1 = tail call i32 (...) @Control_RestoreConfig()
ret void
}
/* Variables and functions */
int SerialAPI_request(unsigned char *, int);
int ZW_MemoryGetID() {
  unsigned char buf[] = {0x00, 0x20};
  return SerialAPI_request(buf, 2);
}


x86 assembly (clang, -O0):
<ZW_MemoryGetID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZW_MemoryGetID>:
push   %rax
movw   $0x2000,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.ZW_MemoryGetID.buf = [2 x i8] c"\00 "
define i32 @ZW_MemoryGetID() {
%1 = alloca [2 x i8]
%2 = bitcast [2 x i8]* %1 to i8*
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = call i32 @SerialAPI_request(i8* %3, i32 2)
ret i32 %4
}

LLVM IR (-O2):
define i32 @ZW_MemoryGetID() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 8192, i16* %1
%3 = call i32 @SerialAPI_request(i8* %2, i32 2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ brownmold(int);
unsigned int d(int);
int /*<<< orphan*/ greenslime(int);
int /*<<< orphan*/ niceprint(char *);
int /*<<< orphan*/ yellowmold(int);
void slime(void) {
  unsigned d20;
  niceprint(
      "As the adventurers pass through a small cavern, they encounter a patch "
      "of slime or mold.\n\n");
  d20 = d(6);
  if (d20 < 4)
    greenslime(1);
  else if (d20 < 6)
    yellowmold(1);
  else
    brownmold(1);
}


x86 assembly (clang, -O0):
<slime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1070 <niceprint@plt>
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jae    118a <slime+0x3a>
mov    $0x1,%edi
call   1060 <greenslime@plt>
jmp    11b2 <slime+0x62>
cmpl   $0x6,-0x4(%rbp)
jae    11a3 <slime+0x53>
mov    $0x1,%edi
call   1040 <yellowmold@plt>
jmp    11ad <slime+0x5d>
mov    $0x1,%edi
call   1030 <brownmold@plt>
jmp    11b2 <slime+0x62>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slime>:
push   %rax
lea    0xea8(%rip),%rdi
call   1070 <niceprint@plt>
mov    $0x6,%edi
call   1050 <d@plt>
mov    $0x1,%edi
cmp    $0x3,%eax
ja     1177 <slime+0x27>
pop    %rax
jmp    1060 <greenslime@plt>
cmp    $0x5,%eax
ja     1182 <slime+0x32>
pop    %rax
jmp    1040 <yellowmold@plt>
pop    %rax
jmp    1030 <brownmold@plt>

LLVM IR (-O0):
@.str = [91 x i8] c"As the adventurers pass through a small cavern, they encounter a patch of slime or mold.\0A\0A\00"
define void @slime() {
%1 = alloca i32
%2 = call i32 @niceprint(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @d(i32 6)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @greenslime(i32 1)
br label %16
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp ult i32 %9, 6
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @yellowmold(i32 1)
br label %15
13: ; preds = %8
%14 = call i32 @brownmold(i32 1)
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15, %6
ret void
}

LLVM IR (-O2):
@.str = [91 x i8] c"As the adventurers pass through a small cavern, they encounter a patch of slime or mold.\0A\0A\00"
define void @slime() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @d(i32 6)
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @greenslime(i32 1)
br label %12
6: ; preds = %0
%7 = icmp ult i32 %2, 6
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @yellowmold(i32 1)
br label %12
10: ; preds = %6
%11 = tail call i32 @brownmold(i32 1)
br label %12
12: ; preds = %8, %10, %4
ret void
}
int test_5(int a, int b, int c, int d) { return c - (a != b); }


x86 assembly (clang, -O0):
<test_5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_5>:
mov    %edx,%eax
xor    %ecx,%ecx
cmp    %esi,%edi
setne  %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_5(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp ne i32 %10, %11
%13 = zext i1 %12 to i32
%14 = sub nsw i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_5(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ne i32 %0, %1
%6 = sext i1 %5 to i32
%7 = add i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *, char *);
int /*<<< orphan*/ squeeze(char *, char *);
main() {
  char s[20];
  char t[20];
  scanf("%s %s", s, t);
  squeeze(s, t);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    0xeb9(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <squeeze@plt>
lea    -0x20(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xec2(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <squeeze@plt>
lea    0xea3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @squeeze(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void chk_str(char *str) { *(str + (sizeof(char) * strlen(str))) = 0; }


x86 assembly (clang, -O0):
<chk_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x0,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @chk_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = mul i64 1, %6
%8 = getelementptr inbounds i8, i8* %3, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @chk_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void althrd_yield(void) { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @althrd_yield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_trap(int sig) { printf("TRAP\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"TRAP\00"
define void @catch_trap(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flexerror(char *);
int /*<<< orphan*/ sprintf(char *, char const *, char const *);
void lerrsf(const char *msg, const char *arg) {
  char errmsg[2048];
  (void)sprintf(errmsg, msg, arg);
  flexerror(errmsg);
}


x86 assembly (clang, -O0):
<lerrsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
call   1030 <flexerror@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerrsf>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <flexerror@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @lerrsf(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 @flexerror(i8* %10)
ret void
}

LLVM IR (-O2):
define void @lerrsf(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 @flexerror(i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ drem(double, double);
int /*<<< orphan*/ link_failure_drem();
void test_drem(double d1, double d2) {
  if (drem(d1, d2) != drem(d1, d2))
    link_failure_drem();
}


x86 assembly (clang, -O0):
<test_drem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <drem@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <drem@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_drem+0x4b>
mov    $0x0,%al
call   1030 <link_failure_drem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_drem>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1040 <drem@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <drem@plt>
cmp    %rax,%rbx
jne    1153 <test_drem+0x33>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_drem@plt>

LLVM IR (-O0):
define void @test_drem(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i64 @drem(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i64 @drem(double %8, double %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_drem()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_drem(double %0, double %1) {
%3 = tail call i64 @drem(double %0, double %1)
%4 = tail call i64 @drem(double %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_drem()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned int echo_int_marshal_outputs__camkes_ret_fn_328(unsigned int, int *);
unsigned int echo_int_marshal_outputs(int *_camkes_return_332) {
  unsigned int _camkes_length_333 = 0;
  _camkes_length_333 = echo_int_marshal_outputs__camkes_ret_fn_328(
      _camkes_length_333, _camkes_return_332);
  if (_camkes_length_333 == 0xffffffffU) {
    return 0xffffffffU;
  }
  (void)0;
  return _camkes_length_333;
}


x86 assembly (clang, -O0):
<echo_int_marshal_outputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <echo_int_marshal_outputs__camkes_ret_fn_328@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1148 <echo_int_marshal_outputs+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <echo_int_marshal_outputs+0x3e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_int_marshal_outputs>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <echo_int_marshal_outputs__camkes_ret_fn_328@plt>

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

LLVM IR (-O2):
define i32 @echo_int_marshal_outputs(i32* %0) {
%2 = tail call i32 @echo_int_marshal_outputs__camkes_ret_fn_328(i32 0, i32* %0)
ret i32 %2
}
/* Type definitions */
typedef double u_int64_t;

/* Variables and functions */
u_int64_t realspeed(u_int64_t speed) { return speed * ((double)95 / 100); }


x86 assembly (clang, -O0):
<realspeed>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<realspeed>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @realspeed(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3FEE666666666666
ret double %4
}

LLVM IR (-O2):
define double @realspeed(double %0) {
%2 = fmul double %0, 0x3FEE666666666666
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
testLogicalOr() { printf("%d || %d = %d\n", 10, 4, 10 || 4); }


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

x86 assembly (clang, -O2):
<testLogicalOr>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d || %d = %d\0A\00"
define i32 @testLogicalOr() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d || %d = %d\0A\00"
define i32 @testLogicalOr() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
ret i32 undef
}
void initv(float *r, const float x) {
  r[0] = x;
  r[1] = x;
  r[2] = x;
}


x86 assembly (clang, -O0):
<initv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initv>:
movss  %xmm0,(%rdi)
movss  %xmm0,0x4(%rdi)
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @initv(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
store float %5, float* %7
%8 = load float, float* %4
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 1
store float %8, float* %10
%11 = load float, float* %4
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 2
store float %11, float* %13
ret void
}

LLVM IR (-O2):
define void @initv(float* nocapture writeonly %0, float %1) {
store float %1, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
store float %1, float* %3
%4 = getelementptr inbounds float, float* %0, i64 2
store float %1, float* %4
ret void
}
void wx11bu(button) int *button;
{ wx11fl(); }


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

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

LLVM IR (-O0):
define void @wx11bu(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @wx11fl()
ret void
}

LLVM IR (-O2):
define void @wx11bu(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @wx11fl()
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ die(char *);
int stat(char *, struct stat *);
void test_available(void) {
  struct stat buf;
  int fd;
  fd = stat("/proc/sys/kernel/stack_tracer_enabled", &buf);
  if (fd < 0)
    die("stack tracer not configured on running kernel");
}


x86 assembly (clang, -O0):
<test_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1151 <test_available+0x31>
lea    0xeda(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_available>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
js     1136 <test_available+0x16>
pop    %rax
ret
lea    0xee9(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [38 x i8] c"/proc/sys/kernel/stack_tracer_enabled\00"
@.str.1 = [46 x i8] c"stack tracer not configured on running kernel\00"
define void @test_available() {
%1 = alloca %struct.stat
%2 = alloca i32
%3 = call i32 @stat(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @die(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [38 x i8] c"/proc/sys/kernel/stack_tracer_enabled\00"
@.str.1 = [46 x i8] c"stack tracer not configured on running kernel\00"
define void @test_available() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @die(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
void emptyScreen() { clear(); }


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

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

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

LLVM IR (-O2):
define void @emptyScreen() {
%1 = tail call i32 (...) @clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ see_all_db();
int main() {
  see_all_db();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <see_all_db@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @see_all_db()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kdump_failed(int);
scalar_t__ sclp_hsa_copy(void *, int, int);
int /*<<< orphan*/ sclp_hsa_copy_exit();
void copy_from_hsa(unsigned long dst, unsigned long src, int cnt) {
  if (sclp_hsa_copy((void *)dst, 2 + src / 4096, cnt / 4096)) {
    sclp_hsa_copy_exit();
    kdump_failed(0x00004524);
  }
}


x86 assembly (clang, -O0):
<copy_from_hsa>:
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),%rax
shr    $0xc,%rax
add    $0x2,%rax
mov    %eax,%esi
mov    -0x14(%rbp),%eax
mov    $0x1000,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <sclp_hsa_copy@plt>
cmp    $0x0,%rax
je     1182 <copy_from_hsa+0x52>
mov    $0x0,%al
call   1050 <sclp_hsa_copy_exit@plt>
mov    $0x4524,%edi
call   1040 <kdump_failed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_from_hsa>:
push   %rax
shr    $0xc,%rsi
add    $0x2,%esi
lea    0xfff(%rdx),%eax
test   %edx,%edx
cmovs  %eax,%edx
sar    $0xc,%edx
call   1030 <sclp_hsa_copy@plt>
test   %rax,%rax
je     1162 <copy_from_hsa+0x32>
xor    %eax,%eax
call   1050 <sclp_hsa_copy_exit@plt>
mov    $0x4524,%edi
pop    %rax
jmp    1040 <kdump_failed@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @copy_from_hsa(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = inttoptr i64 %7 to i8*
%9 = load i64, i64* %5
%10 = udiv i64 %9, 4096
%11 = add i64 2, %10
%12 = trunc i64 %11 to i32
%13 = load i32, i32* %6
%14 = sdiv i32 %13, 4096
%15 = call i64 @sclp_hsa_copy(i8* %8, i32 %12, i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = call i32 (...) @sclp_hsa_copy_exit()
%19 = call i32 @kdump_failed(i32 17700)
br label %20
20: ; preds = %17, %3
ret void
}

LLVM IR (-O2):
define void @copy_from_hsa(i64 %0, i64 %1, i32 %2) {
%4 = inttoptr i64 %0 to i8*
%5 = lshr i64 %1, 12
%6 = trunc i64 %5 to i32
%7 = add i32 %6, 2
%8 = sdiv i32 %2, 4096
%9 = tail call i64 @sclp_hsa_copy(i8* %4, i32 %7, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = tail call i32 (...) @sclp_hsa_copy_exit()
%13 = tail call i32 @kdump_failed(i32 17700)
br label %14
14: ; preds = %11, %3
ret void
}
int grabber_end() { return 0; }


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

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

LLVM IR (-O0):
define i32 @grabber_end() {
ret i32 0
}

LLVM IR (-O2):
define i32 @grabber_end() {
ret i32 0
}
/* Variables and functions */
char *Malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *DupStr(const char *p) {
  char *new;
  new = Malloc(strlen(p) + 1);
  strcpy(new, p);
  return new;
}


x86 assembly (clang, -O0):
<DupStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <Malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DupStr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1030 <Malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @DupStr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @Malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @DupStr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @Malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void parallel_end(int exit_code) { exit(exit_code); }


x86 assembly (clang, -O0):
<parallel_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<parallel_end>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @parallel_end(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ internal_function_is_not_visible();
int /*<<< orphan*/ printf(char *, int, int);
void foo2(int x, int y) {
  if (y < 2) {
    internal_function_is_not_visible();
  }
  printf("foo@@V2: %d %d\n", x, y);
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    113f <foo2+0x1f>
mov    $0x0,%al
call   1030 <internal_function_is_not_visible@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cmp    $0x1,%esi
jg     1133 <foo2+0x13>
xor    %eax,%eax
call   1030 <internal_function_is_not_visible@plt>
lea    0xec6(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"foo@@V2: %d %d\0A\00"
define void @foo2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @internal_function_is_not_visible()
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"foo@@V2: %d %d\0A\00"
define void @foo2(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @internal_function_is_not_visible()
br label %6
6: ; preds = %4, %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
unsigned long expt_mod(unsigned long, unsigned long, unsigned long);
unsigned long mod_inv(unsigned long x, unsigned long p) {
  return expt_mod(x, p - 2, p);
}


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

x86 assembly (clang, -O2):
<mod_inv>:
mov    %rsi,%rdx
add    $0xfffffffffffffffe,%rsi
jmp    1030 <expt_mod@plt>

LLVM IR (-O0):
define i64 @mod_inv(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub i64 %6, 2
%8 = load i64, i64* %4
%9 = call i64 @expt_mod(i64 %5, i64 %7, i64 %8)
ret i64 %9
}

LLVM IR (-O2):
define i64 @mod_inv(i64 %0, i64 %1) {
%3 = add i64 %1, -2
%4 = tail call i64 @expt_mod(i64 %0, i64 %3, i64 %1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ cpu_sinx();
int main() { cpu_sinx(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <cpu_sinx@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cpu_sinx()
ret i32 0
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int sscanf(int /*<<< orphan*/, char *, unsigned int *);
int numanodefilter(const struct dirent *entry) {
  unsigned int tmp;
  return (1 == sscanf(entry->d_name, "node%u", &tmp));
}


x86 assembly (clang, -O0):
<numanodefilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numanodefilter>:
push   %rax
mov    (%rdi),%edi
lea    0xee6(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [7 x i8] c"node%u\00"
define i32 @numanodefilter(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
%3 = alloca i32
store %struct.dirent* %0, %struct.dirent** %2
%4 = load %struct.dirent*, %struct.dirent** %2
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @sscanf(i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = icmp eq i32 1, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [7 x i8] c"node%u\00"
define i32 @numanodefilter(%struct.dirent* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @sscanf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprint(int, char *);
void usage(void) {
  fprint(2, "usage: u9fs [-Dnz] [-a authmethod] [-m msize] [-u user] [root]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
call   1030 <fprint@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [64 x i8] c"usage: u9fs [-Dnz] [-a authmethod] [-m msize] [-u user] [root]\0A\00"
define void @usage() {
%1 = call i32 @fprint(i32 2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [64 x i8] c"usage: u9fs [-Dnz] [-a authmethod] [-m msize] [-u user] [root]\0A\00"
define void @usage() {
%1 = tail call i32 @fprint(i32 2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int main() { return (4 / 2) + 1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
int main() {
  char *assigned_null = 0;
  int null_pointer = *assigned_null;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = alloca i32
store i8* null, i8** %1
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
store i32 %5, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t detexPack32B8(int b) {
  return (uint32_t)b << 16;
}


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

x86 assembly (clang, -O2):
<detexPack32B8>:
mov    %edi,%eax
shl    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @detexPack32B8(i32 %0) {
%2 = shl i32 %0, 16
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SendByte(char);
int /*<<< orphan*/ I2C_StartCondition();
int /*<<< orphan*/ I2C_StopCondition();
void ds1307_WriteReg(char n, char m) {
  I2C_StartCondition();
  I2C_SendByte(0b01101000 << 1);
  I2C_SendByte(n);
  I2C_SendByte(m);
  I2C_StopCondition();
}


x86 assembly (clang, -O0):
<ds1307_WriteReg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1050 <I2C_StartCondition@plt>
mov    $0xffffffd0,%edi
call   1030 <I2C_SendByte@plt>
movsbl -0x1(%rbp),%edi
call   1030 <I2C_SendByte@plt>
movsbl -0x2(%rbp),%edi
call   1030 <I2C_SendByte@plt>
mov    $0x0,%al
call   1040 <I2C_StopCondition@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1307_WriteReg>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <I2C_StartCondition@plt>
mov    $0xffffffd0,%edi
call   1030 <I2C_SendByte@plt>
mov    %ebp,%edi
call   1030 <I2C_SendByte@plt>
mov    %ebx,%edi
call   1030 <I2C_SendByte@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <I2C_StopCondition@plt>

LLVM IR (-O0):
define void @ds1307_WriteReg(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @I2C_StartCondition()
%6 = call i32 @I2C_SendByte(i8 signext -48)
%7 = load i8, i8* %3
%8 = call i32 @I2C_SendByte(i8 signext %7)
%9 = load i8, i8* %4
%10 = call i32 @I2C_SendByte(i8 signext %9)
%11 = call i32 (...) @I2C_StopCondition()
ret void
}

LLVM IR (-O2):
define void @ds1307_WriteReg(i8 signext %0, i8 signext %1) {
%3 = tail call i32 (...) @I2C_StartCondition()
%4 = tail call i32 @I2C_SendByte(i8 signext -48)
%5 = tail call i32 @I2C_SendByte(i8 signext %0)
%6 = tail call i32 @I2C_SendByte(i8 signext %1)
%7 = tail call i32 (...) @I2C_StopCondition()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(unsigned int);
void testTortureExecute(void) {
  signed char c = -1;
  unsigned u = (unsigned short)c;
  f(u);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movzwl %ax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
mov    $0xffff,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca i8
%2 = alloca i32
store i8 -1, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i16
%5 = zext i16 %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @f(i32 %6)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @f(i32 65535)
ret void
}