xunge/DecIR huggingface dataset:
/* Variables and functions */
double __nv_modf(double, double *);
double modf(double __a, double *__b) { return __nv_modf(__a, __b); }


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

x86 assembly (clang, -O2):
<modf>:
jmp    1030 <__nv_modf@plt>

LLVM IR (-O0):
define double @modf(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 double @__nv_modf(double %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @modf(double %0, double* %1) {
%3 = tail call double @__nv_modf(double %0, double* %1)
ret double %3
}
void lgtd_proto_tag(struct lgtd_client *client,
                    const struct lgtd_proto_target_list *targets,
                    const char *tag_label) {
  (void)client;
  (void)targets;
  (void)tag_label;
}


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

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

LLVM IR (-O0):
%struct.lgtd_client = type opaque
%struct.lgtd_proto_target_list = type opaque
define void @lgtd_proto_tag(%struct.lgtd_client* %0, %struct.lgtd_proto_target_list* %1, i8* %2) {
%4 = alloca %struct.lgtd_client*
%5 = alloca %struct.lgtd_proto_target_list*
%6 = alloca i8*
store %struct.lgtd_client* %0, %struct.lgtd_client** %4
store %struct.lgtd_proto_target_list* %1, %struct.lgtd_proto_target_list** %5
store i8* %2, i8** %6
%7 = load %struct.lgtd_client*, %struct.lgtd_client** %4
%8 = load %struct.lgtd_proto_target_list*, %struct.lgtd_proto_target_list** %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
%struct.lgtd_client = type opaque
%struct.lgtd_proto_target_list = type opaque
define void @lgtd_proto_tag(%struct.lgtd_client* nocapture %0, %struct.lgtd_proto_target_list* nocapture %1, i8* nocapture %2) {
ret void
}
void gtk_text_tag_table_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_tag_table_get_type() {
ret void
}
/* Type definitions */
struct interface {
  int dummy;
};
struct dhcpcd_ctx {
  int dummy;
};

/* Variables and functions */
struct interface *if_findindexname(struct dhcpcd_ctx *, int /*<<< orphan*/,
                                   char const *);
struct interface *if_find(struct dhcpcd_ctx *ctx, const char *name) {
  return if_findindexname(ctx, 0, name);
}


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

x86 assembly (clang, -O2):
<if_find>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <if_findindexname@plt>

LLVM IR (-O0):
%struct.interface = type { i32 }
%struct.dhcpcd_ctx = type { i32 }
define %struct.interface* @if_find(%struct.dhcpcd_ctx* %0, i8* %1) {
%3 = alloca %struct.dhcpcd_ctx*
%4 = alloca i8*
store %struct.dhcpcd_ctx* %0, %struct.dhcpcd_ctx** %3
store i8* %1, i8** %4
%5 = load %struct.dhcpcd_ctx*, %struct.dhcpcd_ctx** %3
%6 = load i8*, i8** %4
%7 = call %struct.interface* @if_findindexname(%struct.dhcpcd_ctx* %5, i32 0, i8* %6)
ret %struct.interface* %7
}

LLVM IR (-O2):
%struct.interface = type { i32 }
%struct.dhcpcd_ctx = type { i32 }
define %struct.interface* @if_find(%struct.dhcpcd_ctx* %0, i8* %1) {
%3 = tail call %struct.interface* @if_findindexname(%struct.dhcpcd_ctx* %0, i32 0, i8* %1)
ret %struct.interface* %3
}
int test_model() {
  do {
    ;
    return 0;
  } while (0);
}


x86 assembly (clang, -O0):
<test_model>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <test_model+0x9>
jmp    110e <test_model+0xe>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_model() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @test_model() {
ret i32 0
}
int trans_7_y(int x, int y) { return -y; }


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

x86 assembly (clang, -O2):
<trans_7_y>:
mov    %esi,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @trans_7_y(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
ret i32 %3
}
int test_imm_5Fuint8_reg(unsigned char val) {
  return ((val) & (-0x5F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Fuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffa1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Fuint8_reg>:
test   $0xa1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Fuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -95
%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_5Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -95
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void pinconf_free_setting(struct pinctrl_setting const *setting) {}


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

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

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

LLVM IR (-O2):
%struct.pinctrl_setting = type opaque
define void @pinconf_free_setting(%struct.pinctrl_setting* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ getc(int /*<<< orphan*/ *);
uint32_t getGawbleBE(FILE *s) {
  uint32_t v;
  v = (uint32_t)getc(s) << 24;
  v |= (uint32_t)getc(s) << 16;
  v |= (uint32_t)getc(s) << 8;
  v |= (uint32_t)getc(s);
  return v;
}


x86 assembly (clang, -O0):
<getGawbleBE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGawbleBE>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <getc@plt>
mov    %rax,%r15
shl    $0x18,%r15d
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%rbx
shl    $0x10,%ebx
or     %r15d,%ebx
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%r15
shl    $0x8,%r15d
mov    %r14,%rdi
call   1030 <getc@plt>
or     %r15d,%eax
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @getGawbleBE(i32* nocapture %0) {
%2 = tail call i64 @getc(i32* %0)
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = tail call i64 @getc(i32* %0)
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = tail call i64 @getc(i32* %0)
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = tail call i64 @getc(i32* %0)
%14 = trunc i64 %13 to i32
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
double sin(double const);
double cos_gradient(const double x) { return -sin(x); }


x86 assembly (clang, -O0):
<cos_gradient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_gradient>:
push   %rax
call   1030 <sin@plt>
xorps  0xee3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cos_gradient(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = fneg double %4
ret double %5
}

LLVM IR (-O2):
define double @cos_gradient(double %0) {
%2 = tail call double @sin(double %0)
%3 = fneg double %2
ret double %3
}
/* Type definitions */
typedef size_t uint32_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_setzero_si128();
void MM_clear_mem(__m128i *memloc, uint32_t size) {
  uint32_t i;
  for (i = 0; i < size; i++)
    memloc[i] = _mm_setzero_si128();
}


x86 assembly (clang, -O0):
<MM_clear_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115b <MM_clear_mem+0x4b>
mov    $0x0,%al
call   1030 <_mm_setzero_si128@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <MM_clear_mem+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MM_clear_mem>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1144 <MM_clear_mem+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <_mm_setzero_si128@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <MM_clear_mem+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @MM_clear_mem(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %15, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = call i32 (...) @_mm_setzero_si128()
%12 = load i32*, i32** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32 %11, i32* %14
br label %15
15: ; preds = %10
%16 = load i64, i64* %5
%17 = add i64 %16, 1
store i64 %17, i64* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @MM_clear_mem(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = tail call i32 (...) @_mm_setzero_si128()
%7 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %6, i32* %7
%8 = add nuw i64 %5, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
int main(void) {
  char local_var = 42;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x04() {
  Assert_real((isalnum(4) == 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_isalnum.c",
              25, ("isalnum should be 0 for 0x04"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x04>:
push   %rax
mov    $0x4,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x19,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x04\00"
define void @t_isalnum_0x04() {
%1 = call i64 @isalnum(i32 4)
%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 25, i8* getelementptr inbounds ([29 x i8], [29 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x04\00"
define void @t_isalnum_0x04() {
%1 = tail call i64 @isalnum(i32 4)
%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 25, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t Count1s(uint64_t LongWord) {
  return Count1s((uint32_t)LongWord) + Count1s((uint32_t)(LongWord >> 32));
}


x86 assembly (clang, -O0):
<Count1s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Count1s@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <Count1s@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Count1s>:
push   %rax
call   1030 <Count1s@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <Count1s+0x10>

LLVM IR (-O0):
define i64 @Count1s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @Count1s(i32 %3)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 32
%7 = call i64 @Count1s(i32 %6)
%8 = add nsw i64 %4, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @Count1s(i32 %0) {
%2 = tail call i64 @Count1s(i32 %0)
br label %3
3: ; preds = %3, %1
br label %3
}
/* Variables and functions */
int ASM(char *);
int getchr() {
  while (!(ASM(" IN   (IN_STATUS), RU") & 0x01))
    ;
  ASM("IN   (IN_RX_DATA), RU");
}


x86 assembly (clang, -O0):
<getchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ASM@plt>
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113c <getchr+0x2c>
jmp    1141 <getchr+0x31>
jmp    1118 <getchr+0x8>
lea    0xece(%rip),%rdi
call   1030 <ASM@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchr>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <ASM@plt>
test   $0x1,%al
je     1120 <getchr+0x10>
lea    0xee3(%rip),%rdi
pop    %rbx
jmp    1030 <ASM@plt>

LLVM IR (-O0):
@.str = [22 x i8] c" IN (IN_STATUS), RU\00"
@.str.1 = [22 x i8] c"IN (IN_RX_DATA), RU\00"
define i32 @getchr() {
%1 = alloca i32
br label %2
2: ; preds = %7, %0
%3 = call i32 @ASM(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %2
br label %2
8: ; preds = %2
%9 = call i32 @ASM(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [22 x i8] c" IN (IN_STATUS), RU\00"
@.str.1 = [22 x i8] c"IN (IN_RX_DATA), RU\00"
define i32 @getchr() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @ASM(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call i32 @ASM(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test(void) {
  printf("%llu01233456789012334567890123345678901233456789012334567890123345678"
         "901233456789012334567890123345678901233456789012334567890123345678901"
         "233456789");
}


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

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

LLVM IR (-O0):
@.str = [148 x i8] c"%llu01233456789012334567890123345678901233456789012334567890123345678901233456789012334567890123345678901233456789012334567890123345678901233456789\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [148 x i8] c"%llu01233456789012334567890123345678901233456789012334567890123345678901233456789012334567890123345678901233456789012334567890123345678901233456789\00"
define void @test() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct mdea_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_number_node_get_object(void *p, struct mdea_object **object,
                                char **error) {
  mdea_error(error, "Expected object, got number");
  return -1;
}


x86 assembly (clang, -O0):
<mdea_number_node_get_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdea_number_node_get_object>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdea_object = type { i32 }
@.str = [28 x i8] c"Expected object, got number\00"
define i32 @mdea_number_node_get_object(i8* %0, %struct.mdea_object** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca %struct.mdea_object**
%6 = alloca i8**
store i8* %0, i8** %4
store %struct.mdea_object** %1, %struct.mdea_object*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.mdea_object = type { i32 }
@.str = [28 x i8] c"Expected object, got number\00"
define i32 @mdea_number_node_get_object(i8* nocapture readnone %0, %struct.mdea_object** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int is_prime(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main() {
  char str[100];
  fgets(str, 100, stdin);
  printf("%d", is_prime(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
lea    -0x70(%rbp),%rdi
call   1050 <is_prime@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <is_prime@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 100, i32 %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @is_prime(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 100, i32 %3)
%5 = call i32 @is_prime(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int gzclose(void *);
int xgzclose(void *cookie) { return gzclose(cookie); }


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

x86 assembly (clang, -O2):
<xgzclose>:
jmp    1030 <gzclose@plt>

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

LLVM IR (-O2):
define i32 @xgzclose(i8* %0) {
%2 = tail call i32 @gzclose(i8* %0)
ret i32 %2
}
int white(int c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<white>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <white+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<white>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @white(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ func2();
int /*<<< orphan*/ printf(char *, int);
void func1() {
  int i = 5;
  printf("\t[in func1] i = %d\n", i);
  func2();
  printf("\t[back in func1] i = %d\n", i);
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <func2@plt>
mov    -0x4(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <func2@plt>
lea    0xed4(%rip),%rdi
mov    $0x5,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\09[in func1] i = %d\0A\00"
@.str.1 = [25 x i8] c"\09[back in func1] i = %d\0A\00"
define void @func1() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @func2()
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\09[in func1] i = %d\0A\00"
@.str.1 = [25 x i8] c"\09[back in func1] i = %d\0A\00"
define void @func1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 (...) @func2()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_clear_dobldobl_data(void) {
  int fail;
  int precision = 1;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(864, &precision, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_clear_dobldobl_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x8(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x360,%edi
lea    -0x8(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_clear_dobldobl_data>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x360,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_clear_dobldobl_data() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca double*
store i32 1, i32* %2
%5 = load i32*, i32** %3
%6 = load double*, double** %4
%7 = call i32 @_ada_use_c2phc4c(i32 864, i32* %2, i32* %5, double* %6, i32 0)
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @padcon_clear_dobldobl_data() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @_ada_use_c2phc4c(i32 864, i32* %1, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ reverseLenWords(char *, size_t);
size_t strlen(char *);
void reverseWords(char *s) {
  size_t len = strlen(s);
  reverseLenWords(s, len);
}


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

x86 assembly (clang, -O2):
<reverseWords>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <reverseLenWords@plt>

LLVM IR (-O0):
define void @reverseWords(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call i32 @reverseLenWords(i8* %6, i64 %7)
ret void
}

LLVM IR (-O2):
define void @reverseWords(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 @reverseLenWords(i8* %0, i64 %2)
ret void
}
/* Type definitions */
struct cheat_test_suite {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cheat_test_assert(struct cheat_test_suite *,
                                     int /*<<< orphan*/, char *, char *, int);
void test_failure(struct cheat_test_suite *suite) {
  cheat_test_assert(
      suite, 0, "0",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/Tordek/cheat/refs/heads/master/sampletest.c",
      38);
}


x86 assembly (clang, -O0):
<test_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
lea    0xed7(%rip),%rdx
lea    0xed2(%rip),%rcx
mov    $0x26,%r8d
call   1030 <cheat_test_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_failure>:
lea    0xee9(%rip),%rdx
lea    0xee4(%rip),%rcx
xor    %esi,%esi
mov    $0x26,%r8d
jmp    1030 <cheat_test_assert@plt>

LLVM IR (-O0):
%struct.cheat_test_suite = type { i32 }
@.str = [2 x i8] c"0\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tordek/cheat/refs/heads/master/sampletest.c\00"
define void @test_failure(%struct.cheat_test_suite* %0) {
%2 = alloca %struct.cheat_test_suite*
store %struct.cheat_test_suite* %0, %struct.cheat_test_suite** %2
%3 = load %struct.cheat_test_suite*, %struct.cheat_test_suite** %2
%4 = call i32 @cheat_test_assert(%struct.cheat_test_suite* %3, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 38)
ret void
}

LLVM IR (-O2):
%struct.cheat_test_suite = type { i32 }
@.str = [2 x i8] c"0\00"
@.str.1 = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tordek/cheat/refs/heads/master/sampletest.c\00"
define void @test_failure(%struct.cheat_test_suite* %0) {
%2 = tail call i32 @cheat_test_assert(%struct.cheat_test_suite* %0, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.1, i64 0, i64 0), i32 38)
ret void
}
double yn(int n, double x) { return 0.0; }


x86 assembly (clang, -O0):
<yn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<yn>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @yn(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @yn(i32 %0, double %1) {
ret double 0.000000e+00
}
const char *vdeFun_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  case 2:
    return "i2";
  case 3:
    return "i3";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<vdeFun_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     116c <vdeFun_name_in+0x6c>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vdeFun_name_in+0x74>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vdeFun_name_in+0x74>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vdeFun_name_in+0x74>
lea    0xeb6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vdeFun_name_in+0x74>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdeFun_name_in>:
cmp    $0x3,%edi
ja     1117 <vdeFun_name_in+0x17>
movslq %edi,%rax
lea    0xefd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
@.str.2 = [3 x i8] c"i2\00"
@.str.3 = [3 x i8] c"i3\00"
define i8* @vdeFun_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* null, i8** %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
@.str.2 = [3 x i8] c"i2\00"
@.str.3 = [3 x i8] c"i3\00"
@reltable.vdeFun_name_in = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.vdeFun_name_in to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.vdeFun_name_in to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.vdeFun_name_in to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.vdeFun_name_in to i64)) to i32)]
define i8* @vdeFun_name_in(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.vdeFun_name_in to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %8
}
float angnorm(float ang) {
  int scale;
  if (ang < 0) {
    scale = (int)(ang / 360. - 1);
  } else {
    scale = (int)(ang / 360.);
  }
  ang = ang - scale * 360.;
  return (ang);
}


x86 assembly (clang, -O0):
<angnorm>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1143 <angnorm+0x43>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    115f <angnorm+0x5f>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeac(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe74(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<angnorm>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
movaps %xmm0,%xmm2
divsd  %xmm1,%xmm2
jbe    1123 <angnorm+0x23>
addsd  0xee5(%rip),%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @angnorm(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fdiv double %8, 3.600000e+02
%10 = fsub double %9, 1.000000e+00
%11 = fptosi double %10 to i32
store i32 %11, i32* %3
br label %17
12: ; preds = %1
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = fdiv double %14, 3.600000e+02
%16 = fptosi double %15 to i32
store i32 %16, i32* %3
br label %17
17: ; preds = %12, %6
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to double
%22 = fneg double %21
%23 = call double @llvm.fmuladd.f64(double %22, double 3.600000e+02, double %19)
%24 = fptrunc double %23 to float
store float %24, float* %2
%25 = load float, float* %2
ret float %25
}

LLVM IR (-O2):
define float @angnorm(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fpext float %0 to double
%4 = fdiv double %3, 3.600000e+02
%5 = fadd double %4, -1.000000e+00
%6 = select i1 %2, double %5, double %4
%7 = fptosi double %6 to i32
%8 = sitofp i32 %7 to double
%9 = fneg double %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double 3.600000e+02, double %3)
%11 = fptrunc double %10 to float
ret float %11
}
void comm_mpi_finalise(void) {}


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

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

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

LLVM IR (-O2):
define void @comm_mpi_finalise() {
ret void
}
int neiinm1(int a) { return -(a != -1); }


x86 assembly (clang, -O0):
<neiinm1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neiinm1>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @neiinm1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @neiinm1(i32 %0) {
%2 = icmp ne i32 %0, -1
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ camserv_log(char *, char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
void shm_dest(int shmid) {
  if (shmctl(shmid, IPC_RMID, NULL) == -1) {
    camserv_log("shm", "Unable to destroy shared memory segment");
    return;
  }
}


x86 assembly (clang, -O0):
<shm_dest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    115c <shm_dest+0x3c>
lea    0xeb0(%rip),%rdi
lea    0xead(%rip),%rsi
call   1030 <camserv_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_dest>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
je     1138 <shm_dest+0x18>
pop    %rax
ret
lea    0xec1(%rip),%rdi
lea    0xebe(%rip),%rsi
pop    %rax
jmp    1030 <camserv_log@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [4 x i8] c"shm\00"
@.str.1 = [40 x i8] c"Unable to destroy shared memory segment\00"
define void @shm_dest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @shmctl(i32 %3, i32 %4, i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @camserv_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [4 x i8] c"shm\00"
@.str.1 = [40 x i8] c"Unable to destroy shared memory segment\00"
define void @shm_dest(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @shmctl(i32 %0, i32 %2, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @camserv_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_call(int, int /*<<< orphan*/, int /*<<< orphan*/);
void echoShellOFF() { sys_call(6, 0, 0); }


x86 assembly (clang, -O0):
<echoShellOFF>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<echoShellOFF>:
mov    $0x6,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define void @echoShellOFF() {
%1 = call i32 @sys_call(i32 6, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @echoShellOFF() {
%1 = tail call i32 @sys_call(i32 6, i32 0, i32 0)
ret void
}
void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) {
  __asm__ __volatile__("cpuid"
                       : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
                       : "a"(op)
                       : "cc");
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x40(%rbp),%rax
mov    %ecx,%esi
mov    -0x38(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
push   %rbx
mov    %rcx,%r9
mov    %rdx,%r10
mov    %edi,%eax
cpuid
mov    %eax,(%rsi)
mov    %ebx,(%r10)
mov    %ecx,(%r9)
mov    %edx,(%r8)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32, i32* %6
%16 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %15)
%17 = extractvalue { i32, i32, i32, i32 } %16, 0
%18 = extractvalue { i32, i32, i32, i32 } %16, 1
%19 = extractvalue { i32, i32, i32, i32 } %16, 2
%20 = extractvalue { i32, i32, i32, i32 } %16, 3
store i32 %17, i32* %11
store i32 %18, i32* %12
store i32 %19, i32* %13
store i32 %20, i32* %14
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
ret void
}
void pm8921_charger_vbus_draw(unsigned int mA) {}


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

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

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

LLVM IR (-O2):
define void @pm8921_charger_vbus_draw(i32 %0) {
ret void
}
void TIM1_CC_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM1_CC_IRQHandler() {
ret void
}
int memcompare(unsigned char *buf1, unsigned char *buf2, unsigned int size) {
  unsigned int i;
  i = 0;
  while (i < size) {
    if (buf1[i] != buf2[i]) {
      return 0;
    }
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<memcompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    115a <memcompare+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%edx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114c <memcompare+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1161 <memcompare+0x61>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <memcompare+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcompare>:
mov    $0x1,%eax
test   %edx,%edx
je     1122 <memcompare+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <memcompare+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <memcompare+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @memcompare(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
int goose() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @goose() {
ret i32 0
}
/* Variables and functions */
int ERANGE;
int INT_MAX;
int INT_MIN;
int rf_neg(int *z, int x) {
  if (-INT_MAX != INT_MIN && x == INT_MIN)
    return ERANGE;
  *z = -x;
  return 0;
}


x86 assembly (clang, -O0):
<rf_neg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %eax,%eax
mov    0x2ed4(%rip),%rcx
sub    (%rcx),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
je     1148 <rf_neg+0x48>
mov    -0x14(%rbp),%eax
mov    0x2eb1(%rip),%rcx
cmp    (%rcx),%eax
jne    1148 <rf_neg+0x48>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <rf_neg+0x5a>
xor    %ecx,%ecx
sub    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rf_neg>:
mov    0x2ee1(%rip),%rcx
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
mov    (%rcx),%ecx
add    %eax,%ecx
je     1124 <rf_neg+0x24>
cmp    %esi,%eax
jne    1124 <rf_neg+0x24>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
ret
neg    %esi
mov    %esi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@ERANGE = global i32 0
define i32 @rf_neg(i32* nocapture writeonly %0, i32 %1) {
%3 = load i32, i32* @INT_MAX
%4 = sub nsw i32 0, %3
%5 = load i32, i32* @INT_MIN
%6 = icmp ne i32 %5, %4
%7 = icmp eq i32 %5, %1
%8 = and i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* @ERANGE
br label %13
11: ; preds = %2
%12 = sub nsw i32 0, %1
store i32 %12, i32* %0
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ 0, %11 ]
ret i32 %14
}