xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x70() {
  Assert_real((isupper(112) == 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_isupper.c",
              565, ("isupper should be 0 for p"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x70>:
push   %rax
mov    $0x70,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x235,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for p\00"
define void @t_isupper_0x70() {
%1 = call i64 @isupper(i32 112)
%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 565, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for p\00"
define void @t_isupper_0x70() {
%1 = tail call i64 @isupper(i32 112)
%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 565, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void swap_m2e(int *permutation, int a, int b) {
  int tmp = permutation[a];
  permutation[a] = permutation[b];
  permutation[b] = tmp;
}


x86 assembly (clang, -O0):
<swap_m2e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_m2e>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap_m2e(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
struct cstr_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cstr_appendm(struct cstr_t *, int /*<<< orphan*/,
                                char const *);
int /*<<< orphan*/ strlen(char const *);
void cstr_appendstr(struct cstr_t *v, const char *s) {
  ;
  cstr_appendm(v, strlen(s), s);
  { return; };
}


x86 assembly (clang, -O0):
<cstr_appendstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <cstr_appendm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstr_appendstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cstr_appendm@plt>

LLVM IR (-O0):
%struct.cstr_t = type { i32 }
define void @cstr_appendstr(%struct.cstr_t* %0, i8* %1) {
%3 = alloca %struct.cstr_t*
%4 = alloca i8*
store %struct.cstr_t* %0, %struct.cstr_t** %3
store i8* %1, i8** %4
%5 = load %struct.cstr_t*, %struct.cstr_t** %3
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @cstr_appendm(%struct.cstr_t* %5, i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.cstr_t = type { i32 }
define void @cstr_appendstr(%struct.cstr_t* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @cstr_appendm(%struct.cstr_t* %0, i32 %3, i8* %1)
ret void
}
void gencvt_d_s() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTAvlrGCPtrGetLeft() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
int /*<<< orphan*/ fvec_cpy(float *, float const *, int);
float fvec_median(float *, int);
float *fvec_new(int);
float fvec_median_const(const float *f, int n) {
  float med;
  float *f2 = fvec_new(n);
  fvec_cpy(f2, f, n);
  med = fvec_median(f2, n);
  free(f2);
  return med;
}


x86 assembly (clang, -O0):
<fvec_median_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <fvec_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <fvec_cpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <fvec_median@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvec_median_const>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1060 <fvec_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <fvec_cpy@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <fvec_median@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define float @fvec_median_const(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca float
%6 = alloca float*
store float* %0, float** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = call float* @fvec_new(i32 %7)
store float* %8, float** %6
%9 = load float*, float** %6
%10 = load float*, float** %3
%11 = load i32, i32* %4
%12 = call i32 @fvec_cpy(float* %9, float* %10, i32 %11)
%13 = load float*, float** %6
%14 = load i32, i32* %4
%15 = call float @fvec_median(float* %13, i32 %14)
store float %15, float* %5
%16 = load float*, float** %6
%17 = call i32 @free(float* %16)
%18 = load float, float* %5
ret float %18
}

LLVM IR (-O2):
define float @fvec_median_const(float* %0, i32 %1) {
%3 = tail call float* @fvec_new(i32 %1)
%4 = tail call i32 @fvec_cpy(float* %3, float* %0, i32 %1)
%5 = tail call float @fvec_median(float* %3, i32 %1)
%6 = tail call i32 @free(float* %3)
ret float %5
}
int strcmp(char *str1, char *str2) {
  while (*str1 == *str2) {
    if (*str1 == '\0') {
      return 0;
    }
    str1++;
    str2++;
  }
  return *str1 - *str2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void Eelse(void) { error("Inappropriate #else"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Inappropriate #else\00"
define void @Eelse() {
%1 = call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Inappropriate #else\00"
define void @Eelse() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AlarmToTimerC__0__Alarm__fired();
void TransformAlarmC__1__Alarm__fired(void) {
  AlarmToTimerC__0__Alarm__fired();
}


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

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

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

LLVM IR (-O2):
define void @TransformAlarmC__1__Alarm__fired() {
%1 = tail call i32 (...) @AlarmToTimerC__0__Alarm__fired()
ret void
}
int core_is_hexadecimal(const char character) {
  return (('0' <= character && character <= '9') &&
          ('a' <= character && character <= 'f') &&
          ('A' <= character && character <= 'F'));
}


x86 assembly (clang, -O0):
<core_is_hexadecimal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     1183 <core_is_hexadecimal+0x83>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jg     1183 <core_is_hexadecimal+0x83>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     1183 <core_is_hexadecimal+0x83>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jg     1183 <core_is_hexadecimal+0x83>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     117d <core_is_hexadecimal+0x7d>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @core_is_hexadecimal(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %28
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 97, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 65, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %10, %6, %1
%29 = phi i1 [ false, %14 ], [ false, %10 ], [ false, %6 ], [ false, %1 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @core_is_hexadecimal(i8 signext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *swap_location();
unsigned swap_permitted(void) { return (NULL != swap_location()); }


x86 assembly (clang, -O0):
<swap_permitted>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <swap_location@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap_permitted() {
%1 = call i32* (...) @swap_location()
%2 = icmp ne i32* null, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @swap_permitted() {
%1 = tail call i32* (...) @swap_location()
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ print(int /*<<< orphan*/, int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ reg_read(int);
void scan(void) {
  uint8_t p0, p2;
  p0 = reg_read(0x80);
  p2 = reg_read(0xa0);
  print(p0, 8);
  putchar('.');
  print(p2, 6);
  putchar('\n');
}


x86 assembly (clang, -O0):
<scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80,%edi
call   1040 <reg_read@plt>
mov    %eax,-0x4(%rbp)
mov    $0xa0,%edi
call   1040 <reg_read@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1050 <print@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
mov    $0x6,%esi
call   1050 <print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan>:
push   %rbp
push   %rbx
push   %rax
mov    $0x80,%edi
call   1040 <reg_read@plt>
mov    %eax,%ebx
mov    $0xa0,%edi
call   1040 <reg_read@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x8,%esi
call   1050 <print@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
mov    $0x6,%esi
call   1050 <print@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @scan() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @reg_read(i32 128)
store i32 %3, i32* %1
%4 = call i32 @reg_read(i32 160)
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = call i32 @print(i32 %5, i32 8)
%7 = call i32 @putchar(i8 signext 46)
%8 = load i32, i32* %2
%9 = call i32 @print(i32 %8, i32 6)
%10 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @scan() {
%1 = tail call i32 @reg_read(i32 128)
%2 = tail call i32 @reg_read(i32 160)
%3 = tail call i32 @print(i32 %1, i32 8)
%4 = tail call i32 @putchar(i8 signext 46)
%5 = tail call i32 @print(i32 %2, i32 6)
%6 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int imd_is_string(uint32_t type) { return (type & 0x8000) ? 1 : 0; }


x86 assembly (clang, -O0):
<imd_is_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imd_is_string>:
mov    %edi,%eax
shr    $0xf,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @imd_is_string(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32768
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @imd_is_string(i32 %0) {
%2 = lshr i32 %0, 15
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
int strlen(char *);
void my_pstring(char *s, int maxline) {
  int i, l;
  printf("%s", s);
  l = strlen(s);
  for (i = l; i < maxline; i++)
    putchar(' ');
}


x86 assembly (clang, -O0):
<my_pstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1185 <my_pstring+0x55>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1161 <my_pstring+0x31>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pstring>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xec0(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    %ebx,%eax
jge    116f <my_pstring+0x3f>
sub    %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1160 <my_pstring+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @my_pstring(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
store i32 %11, i32* %5
br label %12
12: ; preds = %18, %2
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = call i32 @putchar(i8 signext 32)
br label %18
18: ; preds = %16
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @my_pstring(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %4, %2 ]
%8 = tail call i32 @putchar(i8 signext 32)
%9 = add i32 %7, 1
%10 = icmp eq i32 %9, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
void holdoff_end(arg) void *arg;
{ new_phase(3); }


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

x86 assembly (clang, -O2):
<holdoff_end>:
mov    $0x3,%edi
xor    %eax,%eax
jmp    1030 <new_phase@plt>

LLVM IR (-O0):
define void @holdoff_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @new_phase to i32 (i32, ...)*)(i32 3)
ret void
}

LLVM IR (-O2):
define void @holdoff_end(i8* nocapture readnone %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @new_phase to i32 (i32, ...)*)(i32 3)
ret void
}
int test_imm_54uint8_mem(unsigned char *val) {
  return ((*val) & (-0x54 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_54uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffffac,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_54uint8_mem>:
testb  $0xac,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_54uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -84
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int override_redirect;
};
struct TYPE_4__ {
  TYPE_1__ xmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmap_override_redirect(void *_p, int _v) {
  ((XEvent *)_p)->xmap.override_redirect = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xmap_override_redirect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xmap_override_redirect>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xmap_override_redirect(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmap_override_redirect(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *fgets(char *, int, int /*<<< orphan*/ *);
char *fgets_or_exit(char *buff, int size, FILE *stream) {
  char *buffer;
  if ((buffer = fgets(buff, size, stream)) == NULL)
    exit(1);
  return buffer;
}


x86 assembly (clang, -O0):
<fgets_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    115b <fgets_or_exit+0x3b>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_or_exit>:
push   %rax
call   1030 <fgets@plt>
test   %rax,%rax
je     112d <fgets_or_exit+0xd>
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i8* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int __vsprintf__(char **, int /*<<< orphan*/, char const *, void *);
int vsprintf(char *buf, const char *fmt, void *vl) {
  return __vsprintf__(&buf, 0, fmt, vl);
}


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

x86 assembly (clang, -O2):
<vsprintf>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <__vsprintf__@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vsprintf(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = call i32 @__vsprintf__(i8** %4, i32 0, i8* %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @vsprintf(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
store i8* %0, i8** %4
%5 = call i32 @__vsprintf__(i8** %4, i32 0, i8* %1, i8* %2)
ret i32 %5
}
/* Variables and functions */
char *nrealloc(char *, size_t);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *mallocstrcpy(char *dest, const char *src) {
  size_t count = strlen(src) + 1;
  dest = nrealloc(dest, count);
  strncpy(dest, src, count);
  return dest;
}


x86 assembly (clang, -O0):
<mallocstrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <nrealloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocstrcpy>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r12
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <nrealloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mallocstrcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %5
%12 = call i8* @nrealloc(i8* %10, i64 %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = call i32 @strncpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @mallocstrcpy(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = tail call i8* @nrealloc(i8* %0, i64 %5)
%7 = tail call i32 @strncpy(i8* %6, i8* %1, i64 %5)
ret i8* %6
}
int test() {
  char s[10240];
  printf("4! == %d\n", fac(4));
  strcpy(s, "abcdefg");
  printf("reserseing s is %s\n", reverse(s));
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2800,%rsp
mov    $0x4,%edi
mov    $0x0,%al
call   1050 <fac@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x2800(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x2800(%rbp),%rdi
mov    $0x0,%al
call   1030 <reverse@plt>
mov    %eax,%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x2800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x2808,%rsp
mov    $0x4,%edi
xor    %eax,%eax
call   1040 <fac@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movabs $0x67666564636261,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <reverse@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x2808,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"4! == %d\0A\00"
@.str.1 = [8 x i8] c"abcdefg\00"
@.str.2 = [20 x i8] c"reserseing s is %s\0A\00"
define i32 @test() {
%1 = alloca [10240 x i8]
%2 = call i32 (i32, ...) bitcast (i32 (...)* @fac to i32 (i32, ...)*)(i32 4)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = getelementptr inbounds [10240 x i8], [10240 x i8]* %1, i64 0, i64 0
%5 = call i8* @strcpy(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [10240 x i8], [10240 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @reverse to i32 (i8*, ...)*)(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"4! == %d\0A\00"
@.str.2 = [20 x i8] c"reserseing s is %s\0A\00"
define i32 @test() {
%1 = alloca [10240 x i8]
%2 = getelementptr inbounds [10240 x i8], [10240 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @fac to i32 (i32, ...)*)(i32 4)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = bitcast [10240 x i8]* %1 to i64*
store i64 29104508263162465, i64* %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @reverse to i32 (i8*, ...)*)(i8* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fz_traceendmask(void *user) { printf("</mask>\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"</mask>\00"
define void @fz_traceendmask(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysCtlPWMClockSet(uint32_t ui32Config) {

  ;
  ;
  (*((volatile uint32_t *)(0x400FE060))) =
      (((*((volatile uint32_t *)(0x400FE060))) & ~(0x00100000 | 0x000E0000)) |
       ui32Config);
}


x86 assembly (clang, -O0):
<SysCtlPWMClockSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x400fe060,%eax
mov    (%rax),%ecx
and    $0xffe1ffff,%ecx
or     -0x4(%rbp),%ecx
mov    $0x400fe060,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPWMClockSet>:
mov    $0xffe1ffff,%eax
and    0x400fe060,%eax
or     %edi,%eax
mov    %eax,0x400fe060
ret

LLVM IR (-O0):
define void @SysCtlPWMClockSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%4 = and i32 %3, -1966081
%5 = load i32, i32* %2
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 1074782304 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlPWMClockSet(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%3 = and i32 %2, -1966081
%4 = or i32 %3, %0
store volatile i32 %4, i32* inttoptr (i64 1074782304 to i32*)
ret void
}
/* Variables and functions */
int anetSetTcpNoDelay(char *, int, int);
int anetEnableTcpNoDelay(char *err, int fd) {
  return anetSetTcpNoDelay(err, fd, 1);
}


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

x86 assembly (clang, -O2):
<anetEnableTcpNoDelay>:
mov    $0x1,%edx
jmp    1030 <anetSetTcpNoDelay@plt>

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

LLVM IR (-O2):
define i32 @anetEnableTcpNoDelay(i8* %0, i32 %1) {
%3 = tail call i32 @anetSetTcpNoDelay(i8* %0, i32 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
int /*<<< orphan*/ *strchr(char *, char);
int is_sym_char(char c) {
  return !isspace(c) && strchr("()[]{}\",'`;#|\\", c) == NULL;
}


x86 assembly (clang, -O0):
<is_sym_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    1161 <is_sym_char+0x41>
lea    0xeb2(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sym_char>:
push   %rbx
mov    %edi,%ebx
call   1040 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1132 <is_sym_char+0x12>
pop    %rbx
ret
movsbl %bl,%esi
lea    0xec4(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"()[]{}\22,'`;#|\\\00"
define i32 @is_sym_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isspace(i8 signext %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32* @strchr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = icmp eq i32* %8, null
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [15 x i8] c"()[]{}\22,'`;#|\\\00"
define i32 @is_sym_char(i8 signext %0) {
%2 = tail call i32 @isspace(i8 signext %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32* @strchr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%6 = icmp eq i32* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int unlink(const char *file) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xca() {
  Assert_real((isxdigit(202) == 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_isxdigit.c",
              1015, ("isxdigit should be 0 for 0xca"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xca>:
push   %rax
mov    $0xca,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3f7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xca\00"
define void @t_isxdigit_0xca() {
%1 = call i64 @isxdigit(i32 202)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1015, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xca\00"
define void @t_isxdigit_0xca() {
%1 = tail call i64 @isxdigit(i32 202)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1015, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
void print24DiskRIOInfo(const char *cmd) {
  int id;
  sscanf(cmd + 9, "%d", &id);
  output("Disk %d Read\t0\t0\tKB/s\n", id);
}


x86 assembly (clang, -O0):
<print24DiskRIOInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x9,%rdi
lea    0xec5(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print24DiskRIOInfo>:
push   %rax
add    $0x9,%rdi
lea    0xed4(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <output@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [23 x i8] c"Disk %d Read\090\090\09KB/s\0A\00"
define void @print24DiskRIOInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 9
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @output(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [23 x i8] c"Disk %d Read\090\090\09KB/s\0A\00"
define void @print24DiskRIOInfo(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 9
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @output(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kill(int, int);
void TerminateProcess(int pid, int signal) { kill(pid, signal); }


x86 assembly (clang, -O0):
<TerminateProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TerminateProcess>:
jmp    1030 <kill@plt>

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

LLVM IR (-O2):
define void @TerminateProcess(i32 %0, i32 %1) {
%3 = tail call i32 @kill(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SA1Direct(int);
int /*<<< orphan*/ TSB16(int /*<<< orphan*/, int);
void Op04M0(void) { TSB16(SA1Direct(3), 0xFFFF); }


x86 assembly (clang, -O0):
<Op04M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <TSB16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op04M0>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <TSB16@plt>

LLVM IR (-O0):
define void @Op04M0() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @TSB16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op04M0() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @TSB16(i32 %1, i32 65535)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int getPageIndex(unsigned int byteRequest) {
  unsigned int i = 0;
  if ((byteRequest % 8) == 0) {
    i = byteRequest / 8;
  } else {
    i = byteRequest % 8;
    i = 8 - i + byteRequest;
    i /= 8;
  }
  i--;
  assert(i <= 1024);
  return i;
}


x86 assembly (clang, -O0):
<getPageIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
jne    113f <getPageIndex+0x2f>
mov    -0x4(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    115f <getPageIndex+0x4f>
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    $0x8,%eax
sub    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPageIndex>:
push   %rbx
mov    %edi,%eax
and    $0x7,%eax
mov    $0x8,%ebx
sub    %eax,%ebx
test   %eax,%eax
cmove  %eax,%ebx
add    %edi,%ebx
shr    $0x3,%ebx
add    $0xffffffff,%ebx
xor    %edi,%edi
cmp    $0x401,%ebx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getPageIndex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = urem i32 %4, 8
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = udiv i32 %8, 8
store i32 %9, i32* %3
br label %19
10: ; preds = %1
%11 = load i32, i32* %2
%12 = urem i32 %11, 8
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = sub i32 8, %13
%15 = load i32, i32* %2
%16 = add i32 %14, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = udiv i32 %17, 8
store i32 %18, i32* %3
br label %19
19: ; preds = %10, %7
%20 = load i32, i32* %3
%21 = add i32 %20, -1
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = icmp ule i32 %22, 1024
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @getPageIndex(i32 %0) {
%2 = and i32 %0, 7
%3 = icmp eq i32 %2, 0
%4 = sub nuw nsw i32 8, %2
%5 = select i1 %3, i32 0, i32 %4
%6 = add i32 %5, %0
%7 = lshr i32 %6, 3
%8 = add nsw i32 %7, -1
%9 = icmp ult i32 %8, 1025
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
ret i32 %8
}
void loop(void) {
  for (int k = 0; k < 100000000; ++k) {
  }
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5f5e100,-0x4(%rbp)
jge    112b <loop+0x2b>
jmp    111d <loop+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <loop+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @loop() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100000000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @loop() {
ret void
}
/* Variables and functions */
int PMPI_Error_string(int, char *, int *);
int MPI_Error_string(int errorcode, char *string, int *resultlen) {
  ;
  return PMPI_Error_string(errorcode, string, resultlen);
}


x86 assembly (clang, -O0):
<MPI_Error_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <PMPI_Error_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Error_string>:
jmp    1030 <PMPI_Error_string@plt>

LLVM IR (-O0):
define i32 @MPI_Error_string(i32 %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i32 @PMPI_Error_string(i32 %7, i8* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @MPI_Error_string(i32 %0, i8* %1, i32* %2) {
%4 = tail call i32 @PMPI_Error_string(i32 %0, i8* %1, i32* %2)
ret i32 %4
}