xunge/DecIR huggingface dataset:
void OBJ_ln2nid(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_ln2nid() {
ret void
}
void INT_Excep_CMPB_CMPB1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CMPB_CMPB1() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned short height;
};
struct TYPE_4__ {
  TYPE_1__ max_logical_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
void set_XFontSetExtents_max_logical_extent_height(void *_p,
                                                   unsigned short _v) {
  ((XFontSetExtents *)_p)->max_logical_extent.height = (unsigned short)_v;
}


x86 assembly (clang, -O0):
<set_XFontSetExtents_max_logical_extent_height>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XFontSetExtents_max_logical_extent_height>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i16 }
define void @set_XFontSetExtents_max_logical_extent_height(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %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 i16 %5, i16* %9
ret void
}

LLVM IR (-O2):
define void @set_XFontSetExtents_max_logical_extent_height(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_sum(int i, int j) { printf("Sum = %d\n", (i + j)); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Sum = %d\0A\00"
define void @print_sum(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 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Sum = %d\0A\00"
define void @print_sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ readide(int, int /*<<< orphan*/);
uint8_t ide_read_ter(uint16_t addr, void *priv) { return readide(2, addr); }


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

x86 assembly (clang, -O2):
<ide_read_ter>:
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <readide@plt>

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

LLVM IR (-O2):
define i32 @ide_read_ter(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @readide(i32 2, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int var_get_u32(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int *);
int var_get_s32(uint8_t *cp, const uint8_t *endp, int32_t *i) {
  int b = var_get_u32(cp, endp, (uint32_t *)i);
  *i = ((uint32_t)*i >> 1) ^ -(int32_t)(*i & 1);
  return b;
}


x86 assembly (clang, -O0):
<var_get_s32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <var_get_u32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sar    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
and    $0x1,%edx
xor    %eax,%eax
sub    %edx,%eax
xor    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_get_s32>:
push   %rbx
mov    %rdx,%rbx
call   1030 <var_get_u32@plt>
mov    (%rbx),%ecx
mov    %ecx,%edx
sar    %edx
and    $0x1,%ecx
neg    %ecx
xor    %edx,%ecx
mov    %ecx,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @var_get_s32(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 = load i32*, i32** %6
%11 = call i32 @var_get_u32(i32* %8, i32* %9, i32* %10)
store i32 %11, i32* %7
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = ashr i32 %13, 1
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = and i32 %16, 1
%18 = sub nsw i32 0, %17
%19 = xor i32 %14, %18
%20 = load i32*, i32** %6
store i32 %19, i32* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @var_get_s32(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @var_get_u32(i32* %0, i32* %1, i32* %2)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = and i32 %5, 1
%8 = sub nsw i32 0, %7
%9 = xor i32 %6, %8
store i32 %9, i32* %2
ret i32 %4
}
void msm_rpm_free_request(struct msm_rpm_request *handle) { return; }


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

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

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

LLVM IR (-O2):
%struct.msm_rpm_request = type opaque
define void @msm_rpm_free_request(%struct.msm_rpm_request* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIRCalcExactBlackmanWindow(int, double *);
int /*<<< orphan*/ FIRCalcWindow(int, double, double *, double *);
int /*<<< orphan*/ free(double *);
double *malloc(int);
void FIRCalcExactBlackman(int length, double cutoff, double *coeffs) {
  double *window;
  window = malloc(length * sizeof(double));
  FIRCalcExactBlackmanWindow(length, window);
  FIRCalcWindow(length, cutoff, coeffs, window);
  free(window);
}


x86 assembly (clang, -O0):
<FIRCalcExactBlackman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <FIRCalcExactBlackmanWindow@plt>
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <FIRCalcWindow@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIRCalcExactBlackman>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
movsd  %xmm0,0x8(%rsp)
mov    %edi,%r15d
lea    0x0(,%r15,8),%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %r15d,%edi
mov    %rax,%rsi
call   1050 <FIRCalcExactBlackmanWindow@plt>
mov    %r15d,%edi
movsd  0x8(%rsp),%xmm0
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <FIRCalcWindow@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FIRCalcExactBlackman(i32 %0, double %1, double* %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
store i32 %0, i32* %4
store double %1, double* %5
store double* %2, double** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 8
%11 = trunc i64 %10 to i32
%12 = call double* @malloc(i32 %11)
store double* %12, double** %7
%13 = load i32, i32* %4
%14 = load double*, double** %7
%15 = call i32 @FIRCalcExactBlackmanWindow(i32 %13, double* %14)
%16 = load i32, i32* %4
%17 = load double, double* %5
%18 = load double*, double** %6
%19 = load double*, double** %7
%20 = call i32 @FIRCalcWindow(i32 %16, double %17, double* %18, double* %19)
%21 = load double*, double** %7
%22 = call i32 @free(double* %21)
ret void
}

LLVM IR (-O2):
define void @FIRCalcExactBlackman(i32 %0, double %1, double* %2) {
%4 = shl i32 %0, 3
%5 = tail call double* @malloc(i32 %4)
%6 = tail call i32 @FIRCalcExactBlackmanWindow(i32 %0, double* %5)
%7 = tail call i32 @FIRCalcWindow(i32 %0, double %1, double* %2, double* %5)
%8 = tail call i32 @free(double* %5)
ret void
}
/* Variables and functions */
int ENOENT;
char Platform_Absent(int e) {
  char _o_result;
  _o_result = e == ENOENT;
  return _o_result;
}


x86 assembly (clang, -O0):
<Platform_Absent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec7(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_Absent>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
sete   %al
ret

LLVM IR (-O0):
@ENOENT = global i32 0
define signext i8 @Platform_Absent(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @ENOENT
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
@ENOENT = global i32 0
define signext i8 @Platform_Absent(i32 %0) {
%2 = load i32, i32* @ENOENT
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_quaddobl_target_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(770, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<write_quaddobl_target_Laurent_system>:
mov    $0x302,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @write_quaddobl_target_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 770, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_clrtoeol(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(clrtoeol());
}


x86 assembly (clang, -O0):
<cmd_clrtoeol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_clrtoeol+0x27>
jmp    117f <cmd_clrtoeol+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <clrtoeol@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_clrtoeol>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_clrtoeol+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <clrtoeol@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_clrtoeol(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @clrtoeol()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_clrtoeol(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @clrtoeol()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
int log2(int x) {
  int count = 0;
  while (x > 1) {
    x >>= 1;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112f <log2+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void fill(void *buf, long sizeof_buf) {
  char *p = buf;
  int i;
  for (i = 0; i < sizeof_buf; i++)
    p[i] = "The quick brown dingo jumped over the layzy dog."[i];
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1150 <fill+0x50>
movslq -0x1c(%rbp),%rcx
lea    0xecc(%rip),%rax
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <fill+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
test   %rsi,%rsi
jle    1129 <fill+0x19>
push   %rax
mov    %rsi,%rdx
lea    0xee0(%rip),%rsi
call   1030 <memcpy@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"The quick brown dingo jumped over the layzy dog.\00"
define void @fill(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
store i32 0, i32* %6
br label %8
8: ; preds = %22, %2
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = load i64, i64* %4
%12 = icmp slt i64 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %8
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [49 x i8], [49 x i8]* @.str, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
br label %22
22: ; preds = %13
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %8
25: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"The quick brown dingo jumped over the layzy dog.\00"
define void @fill(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
void EC_POINT_oct2point(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_oct2point() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error_exit(char *fname) {
  printf("Could not open %s\n", fname);
  exit(1);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Could not open %s\0A\00"
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"Could not open %s\0A\00"
define void @error_exit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ emit_source_includes(int /*<<< orphan*/ *, char const *);
int /*<<< orphan*/ qmi_message_source(int /*<<< orphan*/ *, char const *);
void accessor_emit_c(FILE *fp, const char *package) {
  emit_source_includes(fp, package);
  qmi_message_source(fp, package);
}


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

x86 assembly (clang, -O2):
<accessor_emit_c>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <emit_source_includes@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <qmi_message_source@plt>

LLVM IR (-O0):
define void @accessor_emit_c(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @emit_source_includes(i32* %5, i8* %6)
%8 = load i32*, i32** %3
%9 = load i8*, i8** %4
%10 = call i32 @qmi_message_source(i32* %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @accessor_emit_c(i32* %0, i8* %1) {
%3 = tail call i32 @emit_source_includes(i32* %0, i8* %1)
%4 = tail call i32 @qmi_message_source(i32* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xee() {
  Assert_real((islower(238) == 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_islower.c",
              1195, ("islower should be 0 for 0xee"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xee>:
push   %rax
mov    $0xee,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ab,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xee\00"
define void @t_islower_0xee() {
%1 = call i64 @islower(i32 238)
%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 1195, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xee\00"
define void @t_islower_0xee() {
%1 = tail call i64 @islower(i32 238)
%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 1195, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_label(int, int);
void print_final_label(int label, int max_label) {
  print_label(label, max_label);
  print_label(0, 127);
}


x86 assembly (clang, -O0):
<print_final_label>:
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 <print_label@plt>
xor    %edi,%edi
mov    $0x7f,%esi
call   1030 <print_label@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_final_label>:
push   %rax
call   1030 <print_label@plt>
xor    %edi,%edi
mov    $0x7f,%esi
pop    %rax
jmp    1030 <print_label@plt>

LLVM IR (-O0):
define void @print_final_label(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 @print_label(i32 %5, i32 %6)
%8 = call i32 @print_label(i32 0, i32 127)
ret void
}

LLVM IR (-O2):
define void @print_final_label(i32 %0, i32 %1) {
%3 = tail call i32 @print_label(i32 %0, i32 %1)
%4 = tail call i32 @print_label(i32 0, i32 127)
ret void
}
char *hash_plugin_summary(void) { return ("rar \t\tRAR3 passwords plugin"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"rar \09\09RAR3 passwords plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [28 x i8] c"rar \09\09RAR3 passwords plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int ap_do_command_only(int, int);
int ap_clear_playlist(int session) {
  return (ap_do_command_only(session, 0xcc06));
}


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

x86 assembly (clang, -O2):
<ap_clear_playlist>:
mov    $0xcc06,%esi
jmp    1030 <ap_do_command_only@plt>

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

LLVM IR (-O2):
define i32 @ap_clear_playlist(i32 %0) {
%2 = tail call i32 @ap_do_command_only(i32 %0, i32 52230)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x0c() {
  Assert_real((islower(12) == 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_islower.c",
              65, ("islower should be 0 for 0x0c"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x0c>:
push   %rax
mov    $0xc,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x0c\00"
define void @t_islower_0x0c() {
%1 = call i64 @islower(i32 12)
%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 65, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x0c\00"
define void @t_islower_0x0c() {
%1 = tail call i64 @islower(i32 12)
%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 65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int SumDivisibleBy(int num) {
  int p = 999 / num;
  return num * (p * (p + 1)) / 2;
}


x86 assembly (clang, -O0):
<SumDivisibleBy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x3e7,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<SumDivisibleBy>:
mov    $0x3e7,%eax
xor    %edx,%edx
idiv   %edi
lea    0x1(%rax),%ecx
imul   %edi,%eax
imul   %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @SumDivisibleBy(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 999, %4
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %7, %9
%11 = mul nsw i32 %6, %10
%12 = sdiv i32 %11, 2
ret i32 %12
}

LLVM IR (-O2):
define i32 @SumDivisibleBy(i32 %0) {
%2 = sdiv i32 999, %0
%3 = add nsw i32 %2, 1
%4 = mul i32 %2, %0
%5 = mul i32 %4, %3
%6 = sdiv i32 %5, 2
ret i32 %6
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *);
char *pslr_copyright() {
  char *ret = malloc(sizeof(char) * 1024);
  sprintf(ret,
          "Copyright (C) 2011-2019 Andras Salamon\n\nBased on:\npslr-shoot (C) "
          "2009 Ramiro Barreiro\nPK-Remote (C) 2008 Pontus Lidman \n\n");
  return ret;
}


x86 assembly (clang, -O0):
<pslr_copyright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pslr_copyright>:
push   %rax
mov    $0x400,%edi
call   1030 <malloc@plt>
movups 0xede(%rip),%xmm0
movups %xmm0,(%rax)
movups 0xee4(%rip),%xmm0
movups %xmm0,0x10(%rax)
movups 0xee9(%rip),%xmm0
movups %xmm0,0x20(%rax)
movups 0xeee(%rip),%xmm0
movups %xmm0,0x30(%rax)
movups 0xef3(%rip),%xmm0
movups %xmm0,0x40(%rax)
movups 0xef8(%rip),%xmm0
movups %xmm0,0x50(%rax)
movups 0xefd(%rip),%xmm0
movups %xmm0,0x60(%rax)
movups 0xefc(%rip),%xmm0
movups %xmm0,0x6a(%rax)
pop    %rcx
ret

LLVM IR (-O0):
@.str = [122 x i8] c"Copyright (C) 2011-2019 Andras Salamon\0A\0ABased on:\0Apslr-shoot (C) 2009 Ramiro Barreiro\0APK-Remote (C) 2008 Pontus Lidman \0A\0A\00"
define i8* @pslr_copyright() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1024)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [122 x i8] c"Copyright (C) 2011-2019 Andras Salamon\0A\0ABased on:\0Apslr-shoot (C) 2009 Ramiro Barreiro\0APK-Remote (C) 2008 Pontus Lidman \0A\0A\00"
define noalias i8* @pslr_copyright() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(122) %1, i8* align 1 dereferenceable(122) getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0), i64 122, i1 false)
ret i8* %1
}
__attribute__((weak)) void RTC_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @RTC_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
double min(double a, double b) {
  if (b < a)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <min+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fcmp olt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ m_isspace(char);
int m_is_space_string(const char *s) {
  char ch;
  int ret = 1;
  while ((ch = *s++)) {
    if (!m_isspace(ch)) {
      ret = 0;
      break;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<m_is_space_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1162 <m_is_space_string+0x52>
movsbl -0x9(%rbp),%edi
call   1030 <m_isspace@plt>
cmp    $0x0,%eax
jne    115d <m_is_space_string+0x4d>
movl   $0x0,-0x10(%rbp)
jmp    1162 <m_is_space_string+0x52>
jmp    1123 <m_is_space_string+0x13>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_is_space_string>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%eax
test   %al,%al
je     113b <m_is_space_string+0x2b>
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <m_isspace@plt>
test   %eax,%eax
jne    1120 <m_is_space_string+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @m_is_space_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
store i8 %8, i8* %3
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8, i8* %3
%12 = call i32 @m_isspace(i8 signext %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10
store i32 0, i32* %4
br label %16
15: ; preds = %10
br label %5
16: ; preds = %14, %5
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @m_is_space_string(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = tail call i32 @m_isspace(i8 signext %4)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %2
10: ; preds = %6, %2
%11 = phi i32 [ 1, %2 ], [ 0, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ g(double, double);
f() {
  int i;
  float a[100000];
  for (i = 0; i < 1; i++) {
    g(1.0, 1.0 + i / 2.0 * 3.0);
    g(2.0, 1.0 + i / 2.0 * 3.0);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61a90,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    11a6 <f+0x96>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xec7(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeb3(%rip),%xmm0
call   1030 <g@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe91(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe8d(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm0
call   1030 <g@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <f+0x12>
mov    -0x4(%rbp),%eax
add    $0x61a90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movsd  0xee7(%rip),%xmm0
movaps %xmm0,%xmm1
call   1030 <g@plt>
movsd  0xedf(%rip),%xmm0
movsd  0xecf(%rip),%xmm1
pop    %rax
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100000 x float]
store i32 0, i32* %2
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 2.000000e+00
%11 = call double @llvm.fmuladd.f64(double %10, double 3.000000e+00, double 1.000000e+00)
%12 = call i32 @g(double 1.000000e+00, double %11)
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
%15 = fdiv double %14, 2.000000e+00
%16 = call double @llvm.fmuladd.f64(double %15, double 3.000000e+00, double 1.000000e+00)
%17 = call i32 @g(double 2.000000e+00, double %16)
br label %18
18: ; preds = %7
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %4
21: ; preds = %4
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 @g(double 1.000000e+00, double 1.000000e+00)
%2 = tail call i32 @g(double 2.000000e+00, double 1.000000e+00)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ WIFEXITED(int);
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int system(char *);
int main() {
  int result;
  result = system("exec ls -l");
  if (!WIFEXITED(result))
    printf("abnormal exit!\n");
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <WIFEXITED@plt>
cmp    $0x0,%eax
jne    117b <main+0x3b>
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <system@plt>
mov    %eax,%edi
call   1060 <WIFEXITED@plt>
test   %eax,%eax
jne    1164 <main+0x24>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"exec ls -l\00"
@.str.1 = [16 x i8] c"abnormal exit!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @WIFEXITED(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"exec ls -l\00"
@str = [15 x i8] c"abnormal exit!\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WIFEXITED(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = tail call i32 @_exit(i32 0)
unreachable
}
int signed_unary(int x) { return ~x; }


x86 assembly (clang, -O0):
<signed_unary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_unary>:
mov    %edi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @signed_unary(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *str) {
  fprintf(stderr, "Error: %s\n", str);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, char);
void t4() {
  char s[] = "xyz";
  char *c = s + 2;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "pointer.c",
          24, 122, *c);
  ;
}


x86 assembly (clang, -O0):
<t4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xecc(%rip),%rdi
mov    $0x18,%esi
mov    $0x7a,%edx
movsbl (%rax),%ecx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4>:
lea    0xee9(%rip),%rdi
mov    $0x18,%esi
mov    $0x7a,%edx
mov    $0x7a,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@__const.t4.s = [4 x i8] c"xyz\00"
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t4() {
%1 = alloca [4 x i8]
%2 = alloca i8*
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 2
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 24, i32 122, i8 signext %7)
ret void
}

LLVM IR (-O2):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t4() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 24, i32 122, i8 signext 122)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t bitswap64(uint64_t x) {
  asm("bswap %0" : "=a"(x) : "0"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i8* @bitswap64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswap $0", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @bitswap64(i8* readnone %0) {
%2 = tail call i8* asm "bswap $0", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int Clamp_Between(int x, int low, int high) {
  if (x < low)
    return low;
  if (x > high)
    return high;
  return x;
}


x86 assembly (clang, -O0):
<Clamp_Between>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <Clamp_Between+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <Clamp_Between+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <Clamp_Between+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <Clamp_Between+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clamp_Between>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @Clamp_Between(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %6
store i32 %12, i32* %4
br label %21
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %21
19: ; preds = %13
%20 = load i32, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @Clamp_Between(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ spriteclip(int, int, int, int);
void basSpriteClip() {
  int x, y, w, h;
  h = popNumber();
  w = popNumber();
  y = popNumber();
  x = popNumber();
  pushNumber(spriteclip(x, y, w, h));
}


x86 assembly (clang, -O0):
<basSpriteClip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <spriteclip@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basSpriteClip>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <spriteclip@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basSpriteClip() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @popNumber()
store i32 %5, i32* %4
%6 = call i32 (...) @popNumber()
store i32 %6, i32* %3
%7 = call i32 (...) @popNumber()
store i32 %7, i32* %2
%8 = call i32 (...) @popNumber()
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @spriteclip(i32 %9, i32 %10, i32 %11, i32 %12)
%14 = call i32 @pushNumber(i32 %13)
ret void
}

LLVM IR (-O2):
define void @basSpriteClip() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = tail call i32 (...) @popNumber()
%4 = tail call i32 (...) @popNumber()
%5 = tail call i32 @spriteclip(i32 %4, i32 %3, i32 %2, i32 %1)
%6 = tail call i32 @pushNumber(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __sys_exit(int const);
void _Exit(const int status) { __sys_exit(status); }


x86 assembly (clang, -O0):
<_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__sys_exit@plt>

x86 assembly (clang, -O2):
<_Exit>:
push   %rax
call   1030 <__sys_exit@plt>

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

LLVM IR (-O2):
define void @_Exit(i32 %0) {
%2 = tail call i32 @__sys_exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int foo(int *x) {
  int y;
  x = x;
  y = *x;
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 0
}