xunge/DecIR huggingface dataset:
double wind_dir_from_angle_deg(double deg) {
  double w = 180. + 90. - deg;
  while (w > 360)
    w -= 360;
  return w;
}


x86 assembly (clang, -O0):
<wind_dir_from_angle_deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <wind_dir_from_angle_deg+0x4d>
movsd  -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    111b <wind_dir_from_angle_deg+0x1b>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wind_dir_from_angle_deg>:
movapd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
subsd  %xmm1,%xmm0
ucomisd 0xef0(%rip),%xmm0
jbe    113a <wind_dir_from_angle_deg+0x3a>
movsd  0xeee(%rip),%xmm1
movsd  0xede(%rip),%xmm2
nopw   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
ja     1130 <wind_dir_from_angle_deg+0x30>
ret

LLVM IR (-O0):
define double @wind_dir_from_angle_deg(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 2.700000e+02, %4
store double %5, double* %3
br label %6
6: ; preds = %9, %1
%7 = load double, double* %3
%8 = fcmp ogt double %7, 3.600000e+02
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load double, double* %3
%11 = fsub double %10, 3.600000e+02
store double %11, double* %3
br label %6
12: ; preds = %6
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @wind_dir_from_angle_deg(double %0) {
%2 = fsub double 2.700000e+02, %0
%3 = fcmp ogt double %2, 3.600000e+02
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = phi double [ %6, %4 ], [ %2, %1 ]
%6 = fadd double %5, -3.600000e+02
%7 = fcmp ogt double %6, 3.600000e+02
br i1 %7, label %4, label %8
8: ; preds = %4, %1
%9 = phi double [ %2, %1 ], [ %6, %4 ]
ret double %9
}
/* Variables and functions */
int foo(int);
int test(int a, int b, int c) {
  int err;
  if ((err = foo(a)) != 0)
    goto fail;
  if ((err = foo(b)) != 0)
    goto fail;
  goto fail;
  if ((err = foo(c)) != 0)
    goto fail;
fail:
  return err;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113a <test+0x2a>
jmp    1158 <test+0x48>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1153 <test+0x43>
jmp    1158 <test+0x48>
jmp    1158 <test+0x48>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %esi,%ebx
call   1030 <foo@plt>
test   %eax,%eax
je     111e <test+0xe>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @test(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 = call i32 @foo(i32 %8)
store i32 %9, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
br label %18
12: ; preds = %3
%13 = load i32, i32* %5
%14 = call i32 @foo(i32 %13)
store i32 %14, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
br label %18
17: ; preds = %12
br label %18
18: ; preds = %17, %16, %11
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @foo(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @foo(i32 %1)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %4, %3 ], [ %7, %6 ]
ret i32 %9
}
int gdt_compare_double(const void *p1, const void *p2) {
  double d1 = *((double *)p1);
  double d2 = *((double *)p2);
  if (d1 < d2) {
    return -1;
  } else if (d1 > d2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<gdt_compare_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <gdt_compare_double+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <gdt_compare_double+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <gdt_compare_double+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <gdt_compare_double+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdt_compare_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gdt_compare_double(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @gdt_compare_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int ask_number() {
  int number;
  printf("enter the number: ");
  scanf("%d", &number);
  return number;
}


x86 assembly (clang, -O0):
<ask_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_number>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @ask_number() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [19 x i8] c"enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @ask_number() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
unsigned xrop3_185_0_0(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;
  unsigned stk3;
  stk3 = T & D;
  stk2 = S | stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_185_0_0>:
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
and    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_185_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_185_0_0(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
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %5
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_185_0_0(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 = or i32 %4, %5
%7 = xor i32 %6, -256
ret i32 %7
}
/* Type definitions */
struct Point {
  int dummy;
};
struct Edge {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ edge_dest(struct Edge *);
int /*<<< orphan*/ edge_orig(struct Edge *);
scalar_t__ predicate_triArea(struct Point *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int predicate_rightOf(struct Point *p, struct Edge *e) {
  return predicate_triArea(p, edge_orig(e), edge_dest(e)) < 0;
}


x86 assembly (clang, -O0):
<predicate_rightOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <edge_orig@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <edge_dest@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1050 <predicate_triArea@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<predicate_rightOf>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <edge_orig@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <edge_dest@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <predicate_triArea@plt>
shr    $0x3f,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.Point = type { i32 }
%struct.Edge = type { i32 }
define i32 @predicate_rightOf(%struct.Point* %0, %struct.Edge* %1) {
%3 = alloca %struct.Point*
%4 = alloca %struct.Edge*
store %struct.Point* %0, %struct.Point** %3
store %struct.Edge* %1, %struct.Edge** %4
%5 = load %struct.Point*, %struct.Point** %3
%6 = load %struct.Edge*, %struct.Edge** %4
%7 = call i32 @edge_orig(%struct.Edge* %6)
%8 = load %struct.Edge*, %struct.Edge** %4
%9 = call i32 @edge_dest(%struct.Edge* %8)
%10 = call i64 @predicate_triArea(%struct.Point* %5, i32 %7, i32 %9)
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.Point = type { i32 }
%struct.Edge = type { i32 }
define i32 @predicate_rightOf(%struct.Point* %0, %struct.Edge* %1) {
%3 = tail call i32 @edge_orig(%struct.Edge* %1)
%4 = tail call i32 @edge_dest(%struct.Edge* %1)
%5 = tail call i64 @predicate_triArea(%struct.Point* %0, i32 %3, i32 %4)
%6 = lshr i64 %5, 63
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBPHYPowerOn(uint32_t ui32Base) {
  (*((volatile uint8_t *)(ui32Base + 0x00000001))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<USBPHYPowerOn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBPHYPowerOn>:
andl   $0xfffffffe,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBPHYPowerOn(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -2
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBPHYPowerOn(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = and i32 %4, -2
store volatile i32 %5, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *ba_alloc(int);
void *ba_free(void *);
int /*<<< orphan*/ stpcpy(void *, char *);
int main() {
  void *memory = ba_alloc(10);
  assert(memory != NULL);
  stpcpy(memory, "123456789");
  memory = ba_free(memory);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1060 <ba_alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <stpcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ba_free@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1060 <ba_alloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <stpcpy@plt>
mov    %rbx,%rdi
call   1040 <ba_free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"123456789\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @ba_alloc(i32 10)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %2
%9 = call i32 @stpcpy(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %2
%11 = call i8* @ba_free(i8* %10)
store i8* %11, i8** %2
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"123456789\00"
define i32 @main() {
%1 = tail call i8* @ba_alloc(i32 10)
%2 = icmp ne i8* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @stpcpy(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = tail call i8* @ba_free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_file(char const *, char const *, char *);
void write_filter(const char *file, const char *filter) {
  write_file(file, filter, "filter");
}


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

x86 assembly (clang, -O2):
<write_filter>:
lea    0xee9(%rip),%rdx
jmp    1030 <write_file@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"filter\00"
define void @write_filter(i8* %0, i8* %1) {
%3 = tail call i32 @write_file(i8* %0, i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void handle_CONT(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_CONT(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
long long int baz(long long int x) {
  x = (x >> sizeof(long long int) * 8 - 1) << 1;
  x = x / 0x100000000LL;
  if (x != 0)
    link_error();
  return x;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x3f,%rax
shl    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x100000000,%rcx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <baz+0x45>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sar    $0x3e,%r14
and    $0xfffffffffffffffe,%r14
mov    $0xffffffff,%ebx
add    %r14,%rbx
movabs $0x1ffffffff,%rax
cmp    %rax,%rbx
jb     113d <baz+0x2d>
xor    %eax,%eax
call   1030 <link_error@plt>
test   %r14,%r14
cmovns %r14,%rbx
sar    $0x20,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @baz(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 63
%5 = shl i64 %4, 1
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = sdiv i64 %6, 4294967296
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (...) @link_error()
br label %12
12: ; preds = %10, %1
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @baz(i64 %0) {
%2 = ashr i64 %0, 62
%3 = and i64 %2, -2
%4 = add nsw i64 %3, 4294967295
%5 = icmp ult i64 %4, 8589934591
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @link_error()
br label %8
8: ; preds = %6, %1
%9 = sdiv i64 %3, 4294967296
ret i64 %9
}
void switchChip(char *chip) {
  if (*chip == 'Y') {
    *chip = 'R';
  } else if (*chip == 'R') {
    *chip = 'Y';
  }
}


x86 assembly (clang, -O0):
<switchChip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x59,%eax
jne    1124 <switchChip+0x24>
mov    -0x8(%rbp),%rax
movb   $0x52,(%rax)
jmp    1140 <switchChip+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x52,%eax
jne    113b <switchChip+0x3b>
mov    -0x8(%rbp),%rax
movb   $0x59,(%rax)
jmp    1140 <switchChip+0x40>
pop    %rbp
ret

x86 assembly (clang, -O2):
<switchChip>:
mov    (%rdi),%al
cmp    $0x59,%al
je     110e <switchChip+0xe>
cmp    $0x52,%al
jne    1112 <switchChip+0x12>
mov    $0x59,%al
jmp    1110 <switchChip+0x10>
mov    $0x52,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @switchChip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 89
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %2
store i8 82, i8* %8
br label %17
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 82
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = load i8*, i8** %2
store i8 89, i8* %15
br label %16
16: ; preds = %14, %9
br label %17
17: ; preds = %16, %7
ret void
}

LLVM IR (-O2):
define void @switchChip(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %6 [
i8 89, label %4
i8 82, label %3
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i8 [ 89, %3 ], [ 82, %1 ]
store i8 %5, i8* %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
void rep(int pn) { do_csi("%db", pn); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%db\00"
define void @rep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_csi(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"%db\00"
define void @rep(i32 %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int load() {}


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

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

LLVM IR (-O0):
define i32 @load() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @load() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ lcg_knuth_srand(unsigned int);
void xsrand(unsigned int seed) { lcg_knuth_srand(seed); }


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

x86 assembly (clang, -O2):
<xsrand>:
jmp    1030 <lcg_knuth_srand@plt>

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

LLVM IR (-O2):
define void @xsrand(i32 %0) {
%2 = tail call i32 @lcg_knuth_srand(i32 %0)
ret void
}
/* Variables and functions */
int pkey_free(int /*<<< orphan*/);
int main(void) { return pkey_free(0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <pkey_free@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @pkey_free(i32 0)
ret i32 %1
}
void av_format_set_subtitle_codec() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ layer_guard_biases(struct Layer const *);
int /*<<< orphan*/ layer_guard_outputs(struct Layer const *);
int /*<<< orphan*/ layer_guard_weights(struct Layer const *);
void guard_malloc(const struct Layer *l) {
  layer_guard_biases(l);
  layer_guard_outputs(l);
  layer_guard_weights(l);
}


x86 assembly (clang, -O0):
<guard_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <layer_guard_biases@plt>
mov    -0x8(%rbp),%rdi
call   1030 <layer_guard_outputs@plt>
mov    -0x8(%rbp),%rdi
call   1050 <layer_guard_weights@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guard_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <layer_guard_biases@plt>
mov    %rbx,%rdi
call   1030 <layer_guard_outputs@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <layer_guard_weights@plt>

LLVM IR (-O0):
%struct.Layer = type { i32 }
define void @guard_malloc(%struct.Layer* %0) {
%2 = alloca %struct.Layer*
store %struct.Layer* %0, %struct.Layer** %2
%3 = load %struct.Layer*, %struct.Layer** %2
%4 = call i32 @layer_guard_biases(%struct.Layer* %3)
%5 = load %struct.Layer*, %struct.Layer** %2
%6 = call i32 @layer_guard_outputs(%struct.Layer* %5)
%7 = load %struct.Layer*, %struct.Layer** %2
%8 = call i32 @layer_guard_weights(%struct.Layer* %7)
ret void
}

LLVM IR (-O2):
%struct.Layer = type { i32 }
define void @guard_malloc(%struct.Layer* %0) {
%2 = tail call i32 @layer_guard_biases(%struct.Layer* %0)
%3 = tail call i32 @layer_guard_outputs(%struct.Layer* %0)
%4 = tail call i32 @layer_guard_weights(%struct.Layer* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int **);
void example11() {
  int b[40][40];
  b[7][7] = 23;
  foo(b);
}


x86 assembly (clang, -O0):
<example11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1900,%rsp
movl   $0x17,-0x1484(%rbp)
lea    -0x1900(%rbp),%rdi
call   1030 <foo@plt>
add    $0x1900,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example11>:
sub    $0x1908,%rsp
movl   $0x17,0x47c(%rsp)
mov    %rsp,%rdi
call   1030 <foo@plt>
add    $0x1908,%rsp
ret

LLVM IR (-O0):
define void @example11() {
%1 = alloca [40 x [40 x i32]]
%2 = getelementptr inbounds [40 x [40 x i32]], [40 x [40 x i32]]* %1, i64 0, i64 7
%3 = getelementptr inbounds [40 x i32], [40 x i32]* %2, i64 0, i64 7
store i32 23, i32* %3
%4 = getelementptr inbounds [40 x [40 x i32]], [40 x [40 x i32]]* %1, i64 0, i64 0
%5 = bitcast [40 x i32]* %4 to i32**
%6 = call i32 @foo(i32** %5)
ret void
}

LLVM IR (-O2):
define void @example11() {
%1 = alloca [40 x [40 x i32]]
%2 = bitcast [40 x [40 x i32]]* %1 to i8*
%3 = getelementptr inbounds [40 x [40 x i32]], [40 x [40 x i32]]* %1, i64 0, i64 7, i64 7
store i32 23, i32* %3
%4 = bitcast [40 x [40 x i32]]* %1 to i32**
%5 = call i32 @foo(i32** %4)
ret void
}
unsigned long SIO1readCtrl32(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1readCtrl32() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1readCtrl32() {
ret i64 0
}
long ULIMIT(cmd, newlimit)
long *cmd, *newlimit;
{ return ((long)ulimit(*cmd, *newlimit)); }


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

x86 assembly (clang, -O2):
<ULIMIT>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
xor    %eax,%eax
call   1030 <ulimit@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @ULIMIT(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = call i32 (i64, i64, ...) bitcast (i32 (...)* @ulimit to i32 (i64, i64, ...)*)(i64 %6, i64 %8)
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @ULIMIT(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @ulimit to i32 (i64, i64, ...)*)(i64 %3, i64 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}
void yy_flex_free(ptr) void *ptr;
{ free(ptr); }


x86 assembly (clang, -O0):
<yy_flex_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):
<yy_flex_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yy_flex_free(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Type definitions */
struct fsm_T {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int entry_action_rx(const struct fsm_T *fsm, void *ptr) {
  printf("entry rx\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.fsm_T = type { i32 }
@.str = [10 x i8] c"entry rx\0A\00"
define i32 @entry_action_rx(%struct.fsm_T* %0, i8* %1) {
%3 = alloca %struct.fsm_T*
%4 = alloca i8*
store %struct.fsm_T* %0, %struct.fsm_T** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.fsm_T = type { i32 }
@str = [9 x i8] c"entry rx\00"
define i32 @entry_action_rx(%struct.fsm_T* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double logf(double const);
double alog(const double a) {
  if (a == 0)
    return 0;
  if (a < 0)
    return -logf(-a);
  return -logf(a);
}


x86 assembly (clang, -O0):
<alog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1142 <alog+0x32>
jp     1142 <alog+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b8 <alog+0xa8>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1192 <alog+0x82>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <logf@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b8 <alog+0xa8>
movsd  -0x10(%rbp),%xmm0
call   1030 <logf@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alog>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1121 <alog+0x11>
jp     1121 <alog+0x11>
movapd %xmm1,%xmm0
ret
push   %rax
movapd %xmm0,%xmm2
xorpd  0xed2(%rip),%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1030 <logf@plt>
movapd %xmm0,%xmm1
xorpd  0xea4(%rip),%xmm1
add    $0x8,%rsp
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @alog(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %19
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load double, double* %3
%12 = fneg double %11
%13 = call double @logf(double %12)
%14 = fneg double %13
store double %14, double* %2
br label %19
15: ; preds = %7
%16 = load double, double* %3
%17 = call double @logf(double %16)
%18 = fneg double %17
store double %18, double* %2
br label %19
19: ; preds = %15, %10, %6
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @alog(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fcmp olt double %0, 0.000000e+00
%5 = fneg double %0
%6 = select i1 %4, double %5, double %0
%7 = tail call double @logf(double %6)
%8 = fneg double %7
br label %9
9: ; preds = %3, %1
%10 = phi double [ 0.000000e+00, %1 ], [ %8, %3 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ TIOCLINUX;
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
scalar_t__ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, int *);
int /*<<< orphan*/ stdin;
int get_shift_state(void) {
  int na = 6, ns = 0;
  if (ioctl(fileno(stdin), TIOCLINUX, &na) == 0)
    ns = na;
  return ns;
}


x86 assembly (clang, -O0):
<get_shift_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x6,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    %eax,%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jne    1168 <get_shift_state+0x48>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shift_state>:
push   %rax
movl   $0x6,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    0x2e9a(%rip),%rcx
mov    (%rcx),%esi
lea    0x4(%rsp),%rdx
mov    %eax,%edi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    115a <get_shift_state+0x3a>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@TIOCLINUX = global i32 0
define i32 @get_shift_state() {
%1 = alloca i32
%2 = alloca i32
store i32 6, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* @stdin
%4 = call i32 @fileno(i32 %3)
%5 = load i32, i32* @TIOCLINUX
%6 = call i64 @ioctl(i32 %4, i32 %5, i32* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i32, i32* %1
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %0
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@stdin = global i32 0
@TIOCLINUX = global i32 0
define i32 @get_shift_state() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6, i32* %1
%3 = load i32, i32* @stdin
%4 = tail call i32 @fileno(i32 %3)
%5 = load i32, i32* @TIOCLINUX
%6 = call i64 @ioctl(i32 %4, i32 %5, i32* %1)
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* %1
%9 = select i1 %7, i32 %8, i32 0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x89() {
  Assert_real((isprint(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_isprint.c",
              690, ("isprint should be 0 for 0x89"));
}


x86 assembly (clang, -O0):
<t_isprint_0x89>:
push   %rbp
mov    %rsp,%rbp
mov    $0x89,%edi
call   1030 <isprint@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_isprint_0x89>:
push   %rax
mov    $0x89,%edi
call   1030 <isprint@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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x89\00"
define void @t_isprint_0x89() {
%1 = call i64 @isprint(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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x89\00"
define void @t_isprint_0x89() {
%1 = tail call i64 @isprint(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*/ assert(int /*<<< orphan*/);
void fun1() { assert(0); }


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @fun1() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @fun1() {
%1 = tail call i32 @assert(i32 0)
ret void
}
S(j, e) {
  ae(1032325);
  return s(132 + j, e);
}


x86 assembly (clang, -O0):
<S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xfc085,%edi
mov    $0x0,%al
call   1030 <ae@plt>
mov    -0x4(%rbp),%edi
add    $0x84,%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1040 <s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xfc085,%edi
xor    %eax,%eax
call   1030 <ae@plt>
add    $0x84,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <s@plt>

LLVM IR (-O0):
define i32 @S(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i32, ...) bitcast (i32 (...)* @ae to i32 (i32, ...)*)(i32 1032325)
%6 = load i32, i32* %3
%7 = add nsw i32 132, %6
%8 = load i32, i32* %4
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @s to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @S(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @ae to i32 (i32, ...)*)(i32 1032325)
%4 = add nsw i32 %0, 132
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @s to i32 (i32, i32, ...)*)(i32 %4, i32 %1)
ret i32 %5
}
void orr_4(short *a) {
  for (int i = 0; i < 1024; i++)
    a[i] |= 0x00340034;
}


x86 assembly (clang, -O0):
<orr_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    1140 <orr_4+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%edx
or     $0x340034,%edx
mov    %dx,(%rax,%rcx,2)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <orr_4+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<orr_4>:
xor    %eax,%eax
movaps 0xef7(%rip),%xmm0
nopl   0x0(%rax)
movups (%rdi,%rax,2),%xmm1
movups 0x10(%rdi,%rax,2),%xmm2
movups 0x20(%rdi,%rax,2),%xmm3
movups 0x30(%rdi,%rax,2),%xmm4
orps   %xmm0,%xmm1
orps   %xmm0,%xmm2
movups %xmm1,(%rdi,%rax,2)
movups %xmm2,0x10(%rdi,%rax,2)
orps   %xmm0,%xmm3
orps   %xmm0,%xmm4
movups %xmm3,0x20(%rdi,%rax,2)
movups %xmm4,0x30(%rdi,%rax,2)
add    $0x20,%rax
cmp    $0x400,%rax
jne    1110 <orr_4+0x10>
ret

LLVM IR (-O0):
define void @orr_4(i16* %0) {
%2 = alloca i16*
%3 = alloca i32
store i16* %0, i16** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i16*, i16** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i16, i16* %8, i64 %10
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
%14 = or i32 %13, 3407924
%15 = trunc i32 %14 to i16
store i16 %15, i16* %11
br label %16
16: ; preds = %7
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @orr_4(i16* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %25, %2 ]
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = bitcast i16* %4 to <8 x i16>*
%6 = load <8 x i16>, <8 x i16>* %5
%7 = getelementptr inbounds i16, i16* %4, i64 8
%8 = bitcast i16* %7 to <8 x i16>*
%9 = load <8 x i16>, <8 x i16>* %8
%10 = or <8 x i16> %6, <i16 52, i16 52, i16 52, i16 52, i16 52, i16 52, i16 52, i16 52>
%11 = or <8 x i16> %9, <i16 52, i16 52, i16 52, i16 52, i16 52, i16 52, i16 52, i16 52>
%12 = bitcast i16* %4 to <8 x i16>*
store <8 x i16> %10, <8 x i16>* %12
%13 = bitcast i16* %7 to <8 x i16>*
store <8 x i16> %11, <8 x i16>* %13
%14 = or i64 %3, 16
%15 = getelementptr inbounds i16, i16* %0, i64 %14
%16 = bitcast i16* %15 to <8 x i16>*
%17 = load <8 x i16>, <8 x i16>* %16
%18 = getelementptr inbounds i16, i16* %15, i64 8
%19 = bitcast i16* %18 to <8 x i16>*
%20 = load <8 x i16>, <8 x i16>* %19
%21 = or <8 x i16> %17, <i16 52, i16 52, i16 52, i16 52, i16 52, i16 52, i16 52, i16 52>
%22 = or <8 x i16> %20, <i16 52, i16 52, i16 52, i16 52, i16 52, i16 52, i16 52, i16 52>
%23 = bitcast i16* %15 to <8 x i16>*
store <8 x i16> %21, <8 x i16>* %23
%24 = bitcast i16* %18 to <8 x i16>*
store <8 x i16> %22, <8 x i16>* %24
%25 = add nuw nsw i64 %3, 32
%26 = icmp eq i64 %25, 1024
br i1 %26, label %27, label %2
27: ; preds = %2
ret void
}
/* Variables and functions */
char *convert(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *res = NULL;
  char src[] = "PAYPALISHIRING";
  printf("%s\n", src);
  res = convert(src, 3);
  printf("%s\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xeba(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x1f(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1f(%rbp),%rdi
mov    $0x3,%esi
call   1030 <convert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x474e4952494853,%rax
mov    %rax,0xf(%rsp)
movabs $0x53494c4150594150,%rax
4c 49 53
mov    %rax,0x8(%rsp)
lea    0xec3(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <convert@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.src = [15 x i8] c"PAYPALISHIRING\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [15 x i8]
store i32 0, i32* %1
store i8* null, i8** %2
%4 = bitcast [15 x i8]* %3 to i8*
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%8 = call i8* @convert(i8* %7, i32 3)
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [15 x i8] c"PAYPALISHIRING\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @convert(i8* %2, i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int xor0(int i, int j) { return ((i + j) % 2) ? 0 : 1; }


x86 assembly (clang, -O0):
<xor0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor0>:
lea    (%rdi,%rsi,1),%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @xor0(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 = add nsw i32 %5, %6
%8 = srem i32 %7, 2
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @xor0(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
ret i32 %5
}
void mailsasl_external_ref(void) {}


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

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

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

LLVM IR (-O2):
define void @mailsasl_external_ref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(void) { printf("hello from f\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello from f\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *_zero_arr_plus_int_fn(int *, int, int, char const *, unsigned int);
int *_zero_arr_inplace_plus_int_fn(int **x, int orig_i, const char *filename,
                                   unsigned lineno) {
  *x = _zero_arr_plus_int_fn(*x, 1, orig_i, filename, lineno);
  return *x;
}


x86 assembly (clang, -O0):
<_zero_arr_inplace_plus_int_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%esi
call   1030 <_zero_arr_plus_int_fn@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_inplace_plus_int_fn>:
push   %rbx
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x1,%esi
call   1030 <_zero_arr_plus_int_fn@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @_zero_arr_inplace_plus_int_fn(i32** %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32** %0, i32*** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32**, i32*** %5
%10 = load i32*, i32** %9
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32* @_zero_arr_plus_int_fn(i32* %10, i32 1, i32 %11, i8* %12, i32 %13)
%15 = load i32**, i32*** %5
store i32* %14, i32** %15
%16 = load i32**, i32*** %5
%17 = load i32*, i32** %16
ret i32* %17
}

LLVM IR (-O2):
define i32* @_zero_arr_inplace_plus_int_fn(i32** nocapture %0, i32 %1, i8* %2, i32 %3) {
%5 = load i32*, i32** %0
%6 = tail call i32* @_zero_arr_plus_int_fn(i32* %5, i32 1, i32 %1, i8* %2, i32 %3)
store i32* %6, i32** %0
ret i32* %6
}
void do_over_flow(void *x) {
  do {
    kprintf("Unsupport Now...[%s]\n", __FUNCTION__);
    while (1)
      ;
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<do_over_flow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <kprintf@plt>
jmp    1131 <do_over_flow+0x21>

x86 assembly (clang, -O2):
<do_over_flow>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef7(%rip),%rsi
xor    %eax,%eax
call   1030 <kprintf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1130 <do_over_flow+0x20>

LLVM IR (-O0):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_over_flow = [13 x i8] c"do_over_flow\00"
define void @do_over_flow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.do_over_flow, i64 0, i64 0))
br label %5
5: ; preds = %3, %5
br label %5
6: ; No predecessors!
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_over_flow = [13 x i8] c"do_over_flow\00"
define void @do_over_flow(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.do_over_flow, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
void *bmstart(void *shm) { return shm; }


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

x86 assembly (clang, -O2):
<bmstart>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @bmstart(i8* readnone returned %0) {
ret i8* %0
}