xunge/DecIR huggingface dataset:
/* Variables and functions */
void stub1(char, float);
void testClosureBFrV(void (*closure)(char, float), char a1, float a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureBFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movss  %xmm0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <testClosureBFrV+0x33>
mov    -0x8(%rbp),%rax
mov    -0x9(%rbp),%cl
movss  -0x10(%rbp),%xmm0
movsbl %cl,%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureBFrV>:
test   %rdi,%rdi
je     110e <testClosureBFrV+0xe>
mov    %rdi,%rax
movsbl %sil,%edi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureBFrV(void (i8, float)* %0, i8 signext %1, float %2) {
%4 = alloca void (i8, float)*
%5 = alloca i8
%6 = alloca float
store void (i8, float)* %0, void (i8, float)** %4
store i8 %1, i8* %5
store float %2, float* %6
%7 = load void (i8, float)*, void (i8, float)** %4
%8 = icmp ne void (i8, float)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load void (i8, float)*, void (i8, float)** %4
%11 = load i8, i8* %5
%12 = load float, float* %6
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @testClosureBFrV(void (i8, float)* %0, i8 signext %1, float %2) {
%4 = icmp eq void (i8, float)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i8 signext %1, float %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(char);
int /*<<< orphan*/ strcpy(char *, char const *);
char swapcase(char);
void swcasefirstl(const char *pw, char *ret) {
  strcpy(ret, pw);
  while (!isalpha(*ret))
    ret++;
  ret[0] = swapcase(ret[0]);
}


x86 assembly (clang, -O0):
<swcasefirstl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116e <swcasefirstl+0x3e>
jmp    117f <swcasefirstl+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114d <swcasefirstl+0x1d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <swapcase@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swcasefirstl>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
nop
movsbl (%rbx),%edi
call   1050 <isalpha@plt>
add    $0x1,%rbx
test   %eax,%eax
je     1140 <swcasefirstl+0x10>
movsbl -0x1(%rbx),%edi
call   1040 <swapcase@plt>
mov    %al,-0x1(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @swcasefirstl(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* %0)
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %1, %2 ], [ %9, %4 ]
%6 = load i8, i8* %5
%7 = tail call i32 @isalpha(i8 signext %6)
%8 = icmp eq i32 %7, 0
%9 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %8, label %4, label %10
10: ; preds = %4
%11 = load i8, i8* %5
%12 = tail call signext i8 @swapcase(i8 signext %11)
store i8 %12, i8* %5
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int bm_check(uint64_t *bm, uint32_t v) {
  return bm[v / (8 * sizeof(uint64_t))] & (1 << (v % (8 * sizeof(uint64_t))));
}


x86 assembly (clang, -O0):
<bm_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shr    $0x5,%rcx
mov    (%rax,%rcx,4),%eax
movslq -0xc(%rbp),%rcx
and    $0x1f,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bm_check>:
movslq %esi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x5,%rcx
and    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @bm_check(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 32
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = urem i64 %12, 32
%14 = trunc i64 %13 to i32
%15 = shl i32 1, %14
%16 = and i32 %10, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @bm_check(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = lshr i64 %3, 5
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 31
%8 = shl nuw i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ consolemanager_println(char *);
void thermometer_init() { consolemanager_println("Init: thermometer"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Init: thermometer\00"
define void @thermometer_init() {
%1 = call i32 @consolemanager_println(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Init: thermometer\00"
define void @thermometer_init() {
%1 = tail call i32 @consolemanager_println(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test2(int b) {
  if ((b >> 3) & 4)
    foo();
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1134 <test2+0x24>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
test   $0x20,%dil
jne    1117 <test2+0x7>
ret
xor    %eax,%eax
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @test2(i32 %0) {
%2 = and i32 %0, 32
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @foo()
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t get_median(size_t num_elements, uint64_t array[]) {
  if ((num_elements % 2) != 0)
    return array[num_elements / 2 + 1];
  return (array[num_elements / 2] + array[num_elements / 2 - 1]) / 2;
}


x86 assembly (clang, -O0):
<get_median>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1136 <get_median+0x36>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
mov    0x4(%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <get_median+0x63>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdx
shr    $0x1,%rdx
sub    $0x1,%rdx
add    (%rcx,%rdx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_median>:
mov    %rdi,%rax
shr    %rax
test   $0x1,%dil
jne    111d <get_median+0x1d>
mov    -0x4(%rsi,%rax,4),%ecx
add    (%rsi,%rax,4),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret
mov    0x4(%rsi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get_median(i64 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
%6 = load i64, i64* %4
%7 = urem i64 %6, 2
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i32*, i32** %5
%11 = load i64, i64* %4
%12 = udiv i64 %11, 2
%13 = add i64 %12, 1
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %3
br label %30
16: ; preds = %2
%17 = load i32*, i32** %5
%18 = load i64, i64* %4
%19 = udiv i64 %18, 2
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = load i32*, i32** %5
%23 = load i64, i64* %4
%24 = udiv i64 %23, 2
%25 = sub i64 %24, 1
%26 = getelementptr inbounds i32, i32* %22, i64 %25
%27 = load i32, i32* %26
%28 = add nsw i32 %21, %27
%29 = sdiv i32 %28, 2
store i32 %29, i32* %3
br label %30
30: ; preds = %16, %9
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @get_median(i64 %0, i32* nocapture %1) {
%3 = and i64 %0, 1
%4 = icmp eq i64 %3, 0
%5 = lshr i64 %0, 1
br i1 %4, label %10, label %6
6: ; preds = %2
%7 = add nuw i64 %5, 1
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
br label %18
10: ; preds = %2
%11 = getelementptr inbounds i32, i32* %1, i64 %5
%12 = load i32, i32* %11
%13 = add nsw i64 %5, -1
%14 = getelementptr inbounds i32, i32* %1, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, %12
%17 = sdiv i32 %16, 2
br label %18
18: ; preds = %10, %6
%19 = phi i32 [ %9, %6 ], [ %17, %10 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ err_template(int, char *);
void errThrCreate(int n_error) {
  err_template(n_error, "\nFalha ao criar threads.\n");
}


x86 assembly (clang, -O0):
<errThrCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <err_template@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errThrCreate>:
lea    0xee9(%rip),%rsi
jmp    1030 <err_template@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0AFalha ao criar threads.\0A\00"
define void @errThrCreate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @err_template(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0AFalha ao criar threads.\0A\00"
define void @errThrCreate(i32 %0) {
%2 = tail call i32 @err_template(i32 %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
OP(fd, d9) { op_d9(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d9()
ret i32 undef
}
/* Variables and functions */
int fd_sensing_get_stream_sample_count();
int /*<<< orphan*/ fd_sensing_history_save();
int /*<<< orphan*/ fd_sensing_set_stream_sample_count(int);
void fd_recognition_match(void) {
  fd_sensing_history_save();
  if (fd_sensing_get_stream_sample_count() < 50) {
    fd_sensing_set_stream_sample_count(50);
  }
}


x86 assembly (clang, -O0):
<fd_recognition_match>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fd_sensing_history_save@plt>
mov    $0x0,%al
call   1030 <fd_sensing_get_stream_sample_count@plt>
cmp    $0x32,%eax
jge    1155 <fd_recognition_match+0x25>
mov    $0x32,%edi
call   1050 <fd_sensing_set_stream_sample_count@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_recognition_match>:
push   %rax
xor    %eax,%eax
call   1040 <fd_sensing_history_save@plt>
xor    %eax,%eax
call   1030 <fd_sensing_get_stream_sample_count@plt>
cmp    $0x31,%eax
jg     114f <fd_recognition_match+0x1f>
mov    $0x32,%edi
pop    %rax
jmp    1050 <fd_sensing_set_stream_sample_count@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fd_recognition_match() {
%1 = call i32 (...) @fd_sensing_history_save()
%2 = call i32 (...) @fd_sensing_get_stream_sample_count()
%3 = icmp slt i32 %2, 50
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @fd_sensing_set_stream_sample_count(i32 50)
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @fd_recognition_match() {
%1 = tail call i32 (...) @fd_sensing_history_save()
%2 = tail call i32 (...) @fd_sensing_get_stream_sample_count()
%3 = icmp slt i32 %2, 50
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @fd_sensing_set_stream_sample_count(i32 50)
br label %6
6: ; preds = %4, %0
ret void
}
int px_get_date(char *cp) { return (*((int *)cp)); }


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

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

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

LLVM IR (-O2):
define i32 @px_get_date(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
float dy(float x, float y) { return 2 * x * x + 2 * y; }


x86 assembly (clang, -O0):
<dy>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xeea(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xed8(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dy>:
movaps %xmm0,%xmm2
addss  %xmm0,%xmm2
addss  %xmm1,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @dy(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fmul float 2.000000e+00, %5
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fmul float 2.000000e+00, %8
%10 = call float @llvm.fmuladd.f32(float %6, float %7, float %9)
ret float %10
}

LLVM IR (-O2):
define float @dy(float %0, float %1) {
%3 = fmul float %0, 2.000000e+00
%4 = fmul float %1, 2.000000e+00
%5 = tail call float @llvm.fmuladd.f32(float %3, float %0, float %4)
ret float %5
}
int ast_register_atexit(void (*func)(void)) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ast_register_atexit(void ()* nocapture readnone %0) {
ret i32 0
}
int config_MODULE_NEWCAMD(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @config_MODULE_NEWCAMD() {
ret i32 1
}
int add(int x, int y) {
  if (y % 2 == 0) {
    return x + y + 1;
  }
  return x + y;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <add+0x2f>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <add+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %esi,%eax
not    %eax
and    $0x1,%eax
add    %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @add(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 = srem i32 %6, 2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = add nsw i32 %10, %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %18
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = add nsw i32 %15, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = and i32 %1, 1
%4 = add nsw i32 %1, %0
%5 = xor i32 %3, 1
%6 = add nsw i32 %4, %5
ret i32 %6
}
double max(x, y)
double x, y;
{ return (((x > y) ? x : y)); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(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 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int func3(int x) {
  int ret = 0;
  ret = 2 * x / ret;
  return ret;
}


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = mul nsw i32 2, %4
%6 = load i32, i32* %3
%7 = sdiv i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @func3(i32 %0) {
ret i32 poison
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
void ref_sub_int16_t(int16_t arg1, int16_t arg2, int16_t *result) {
  *result = arg1 - arg2;
}


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

x86 assembly (clang, -O2):
<ref_sub_int16_t>:
sub    %rsi,%rdi
mov    %rdi,(%rdx)
ret

LLVM IR (-O0):
define void @ref_sub_int16_t(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sub nsw i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @ref_sub_int16_t(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = sub nsw i64 %0, %1
store i64 %4, i64* %2
ret void
}
long fat(int n) {
  long f = 1;
  for (; n > 1; n--)
    f = f * n;
  return f;
}


x86 assembly (clang, -O0):
<fat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1137 <fat+0x37>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110f <fat+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fat>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1131 <fat+0x31>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
lea    -0x1(%rcx),%rdx
cmp    $0x2,%rcx
mov    %rdx,%rcx
ja     1120 <fat+0x20>
ret

LLVM IR (-O0):
define i64 @fat(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 1, i64* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i64, i64* %3
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = mul nsw i64 %8, %10
store i64 %11, i64* %3
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add nsw i32 %13, -1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @fat(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %9, %5 ]
%7 = phi i64 [ 1, %3 ], [ %8, %5 ]
%8 = mul nsw i64 %7, %6
%9 = add nsw i64 %6, -1
%10 = icmp ugt i64 %6, 2
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = phi i64 [ 1, %1 ], [ %8, %5 ]
ret i64 %12
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t readw(uint32_t addr) { return *(volatile uint16_t *)addr; }


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

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

LLVM IR (-O0):
define i32 @readw(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @readw(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
void minimal_failing_r6276() {
  int a = 123;
  int *p = &a;
  int **q = &p;
  *p = 50;
  test(a == 50);
  test(*p == 50);
  test(a == *p);
}


x86 assembly (clang, -O0):
<minimal_failing_r6276>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x7b,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x32,(%rax)
cmpl   $0x32,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x32,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimal_failing_r6276>:
push   %rax
mov    $0x1,%edi
call   1030 <test@plt>
mov    $0x1,%edi
call   1030 <test@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <test@plt>

LLVM IR (-O0):
define void @minimal_failing_r6276() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
store i32 123, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
%4 = load i32*, i32** %2
store i32 50, i32* %4
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 50
%7 = zext i1 %6 to i32
%8 = call i32 @test(i32 %7)
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 50
%12 = zext i1 %11 to i32
%13 = call i32 @test(i32 %12)
%14 = load i32, i32* %1
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = icmp eq i32 %14, %16
%18 = zext i1 %17 to i32
%19 = call i32 @test(i32 %18)
ret void
}

LLVM IR (-O2):
define void @minimal_failing_r6276() {
%1 = tail call i32 @test(i32 1)
%2 = tail call i32 @test(i32 1)
%3 = tail call i32 @test(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ cal_angle(unsigned int);
int /*<<< orphan*/ motion_direction(int);
int /*<<< orphan*/ speed_control(unsigned int, unsigned int);
void left(unsigned int speed, unsigned int angle) {
  motion_direction(0b00000101);
  speed_control(speed, speed);
  cal_angle(angle);
  _delay_us(10);
}


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x5,%edi
call   1040 <motion_direction@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <speed_control@plt>
mov    -0x8(%rbp),%edi
call   1030 <cal_angle@plt>
mov    $0xa,%edi
call   1050 <_delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x5,%edi
call   1040 <motion_direction@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1060 <speed_control@plt>
mov    %ebx,%edi
call   1030 <cal_angle@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_delay_us@plt>

LLVM IR (-O0):
define void @left(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @motion_direction(i32 5)
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @speed_control(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @cal_angle(i32 %9)
%11 = call i32 @_delay_us(i32 10)
ret void
}

LLVM IR (-O2):
define void @left(i32 %0, i32 %1) {
%3 = tail call i32 @motion_direction(i32 5)
%4 = tail call i32 @speed_control(i32 %0, i32 %0)
%5 = tail call i32 @cal_angle(i32 %1)
%6 = tail call i32 @_delay_us(i32 10)
ret void
}
void RTVfsSymlinkSetOwner(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsSymlinkSetOwner() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x6d() {
  Assert_real((ispunct(109) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              550, ("ispunct should be 0 for m"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for m\00"
define void @t_ispunct_0x6d() {
%1 = tail call i64 @ispunct(i32 109)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 550, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strmin(char *s1, char *s2) {
  if (strcmp(s1, s2) < 0)
    return s1;
  return s2;
}


x86 assembly (clang, -O0):
<strmin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jge    1144 <strmin+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <strmin+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmin>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strcmp@plt>
test   %rax,%rax
cmovs  %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strmin(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp slt i64 %3, 0
%5 = select i1 %4, i8* %0, i8* %1
ret i8* %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t f() {
  uint64_t n = 600851475143, factor = 2;
  while (1) {
    if (n % factor == 0)
      n /= factor;
    else
      factor += 1;
    if (factor * factor > n)
      return n;
    else if (n == 1)
      return factor;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0xe589eac7,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1133 <f+0x33>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    113c <f+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1157 <f+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <f+0x76>
cmpl   $0x1,-0x8(%rbp)
jne    116c <f+0x6c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <f+0x76>
jmp    1171 <f+0x71>
jmp    1112 <f+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 -443946297, i32* %2
store i32 2, i32* %3
br label %4
4: ; preds = %0, %30
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = sdiv i32 %11, %10
store i32 %12, i32* %2
br label %16
13: ; preds = %4
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %3
%18 = load i32, i32* %3
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %2
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = load i32, i32* %2
store i32 %23, i32* %1
br label %31
24: ; preds = %16
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = load i32, i32* %3
store i32 %28, i32* %1
br label %31
29: ; preds = %24
br label %30
30: ; preds = %29
br label %4
31: ; preds = %27, %22
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @f() {
ret i32 -443946297
}
/* Variables and functions */
scalar_t__ errno_interrupted();
int read(int, void *, int);
int robust_read(int fd, void *buffer, int length) {
  int rc;
  do {
    rc = read(fd, buffer, length);
  } while (rc < 0 && errno_interrupted());
  return rc;
}


x86 assembly (clang, -O0):
<robust_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jge    1164 <robust_read+0x44>
mov    $0x0,%al
call   1040 <errno_interrupted@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1132 <robust_read+0x12>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<robust_read>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edi,%ebp
nop
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <read@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    114f <robust_read+0x2f>
xor    %eax,%eax
call   1040 <errno_interrupted@plt>
test   %rax,%rax
jne    1130 <robust_read+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @robust_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @read(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = call i64 (...) @errno_interrupted()
%18 = icmp ne i64 %17, 0
br label %19
19: ; preds = %16, %13
%20 = phi i1 [ false, %13 ], [ %18, %16 ]
br i1 %20, label %8, label %21
21: ; preds = %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @robust_read(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i64 (...) @errno_interrupted()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %7
ret i32 %5
}
char *ngettext(const char *msgid, const char *msgid_plural,
               unsigned long int n) {
  return (char *)(n == 1 ? msgid : msgid_plural);
}


x86 assembly (clang, -O0):
<ngettext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jne    1128 <ngettext+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <ngettext+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ngettext>:
mov    %rdi,%rax
cmp    $0x1,%rdx
cmovne %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @ngettext(i8* readnone %0, i8* readnone %1, i64 %2) {
%4 = icmp eq i64 %2, 1
%5 = select i1 %4, i8* %0, i8* %1
ret i8* %5
}
/* Variables and functions */
int utf8_decode_v2(char const *, size_t, size_t *);
int utf8_decode(const char *utf8char, size_t *charlen) {
  return utf8_decode_v2(utf8char, (size_t)-1, charlen);
}


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

x86 assembly (clang, -O2):
<utf8_decode>:
mov    %rsi,%rdx
mov    $0xffffffffffffffff,%rsi
jmp    1030 <utf8_decode_v2@plt>

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

LLVM IR (-O2):
define i32 @utf8_decode(i8* %0, i64* %1) {
%3 = tail call i32 @utf8_decode_v2(i8* %0, i64 -1, i64* %1)
ret i32 %3
}
void gtk_text_view_get_iter_at_location() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_get_iter_at_location() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printNum(int /*<<< orphan*/, int, int);
char *hex32(uint32_t a) { printNum(a, 16, 8); }


x86 assembly (clang, -O0):
<hex32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x10,%esi
mov    $0x8,%edx
call   1030 <printNum@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex32>:
mov    $0x10,%esi
mov    $0x8,%edx
jmp    1030 <printNum@plt>

LLVM IR (-O0):
define i8* @hex32(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printNum(i32 %4, i32 16, i32 8)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @hex32(i32 %0) {
%2 = tail call i32 @printNum(i32 %0, i32 16, i32 8)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ _console_putc(char const);
void puthex(char ch) {
  static const char digits[] = "0123456789ABCDEF";
  _console_putc(digits[(ch >> 4) & 0x0F]);
  _console_putc(digits[ch & 0x0F]);
}


x86 assembly (clang, -O0):
<puthex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xece(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <_console_putc@plt>
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xeb4(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <_console_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puthex>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movzbl %bl,%eax
shr    $0x4,%rax
lea    0xedc(%rip),%r14
movsbl (%rax,%r14,1),%edi
call   1030 <_console_putc@plt>
and    $0xf,%ebx
movsbl (%rbx,%r14,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <_console_putc@plt>

LLVM IR (-O0):
@puthex.digits = internal constant [17 x i8] c"0123456789ABCDEF\00"
define void @puthex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @puthex.digits, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = call i32 @_console_putc(i8 signext %9)
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = and i32 %12, 15
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [17 x i8], [17 x i8]* @puthex.digits, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @_console_putc(i8 signext %16)
ret void
}

LLVM IR (-O2):
@puthex.digits = internal unnamed_addr constant [17 x i8] c"0123456789ABCDEF\00"
define void @puthex(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 4
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @puthex.digits, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @_console_putc(i8 signext %6)
%8 = and i32 %2, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @puthex.digits, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @_console_putc(i8 signext %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ conv_int_to_string(int);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  print("enter number to convert to string \n");
  scanf("%d", &n);
  conv_int_to_string(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <print@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <conv_int_to_string@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <print@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <conv_int_to_string@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"enter number to convert to string \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @print(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @conv_int_to_string(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"enter number to convert to string \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @print(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @conv_int_to_string(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putenv(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strdup(char *);
void date_set_TZ(char *TZ) {
  char statement[128];
  sprintf(statement, "TZ=%s", TZ);
  putenv(strdup(statement));
}


x86 assembly (clang, -O0):
<date_set_TZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1030 <putenv@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_set_TZ>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rdx
lea    0xebe(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1030 <putenv@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"TZ=%s\00"
define void @date_set_TZ(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i32 @strdup(i8* %7)
%9 = call i32 @putenv(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"TZ=%s\00"
define void @date_set_TZ(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @strdup(i8* %3)
%6 = call i32 @putenv(i32 %5)
ret void
}
void xen_map_cache_init(void) {}


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

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

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

LLVM IR (-O2):
define void @xen_map_cache_init() {
ret void
}
/* Variables and functions */
float sqrt(float);
float distance(float x1, float y1, float x2, float y2) {
  float dx = (x1 - x2), dy = (y1 - y2);
  return sqrt(dx * dx + dy * dy);
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
subss  %xmm2,%xmm0
subss  %xmm3,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <distance+0x21>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load float, float* %5
%12 = load float, float* %7
%13 = fsub float %11, %12
store float %13, float* %9
%14 = load float, float* %6
%15 = load float, float* %8
%16 = fsub float %14, %15
store float %16, float* %10
%17 = load float, float* %9
%18 = load float, float* %9
%19 = load float, float* %10
%20 = load float, float* %10
%21 = fmul float %19, %20
%22 = call float @llvm.fmuladd.f32(float %17, float %18, float %21)
%23 = call float @sqrt(float %22)
ret float %23
}

LLVM IR (-O2):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fsub float %1, %3
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call float @sqrt(float %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ test_set_name();
int main(void) {
  setvbuf(stdout, NULL, _IONBF, 0);
  test_set_name();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x0,%al
call   1030 <test_set_name@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
xor    %eax,%eax
call   1030 <test_set_name@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = load i32, i32* @_IONBF
%4 = call i32 @setvbuf(i32 %2, i32* null, i32 %3, i32 0)
%5 = call i32 (...) @test_set_name()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = tail call i32 (...) @test_set_name()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bef_push(int /*<<< orphan*/);
int ins_nm0() {
  bef_push(0);
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @ins_nm0() {
%1 = call i32 @bef_push(i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @ins_nm0() {
%1 = tail call i32 @bef_push(i32 0)
ret i32 1
}
int test_imm_D6int16_reg(short val) {
  return ((val) & (-0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff2a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D6int16_reg>:
test   $0xff2a,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D6int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -214
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D6int16_reg(i16 signext %0) {
%2 = and i16 %0, -214
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}