xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int standard_Newton_Laurent_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(326, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<standard_Newton_Laurent_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x146,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_Newton_Laurent_step>:
mov    $0x146,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @standard_Newton_Laurent_step() {
%1 = tail call i32 @_ada_use_c2phc(i32 326, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ *opendir(char const *);
int is_dir_exist(const char *dir_path) {
  if (NULL == dir_path)
    return -1;
  if (opendir(dir_path) == NULL)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<is_dir_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1134 <is_dir_exist+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <is_dir_exist+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
cmp    $0x0,%rax
jne    1153 <is_dir_exist+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <is_dir_exist+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir_exist>:
test   %rdi,%rdi
je     1126 <is_dir_exist+0x16>
push   %rax
call   1030 <opendir@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @is_dir_exist(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32* @opendir(i8* %0)
%5 = icmp eq i32* %4, null
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %8
}
void sws_init_context() {}


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

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

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

LLVM IR (-O2):
define void @sws_init_context() {
ret void
}
/* Variables and functions */
int getVoltage0Reading();
int /*<<< orphan*/ printf(char *, int);
int main() {
  while (true) {
    int voltage = getVoltage0Reading();
    printf("voltage: %d", voltage);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getVoltage0Reading@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getVoltage0Reading@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"voltage: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @getVoltage0Reading()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %3
}

LLVM IR (-O2):
@.str = [12 x i8] c"voltage: %d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @getVoltage0Reading()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %1
}
int search(int val, short *table, int size) {
  int i;
  for (i = 0; i < size; i++) {
    if (val <= *table++)
      return (i);
  }
  return (size);
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115c <search+0x5c>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x2,%rdx
mov    %rdx,-0x10(%rbp)
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1149 <search+0x49>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <search+0x62>
jmp    114e <search+0x4e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <search+0x15>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %edx,%eax
test   %edx,%edx
jle    1120 <search+0x20>
mov    %eax,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movswl (%rsi,%rcx,2),%edx
cmp    %edi,%edx
jge    1121 <search+0x21>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <search+0x10>
ret
mov    %ecx,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ WEOF;
wint_t fgetwc(FILE *stream) {
  ;
  return WEOF;
}


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

x86 assembly (clang, -O2):
<fgetwc>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@WEOF = global i32 0
define i32 @fgetwc(i32* nocapture readnone %0) {
%2 = load i32, i32* @WEOF
ret i32 %2
}
unsigned xrop3_171_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_171_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_171_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_171_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_171_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %4, %5
%8 = or i32 %7, %6
%9 = xor i32 %8, -1
%10 = or i8 %1, %0
%11 = zext i8 %10 to i32
%12 = or i32 %11, %9
ret i32 %12
}
int foo() {
  int i;
  int a = 2;
  while (a) {
    a *= 3;
    a += 5;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112a <foo+0x2a>
imul   $0x3,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <foo+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Variables and functions */
void free(void *);
void mbr_free(void *p) { return free(p); }


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

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

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

LLVM IR (-O2):
define void @mbr_free(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
void logbuf_open(void) {}


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

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

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

LLVM IR (-O2):
define void @logbuf_open() {
ret void
}
/* Variables and functions */
scalar_t__ _jwArr();
int /*<<< orphan*/ jwPutstr(char *);
void jwArr_string(char *value) {
  if (_jwArr() == 0)
    jwPutstr(value);
}


x86 assembly (clang, -O0):
<jwArr_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <_jwArr@plt>
cmp    $0x0,%rax
jne    1146 <jwArr_string+0x26>
mov    -0x8(%rbp),%rdi
call   1030 <jwPutstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jwArr_string>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <_jwArr@plt>
test   %rax,%rax
je     1132 <jwArr_string+0x12>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <jwPutstr@plt>

LLVM IR (-O0):
define void @jwArr_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @_jwArr()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @jwPutstr(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @jwArr_string(i8* %0) {
%2 = tail call i64 (...) @_jwArr()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @jwPutstr(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
int xdddefault_initialize_downtime_data(char *main_config_file) {}


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

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

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

LLVM IR (-O2):
define i32 @xdddefault_initialize_downtime_data(i8* nocapture readnone %0) {
ret i32 undef
}
int q2(void) { return 77; }


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

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

LLVM IR (-O0):
define i32 @q2() {
ret i32 77
}

LLVM IR (-O2):
define i32 @q2() {
ret i32 77
}
/* Variables and functions */
int /*<<< orphan*/ sed_insert_append(int /*<<< orphan*/, int, int, int, char *);
void sed_insert(int fd, int start, int end, char *txt) {
  sed_insert_append(0, fd, start, end, txt);
}


x86 assembly (clang, -O0):
<sed_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %edi,%edi
call   1030 <sed_insert_append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sed_insert>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <sed_insert_append@plt>

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

LLVM IR (-O2):
define void @sed_insert(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @sed_insert_append(i32 0, i32 %0, i32 %1, i32 %2, i8* %3)
ret void
}
extern int TakeAFloat(float x) {
  if (4.2 - x < 0.001)
    return 5;
  return 0;
}


x86 assembly (clang, -O0):
<TakeAFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    113c <TakeAFloat+0x3c>
movl   $0x5,-0x4(%rbp)
jmp    1143 <TakeAFloat+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeAFloat>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    (%rax,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @TakeAFloat(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fsub double 4.200000e+00, %5
%7 = fcmp olt double %6, 1.000000e-03
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 5, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @TakeAFloat(float %0) {
%2 = fpext float %0 to double
%3 = fsub double 4.200000e+00, %2
%4 = fcmp olt double %3, 1.000000e-03
%5 = select i1 %4, i32 5, i32 0
ret i32 %5
}
void __dummyEjsTrace() {}


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

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

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

LLVM IR (-O2):
define void @__dummyEjsTrace() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void mj_println(int i) { printf("%d\n", i); }


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

x86 assembly (clang, -O2):
<mj_println>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @mj_println(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getBracketParam();
void ignoreBracketParam(void) {
  char *p = getBracketParam();
  if (NULL != p)
    free(p);
}


x86 assembly (clang, -O0):
<ignoreBracketParam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getBracketParam@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1148 <ignoreBracketParam+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoreBracketParam>:
push   %rax
xor    %eax,%eax
call   1040 <getBracketParam@plt>
test   %rax,%rax
je     1136 <ignoreBracketParam+0x16>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ignoreBracketParam() {
%1 = alloca i8*
%2 = call i8* (...) @getBracketParam()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* null, %3
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @ignoreBracketParam() {
%1 = tail call i8* (...) @getBracketParam()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @free(i8* %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ warn_no_adios();
void adios_setup_(void) { warn_no_adios(); }


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

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

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

LLVM IR (-O2):
define void @adios_setup_() {
%1 = tail call i32 (...) @warn_no_adios()
ret void
}
void XtAppPending() {}


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

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

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

LLVM IR (-O2):
define void @XtAppPending() {
ret void
}
int fn2(int p1, short p2) { return p2 ? p1 % p2 : 0; }


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
cmp    $0x0,%eax
je     112d <fn2+0x2d>
mov    -0x4(%rbp),%eax
movswl -0x6(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
jmp    1137 <fn2+0x37>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <fn2+0x37>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
test   %si,%si
je     1110 <fn2+0x10>
movswl %si,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fn2(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i16, i16* %4
%11 = sext i16 %10 to i32
%12 = srem i32 %9, %11
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %8
%15 = phi i32 [ %12, %8 ], [ 0, %13 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i16 signext %1) {
%3 = icmp eq i16 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sext i16 %1 to i32
%6 = srem i32 %0, %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 0, %2 ]
ret i32 %8
}
void mwte_fft_in_place_fft_test(int size) {}


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

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

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

LLVM IR (-O2):
define void @mwte_fft_in_place_fft_test(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char swapshift(char);
void swslastone(const char *pw, char *ret) {
  strcpy(ret, pw);
  int n = strlen(ret);
  ret[n - 1] = swapshift(ret[n - 1]);
}


x86 assembly (clang, -O0):
<swslastone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <swapshift@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swslastone>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movslq %eax,%r14
movsbl -0x1(%r14,%rbx,1),%edi
call   1050 <swapshift@plt>
mov    %al,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @swslastone(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = call signext i8 @swapshift(i8 signext %16)
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
store i8 %17, i8* %22
ret void
}

LLVM IR (-O2):
define void @swslastone(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = tail call signext i8 @swapshift(i8 signext %8)
store i8 %9, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hypre_OutOfMemory(int);
char *malloc(int);
char *hypre_MAlloc(int size) {
  char *ptr;
  if (size > 0) {
    ptr = malloc(size);
    if (ptr == NULL) {
      hypre_OutOfMemory(size);
    }
  } else {
    ptr = NULL;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<hypre_MAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1159 <hypre_MAlloc+0x39>
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <hypre_MAlloc+0x34>
mov    -0x4(%rbp),%edi
call   1040 <hypre_OutOfMemory@plt>
jmp    1161 <hypre_MAlloc+0x41>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypre_MAlloc>:
push   %rbx
test   %edi,%edi
jle    113a <hypre_MAlloc+0x1a>
mov    %edi,%ebx
call   1030 <malloc@plt>
test   %rax,%rax
je     1133 <hypre_MAlloc+0x13>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <hypre_OutOfMemory@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @hypre_MAlloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i32, i32* %2
%13 = call i32 @hypre_OutOfMemory(i32 %12)
br label %14
14: ; preds = %11, %6
br label %16
15: ; preds = %1
store i8* null, i8** %3
br label %16
16: ; preds = %15, %14
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @hypre_MAlloc(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = tail call i8* @malloc(i32 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @hypre_OutOfMemory(i32 %0)
br label %8
8: ; preds = %1, %3, %6
%9 = phi i8* [ null, %6 ], [ %4, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
__attribute__((weak)) void e_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define weak void @e_free(i8* %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ erase_screen(int);
int /*<<< orphan*/ set_column(int /*<<< orphan*/);
int /*<<< orphan*/ set_row(int);
void erase_module_screen(void) {
  set_row(4);
  set_column(0);
  erase_screen(2 * 84);
}


x86 assembly (clang, -O0):
<erase_module_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1040 <set_row@plt>
xor    %edi,%edi
call   1030 <set_column@plt>
mov    $0xa8,%edi
call   1050 <erase_screen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_module_screen>:
push   %rax
mov    $0x4,%edi
call   1040 <set_row@plt>
xor    %edi,%edi
call   1030 <set_column@plt>
mov    $0xa8,%edi
pop    %rax
jmp    1050 <erase_screen@plt>

LLVM IR (-O0):
define void @erase_module_screen() {
%1 = call i32 @set_row(i32 4)
%2 = call i32 @set_column(i32 0)
%3 = call i32 @erase_screen(i32 168)
ret void
}

LLVM IR (-O2):
define void @erase_module_screen() {
%1 = tail call i32 @set_row(i32 4)
%2 = tail call i32 @set_column(i32 0)
%3 = tail call i32 @erase_screen(i32 168)
ret void
}
adrreg0adrx1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[10000000]) = (((int *)11111111)[x1]); }


x86 assembly (clang, -O0):
<adrreg0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x2625a00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adrx1_set>:
movslq %ecx,%rax
mov    0xa98ac7(,%rax,4),%eax
mov    %eax,0x2625a00(%r8)
ret

LLVM IR (-O0):
define i32 @adrreg0adrx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %12
%19 = getelementptr inbounds i32, i32* %18, i64 10000000
store i32 %17, i32* %19
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adrreg0adrx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %4, i64 10000000
store i32 %9, i32* %10
ret i32 undef
}
void init_rts_alloc() {}


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

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

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

LLVM IR (-O2):
define void @init_rts_alloc() {
ret void
}
adrx0adr1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((((short *)10000000)[x0]) <= (*((short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movswl (%rax,%rcx,2),%eax
mov    $0xa98ac7,%ecx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1148 <adrx0adr1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <adrx0adr1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adr1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @adrx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = load i16, i16* inttoptr (i64 11111111 to i16*)
%22 = sext i16 %21 to i32
%23 = icmp sle i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @adrx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = load i16, i16* inttoptr (i64 11111111 to i16*)
%11 = icmp sle i16 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Hi,Hi\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"Hi,Hi\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_signal_segfault(void) {
  volatile struct { int x; } *ptr = 0x0;
  ptr->x = 42;
  return 0;
}


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

x86 assembly (clang, -O2):
<test_signal_segfault>:
movl   $0x2a,0x0
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @test_signal_segfault() {
%1 = alloca %struct.anon*
store %struct.anon* null, %struct.anon** %1
%2 = load %struct.anon*, %struct.anon** %1
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store volatile i32 42, i32* %3
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type { i32 }
define i32 @test_signal_segfault() {
store volatile i32 42, i32* null
ret i32 0
}
void _start(void) {
  asm("movl $1,%eax;"
      "xorl %ebx,%ebx;"
      "int $0x80");
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
xor    %ebx,%ebx
int    $0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
mov    $0x1,%eax
xor    %ebx,%ebx
int    $0x80
ret

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

LLVM IR (-O2):
define void @_start() {
tail call void asm sideeffect "movl $$1,%eax;xorl %ebx,%ebx;int $$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
int getchar_unlocked();
int readchar(void) {
  int c = getchar_unlocked();
  if (c == EOF) {
    exit(1);
  }
  return c;
}


x86 assembly (clang, -O0):
<readchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar_unlocked@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
jne    114e <readchar+0x2e>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readchar>:
push   %rax
xor    %eax,%eax
call   1030 <getchar_unlocked@plt>
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%eax
je     1135 <readchar+0x15>
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @readchar() {
%1 = alloca i32
%2 = call i32 (...) @getchar_unlocked()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @readchar() {
%1 = tail call i32 (...) @getchar_unlocked()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x89() {
  Assert_real((ispunct(137) == 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",
              690, ("ispunct should be 0 for 0x89"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x89>:
push   %rax
mov    $0x89,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b2,%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 = [29 x i8] c"ispunct should be 0 for 0x89\00"
define void @t_ispunct_0x89() {
%1 = call i64 @ispunct(i32 137)
%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 690, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x89\00"
define void @t_ispunct_0x89() {
%1 = tail call i64 @ispunct(i32 137)
%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 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BSP_UART_SendCongestionString(int /*<<< orphan*/, char *);
void HaltSwi(void) {
  BSP_UART_SendCongestionString(0, "SWI exception!!!\n\0");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<HaltSwi>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <BSP_UART_SendCongestionString@plt>
jmp    1122 <HaltSwi+0x12>

x86 assembly (clang, -O2):
<HaltSwi>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <BSP_UART_SendCongestionString@plt>
nop
jmp    1120 <HaltSwi+0x10>

LLVM IR (-O0):
@.str = [19 x i8] c"SWI exception!!!\0A\00\00"
define void @HaltSwi() {
%1 = call i32 @BSP_UART_SendCongestionString(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [19 x i8] c"SWI exception!!!\0A\00\00"
define void @HaltSwi() {
%1 = tail call i32 @BSP_UART_SendCongestionString(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int fputc(char, int /*<<< orphan*/);
int fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int puts(const char *str) {
  if (-1 == fputs(str, stdout))
    return -1;
  if (-1 == fputc('\n', stdout))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1159 <puts+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <puts+0x6e>
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1187 <puts+0x67>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <puts+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
cmp    $0xffffffff,%eax
je     114e <puts+0x2e>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i8* %4, i32 %5)
%7 = icmp eq i32 -1, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %15
9: ; preds = %1
%10 = load i32, i32* @stdout
%11 = call i32 @fputc(i8 signext 10, i32 %10)
%12 = icmp eq i32 -1, %11
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 -1, i32* %2
br label %15
14: ; preds = %9
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputc(i8 signext 10, i32 %6)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ -1, %1 ], [ %9, %5 ]
ret i32 %11
}
int kputs(const char *s) {
  int len = 0;
  if (s == ((void *)0)) {
    s = "(null)";
  }
  while (*s != '\0') {
    len += kputc(*s);
    s++;
  }
  return len;
}


x86 assembly (clang, -O0):
<kputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1139 <kputs+0x29>
lea    0xecb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    113e <kputs+0x2e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1173 <kputs+0x63>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <kputc@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    113e <kputs+0x2e>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputs>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
lea    0xee3(%rip),%rbx
cmovne %rdi,%rbx
mov    (%rbx),%al
test   %al,%al
je     1149 <kputs+0x39>
add    $0x1,%rbx
xor    %ebp,%ebp
nopl   (%rax)
movsbl %al,%edi
xor    %eax,%eax
call   1030 <kputc@plt>
add    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <kputs+0x20>
jmp    114b <kputs+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"(null)\00"
define i32 @kputs(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %1
br label %8
8: ; preds = %13, %7
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i32, ...) bitcast (i32 (...)* @kputc to i32 (i32, ...)*)(i32 %16)
%18 = load i32, i32* %3
%19 = add nsw i32 %18, %17
store i32 %19, i32* %3
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %8
22: ; preds = %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define i32 @kputs(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1, %6
%7 = phi i8 [ %14, %6 ], [ %4, %1 ]
%8 = phi i32 [ %12, %6 ], [ 0, %1 ]
%9 = phi i8* [ %13, %6 ], [ %3, %1 ]
%10 = sext i8 %7 to i32
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @kputc to i32 (i32, ...)*)(i32 %10)
%12 = add nsw i32 %11, %8
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %1
%17 = phi i32 [ 0, %1 ], [ %12, %6 ]
ret i32 %17
}
void PWM0Fault_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<PWM0Fault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PWM0Fault_Handler+0x9>
jmp    1109 <PWM0Fault_Handler+0x9>

x86 assembly (clang, -O2):
<PWM0Fault_Handler>:
jmp    1100 <PWM0Fault_Handler>

LLVM IR (-O0):
define void @PWM0Fault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PWM0Fault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int flash_read(int);
int /*<<< orphan*/ flash_write(int, int);
int flash_read_status(int offset) {
  flash_write(offset, 0x70);
  return flash_read(offset);
}


x86 assembly (clang, -O0):
<flash_read_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x70,%esi
call   1040 <flash_write@plt>
mov    -0x4(%rbp),%edi
call   1030 <flash_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_read_status>:
push   %rbx
mov    %edi,%ebx
mov    $0x70,%esi
call   1040 <flash_write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <flash_read@plt>

LLVM IR (-O0):
define i32 @flash_read_status(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @flash_write(i32 %3, i32 112)
%5 = load i32, i32* %2
%6 = call i32 @flash_read(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @flash_read_status(i32 %0) {
%2 = tail call i32 @flash_write(i32 %0, i32 112)
%3 = tail call i32 @flash_read(i32 %0)
ret i32 %3
}
void swap(char *i, char *j) {
  char temp = *i;
  *i = *j;
  *j = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
double MtoKM(double M) { return M / 1000; }


x86 assembly (clang, -O0):
<MtoKM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @MtoKM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+03
ret double %4
}

LLVM IR (-O2):
define double @MtoKM(double %0) {
%2 = fdiv double %0, 1.000000e+03
ret double %2
}
const char *statfunc_version(void) {
  return ("statfunc : V1.2 Peter Boesecke 2012-09-13");
}


x86 assembly (clang, -O0):
<statfunc_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<statfunc_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [42 x i8] c"statfunc : V1.2 Peter Boesecke 2012-09-13\00"
define i8* @statfunc_version() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [42 x i8] c"statfunc : V1.2 Peter Boesecke 2012-09-13\00"
define i8* @statfunc_version() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}