xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ xalloc_die();
void *fixup_null_alloc(size_t n) {
  void *p;
  p = 0;
  if (n == 0)
    p = malloc((size_t)1);
  if (p == NULL)
    xalloc_die();
  return p;
}


x86 assembly (clang, -O0):
<fixup_null_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114d <fixup_null_alloc+0x2d>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <fixup_null_alloc+0x3f>
mov    $0x0,%al
call   1030 <xalloc_die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixup_null_alloc>:
push   %rbx
test   %rdi,%rdi
jne    1138 <fixup_null_alloc+0x18>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <fixup_null_alloc+0x21>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <xalloc_die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @fixup_null_alloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i64 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1, %3
%7 = tail call i32 (...) @xalloc_die()
br label %8
8: ; preds = %6, %3
%9 = phi i8* [ null, %6 ], [ %4, %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ NumberIO_StrToHex(char *, int, unsigned int *);
int /*<<< orphan*/ StrIO_ReadString(char *, int);
void NumberIO_ReadHex(unsigned int *x) {
  typedef struct _T3_a _T3;
  struct _T3_a {
    char array[79 + 1];
  };
  _T3 a;
  StrIO_ReadString((char *)&a.array[0], 79);
  NumberIO_StrToHex((char *)&a.array[0], 79, x);
}


x86 assembly (clang, -O0):
<NumberIO_ReadHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x58(%rbp),%rdi
mov    $0x4f,%esi
call   1040 <StrIO_ReadString@plt>
lea    -0x58(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x4f,%esi
call   1030 <NumberIO_StrToHex@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberIO_ReadHex>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x4f,%esi
call   1040 <StrIO_ReadString@plt>
mov    %r14,%rdi
mov    $0x4f,%esi
mov    %rbx,%rdx
call   1030 <NumberIO_StrToHex@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct._T3_a = type { [80 x i8] }
define void @NumberIO_ReadHex(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct._T3_a
store i32* %0, i32** %2
%4 = getelementptr inbounds %struct._T3_a, %struct._T3_a* %3, i32 0, i32 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%6 = call i32 @StrIO_ReadString(i8* %5, i32 79)
%7 = getelementptr inbounds %struct._T3_a, %struct._T3_a* %3, i32 0, i32 0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%9 = load i32*, i32** %2
%10 = call i32 @NumberIO_StrToHex(i8* %8, i32 79, i32* %9)
ret void
}

LLVM IR (-O2):
%struct._T3_a = type { [80 x i8] }
define void @NumberIO_ReadHex(i32* %0) {
%2 = alloca %struct._T3_a
%3 = getelementptr inbounds %struct._T3_a, %struct._T3_a* %2, i64 0, i32 0, i64 0
%4 = call i32 @StrIO_ReadString(i8* %3, i32 79)
%5 = call i32 @NumberIO_StrToHex(i8* %3, i32 79, i32* %0)
ret void
}
char checkIfOwnZone(short zone, short *world, int playerId) {
  return (world[zone * 8 + 3] == playerId);
}


x86 assembly (clang, -O0):
<checkIfOwnZone>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movswl -0x2(%rbp),%ecx
shl    $0x3,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movswl (%rax,%rcx,2),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIfOwnZone>:
lea    0x3(,%rdi,8),%eax
cltq
movswl (%rsi,%rax,2),%eax
cmp    %edx,%eax
sete   %al
ret

LLVM IR (-O0):
define signext i8 @checkIfOwnZone(i16 signext %0, i16* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i32
store i16 %0, i16* %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%7 = load i16*, i16** %5
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = mul nsw i32 %9, 8
%11 = add nsw i32 %10, 3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i16, i16* %7, i64 %12
%14 = load i16, i16* %13
%15 = sext i16 %14 to i32
%16 = load i32, i32* %6
%17 = icmp eq i32 %15, %16
%18 = zext i1 %17 to i32
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @checkIfOwnZone(i16 signext %0, i16* nocapture %1, i32 %2) {
%4 = sext i16 %0 to i32
%5 = shl nsw i32 %4, 3
%6 = or i32 %5, 3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i16, i16* %1, i64 %7
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
%11 = icmp eq i32 %10, %2
%12 = zext i1 %11 to i8
ret i8 %12
}
/* Variables and functions */
int asum(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int values[10] = {441, -558, 4185, 121, -986, 5, 234, -948, 911, -54};
  printf("The sum is %i\n ", asum(values, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <asum@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <asum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.values = [10 x i32] [i32 441, i32 -558, i32 4185, i32 121, i32 -986, i32 5, i32 234, i32 -948, i32 911, i32 -54]
@.str = [16 x i8] c"The sum is %i\0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @asum(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.values = [10 x i32] [i32 441, i32 -558, i32 4185, i32 121, i32 -986, i32 5, i32 234, i32 -948, i32 911, i32 -54]
@.str = [16 x i8] c"The sum is %i\0A \00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @asum(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int strnlen(char const *, int);
int /*<<< orphan*/ write(int const, char const *, int);
int fail(const char *msg) {
  const int stderr_fd = 2;
  write(stderr_fd, msg, strnlen(msg, 4095));
  write(stderr_fd, "\n", 1);
  return 1;
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xfff,%esi
call   1040 <strnlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x2,%edi
lea    0xe9b(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
push   %rbx
mov    %rdi,%rbx
mov    $0xfff,%esi
call   1040 <strnlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xebc(%rip),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @fail(i8* %0) {
%2 = tail call i32 @strnlen(i8* %0, i32 4095)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
%4 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 1
}
/* Variables and functions */
int ReverseOrderOfDigits(int);
int getNum();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int num1;
  printf("\n\n");
  num1 = getNum();
  num1 = ReverseOrderOfDigits(num1);
  printf("\nThe reverse order of the digits is: %d", num1);
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getNum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <ReverseOrderOfDigits@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee0(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getNum@plt>
mov    %eax,%edi
call   1060 <ReverseOrderOfDigits@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [40 x i8] c"\0AThe reverse order of the digits is: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getNum()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @ReverseOrderOfDigits(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"\0AThe reverse order of the digits is: %d\00"
@str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
%2 = tail call i32 (...) @getNum()
%3 = tail call i32 @ReverseOrderOfDigits(i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
cbuf18(f, n) int f, n;
{ cbuf(f, n, 18); }


x86 assembly (clang, -O0):
<cbuf18>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x12,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf18>:
mov    $0x12,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf18(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 18)
ret i32 undef
}
/* Type definitions */
struct Hero {
  int dummy;
};
struct Ability {
  int dummy;
};

/* Variables and functions */
int Hero_checkAbilityRandom(struct Hero *, int);
int XiuWuDuanHun_check(struct Ability *self, struct Hero *attacker) {
  return (Hero_checkAbilityRandom(attacker, 20));
}


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

x86 assembly (clang, -O2):
<XiuWuDuanHun_check>:
mov    %rsi,%rdi
mov    $0x14,%esi
jmp    1030 <Hero_checkAbilityRandom@plt>

LLVM IR (-O0):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define i32 @XiuWuDuanHun_check(%struct.Ability* %0, %struct.Hero* %1) {
%3 = alloca %struct.Ability*
%4 = alloca %struct.Hero*
store %struct.Ability* %0, %struct.Ability** %3
store %struct.Hero* %1, %struct.Hero** %4
%5 = load %struct.Hero*, %struct.Hero** %4
%6 = call i32 @Hero_checkAbilityRandom(%struct.Hero* %5, i32 20)
ret i32 %6
}

LLVM IR (-O2):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define i32 @XiuWuDuanHun_check(%struct.Ability* nocapture readnone %0, %struct.Hero* %1) {
%3 = tail call i32 @Hero_checkAbilityRandom(%struct.Hero* %1, i32 20)
ret i32 %3
}
void ble_rsp_system_address_get(
    const struct ble_msg_system_address_get_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_address_get_rsp_t = type opaque
define void @ble_rsp_system_address_get(%struct.ble_msg_system_address_get_rsp_t* nocapture %0) {
ret void
}
void controles(char *right, char *left, char *up, char *down,
               char controlesj1[4]) {
  *right = controlesj1[0];
  *left = controlesj1[1];
  *up = controlesj1[2];
  *down = controlesj1[3];
}


x86 assembly (clang, -O0):
<controles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<controles>:
mov    (%r8),%al
mov    %al,(%rdi)
mov    0x1(%r8),%al
mov    %al,(%rsi)
mov    0x2(%r8),%al
mov    %al,(%rdx)
mov    0x3(%r8),%al
mov    %al,(%rcx)
ret

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

LLVM IR (-O2):
define void @controles(i8* nocapture writeonly %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2, i8* nocapture writeonly %3, i8* nocapture %4) {
%6 = load i8, i8* %4
store i8 %6, i8* %0
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = load i8, i8* %7
store i8 %8, i8* %1
%9 = getelementptr inbounds i8, i8* %4, i64 2
%10 = load i8, i8* %9
store i8 %10, i8* %2
%11 = getelementptr inbounds i8, i8* %4, i64 3
%12 = load i8, i8* %11
store i8 %12, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int, float *);
int main(void) {
  int i;
  int n = 256;
  float a[256] __attribute__((__aligned__(16)));
  check_vect();
  main1(n, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x100,-0xc(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
mov    -0xc(%rbp),%edi
lea    -0x410(%rbp),%rsi
call   1040 <main1@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    %rsp,%rsi
mov    $0x100,%edi
call   1040 <main1@plt>
xor    %eax,%eax
add    $0x408,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x float]
store i32 0, i32* %1
store i32 256, i32* %3
%5 = call i32 (...) @check_vect()
%6 = load i32, i32* %3
%7 = getelementptr inbounds [256 x float], [256 x float]* %4, i64 0, i64 0
%8 = call i32 @main1(i32 %6, float* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [256 x float]
%2 = bitcast [256 x float]* %1 to i8*
%3 = tail call i32 (...) @check_vect()
%4 = getelementptr inbounds [256 x float], [256 x float]* %1, i64 0, i64 0
%5 = call i32 @main1(i32 256, float* %4)
ret i32 0
}
int rgb_shift_sign(int value, int shift) {
  if (shift >= 0)
    return value >> shift;
  else
    return value << -shift;
}


x86 assembly (clang, -O0):
<rgb_shift_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1124 <rgb_shift_sign+0x24>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <rgb_shift_sign+0x31>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_shift_sign>:
mov    %edi,%eax
mov    %esi,%ecx
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
test   %esi,%esi
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @rgb_shift_sign(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = ashr i32 %9, %10
store i32 %11, i32* %3
br label %17
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = sub nsw i32 0, %14
%16 = shl i32 %13, %15
store i32 %16, i32* %3
br label %17
17: ; preds = %12, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @rgb_shift_sign(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
%4 = ashr i32 %0, %1
%5 = sub nsw i32 0, %1
%6 = shl i32 %0, %5
%7 = select i1 %3, i32 %4, i32 %6
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void bit_set8(volatile uint8_t *ptr, uint8_t bit) { *ptr |= (1 << (bit)); }


x86 assembly (clang, -O0):
<bit_set8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_set8>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @bit_set8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32*, i32** %3
%8 = load volatile i32, i32* %7
%9 = or i32 %8, %6
store volatile i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @bit_set8(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load volatile i32, i32* %0
%5 = or i32 %4, %3
store volatile i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ restart(int);
void RST_38() { restart(0x38); }


x86 assembly (clang, -O0):
<RST_38>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <restart@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RST_38>:
mov    $0x38,%edi
jmp    1030 <restart@plt>

LLVM IR (-O0):
define void @RST_38() {
%1 = call i32 @restart(i32 56)
ret void
}

LLVM IR (-O2):
define void @RST_38() {
%1 = tail call i32 @restart(i32 56)
ret void
}
int main(void) {
  static int local_static_non_inited;
  static int local_static_inited = 0;
  int local_inited = 0;
  int local_non_inited;
  return 0;
}


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

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

LLVM IR (-O0):
@main.local_static_non_inited = internal global i32 0
@main.local_static_inited = internal global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void avcodec_encode_video2() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_encode_video2() {
ret void
}
int int_comparer(void *x, void *y) { return *(int *)(x) - *(int *)(y); }


x86 assembly (clang, -O0):
<int_comparer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_comparer>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @int_comparer(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @int_comparer(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
unsigned int _uiGetPCols(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @_uiGetPCols() {
ret i32 0
}
void tosMemory_pokeUnsignedChar(int base, int offs, unsigned char value) {
  *((unsigned char *)(base + offs)) = value;
}


x86 assembly (clang, -O0):
<tosMemory_pokeUnsignedChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosMemory_pokeUnsignedChar>:
movslq %esi,%rax
movslq %edi,%rcx
mov    %dl,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @tosMemory_pokeUnsignedChar(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
store i8 %7, i8* %12
ret void
}

LLVM IR (-O2):
define void @tosMemory_pokeUnsignedChar(i32 %0, i32 %1, i8 zeroext %2) {
%4 = add nsw i32 %1, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8 %2, i8* %6
ret void
}
int _strlen(const char *s) {
  int i = 0;
  while (s[i++])
    ;
  return i;
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1130 <_strlen+0x30>
jmp    110f <_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %4 to i32
ret i32 %9
}
void playlist_array_destroy(char **array, int size) {
  int i;
  for (i = 0; i < size; i++)
    free(array[i]);
  free(array);
}


x86 assembly (clang, -O0):
<playlist_array_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <playlist_array_destroy+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <playlist_array_destroy+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playlist_array_destroy>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <playlist_array_destroy+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <playlist_array_destroy+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @playlist_array_destroy(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int write(int, int, char *);
int putchar(char c) { return write(1, 1, &c); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%esi
lea    -0x1(%rbp),%rdx
mov    %esi,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i32 1, i8* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i32 1, i8* %2)
ret i32 %3
}
/* Variables and functions */
int epoll_create(int);
int sp_create() { return epoll_create(1024); }


x86 assembly (clang, -O0):
<sp_create>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400,%edi
call   1030 <epoll_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_create>:
mov    $0x400,%edi
jmp    1030 <epoll_create@plt>

LLVM IR (-O0):
define i32 @sp_create() {
%1 = call i32 @epoll_create(i32 1024)
ret i32 %1
}

LLVM IR (-O2):
define i32 @sp_create() {
%1 = tail call i32 @epoll_create(i32 1024)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc12(void) {
  printf("Executing exitfunc12.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc12>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc12>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc12.\0A\00"
define void @exitfunc12() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc12.\00"
define void @exitfunc12() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_3699() {
  Assert_real((isqrt(3699) == 60),
              "/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/stdlib/isqrt.c",
              1345, ("Integer square root of 3699 should be 60"));
}


x86 assembly (clang, -O0):
<t_sqrt_3699>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe73,%edi
call   1030 <isqrt@plt>
cmp    $0x3c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x541,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_3699>:
push   %rax
mov    $0xe73,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x3c,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x541,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 3699 should be 60\00"
define void @t_sqrt_3699() {
%1 = call i32 @isqrt(i32 3699)
%2 = icmp eq i32 %1, 60
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1345, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 3699 should be 60\00"
define void @t_sqrt_3699() {
%1 = tail call i32 @isqrt(i32 3699)
%2 = icmp eq i32 %1, 60
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1345, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ceil_for(int n, int m) { return (((n - 1) / m) + 1); }


x86 assembly (clang, -O0):
<ceil_for>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_for>:
lea    -0x1(%rdi),%eax
cltd
idiv   %esi
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ceil_for(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 = sub nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @ceil_for(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = sdiv i32 %3, %1
%5 = add nsw i32 %4, 1
ret i32 %5
}
void Helper() {
  const int *nodes[5];
  int num_active = 5;
  while (num_active)
#pragma clang loop unroll(full)
    for (int i = 0; i < 5; ++i)
      if (nodes[i])
        --num_active;
}


x86 assembly (clang, -O0):
<Helper>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1157 <Helper+0x57>
movl   $0x0,-0x38(%rbp)
cmpl   $0x5,-0x38(%rbp)
jge    1152 <Helper+0x52>
movslq -0x38(%rbp),%rax
cmpq   $0x0,-0x30(%rbp,%rax,8)
je     113f <Helper+0x3f>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1144 <Helper+0x44>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    111c <Helper+0x1c>
jmp    110b <Helper+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Helper() {
%1 = alloca [5 x i32*]
%2 = alloca i32
%3 = alloca i32
store i32 5, i32* %2
br label %4
4: ; preds = %24, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %21, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [5 x i32*], [5 x i32*]* %1, i64 0, i64 %13
%15 = load i32*, i32** %14
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %11
%18 = load i32, i32* %2
%19 = add nsw i32 %18, -1
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %8
24: ; preds = %8
br label %4
25: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Helper() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DoStuff();
int DoSum(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  DoStuff();
  printf("2 + 1 = %d", DoSum(2, 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <DoStuff@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <DoSum@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <DoStuff@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <DoSum@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"2 + 1 = %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @DoStuff()
%3 = call i32 @DoSum(i32 2, i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"2 + 1 = %d\00"
define i32 @main() {
%1 = tail call i32 (...) @DoStuff()
%2 = tail call i32 @DoSum(i32 2, i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int hex_char_to_int(char c) {
  if ('0' <= c && c <= '9')
    return c - '0';
  if ('a' <= c && c <= 'f')
    return c - 'a' + 10;
  return -1;
}


x86 assembly (clang, -O0):
<hex_char_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1137 <hex_char_to_int+0x37>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1137 <hex_char_to_int+0x37>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <hex_char_to_int+0x6e>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1167 <hex_char_to_int+0x67>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1167 <hex_char_to_int+0x67>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <hex_char_to_int+0x6e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_char_to_int>:
mov    %edi,%eax
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     110e <hex_char_to_int+0xe>
add    $0xffffffd0,%eax
ret
lea    -0x61(%rax),%ecx
add    $0xffffffa9,%eax
cmp    $0x6,%cl
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hex_char_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -48
br label %12
7: ; preds = %1
%8 = add i8 %0, -97
%9 = icmp ult i8 %8, 6
%10 = add nsw i32 %2, -87
%11 = select i1 %9, i32 %10, i32 -1
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void grib_yyfree(void *ptr) { free((char *)ptr); }


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

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

LLVM IR (-O2):
define void @grib_yyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int _lseek(int file, int ptr, int dir) {
  (void)(file);
  (void)(ptr);
  (void)(dir);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
float test_d2f(double d) {
  float f;
  f = d;
  return f;
}


x86 assembly (clang, -O0):
<test_d2f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_d2f>:
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @test_d2f(double %0) {
%2 = alloca double
%3 = alloca float
store double %0, double* %2
%4 = load double, double* %2
%5 = fptrunc double %4 to float
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @test_d2f(double %0) {
%2 = fptrunc double %0 to float
ret float %2
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_clamp(float *, float *, float *, float *);
__attribute__((always_)) struct vec3 *psvec3_clamp(struct vec3 *result,
                                                   struct vec3 *a,
                                                   struct vec3 *lower,
                                                   struct vec3 *higher) {
  vec3_clamp((float *)result, (float *)a, (float *)lower, (float *)higher);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec3_clamp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_clamp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_clamp(%struct.vec3* %0, %struct.vec3* %1, %struct.vec3* %2, %struct.vec3* %3) {
%5 = alloca %struct.vec3*
%6 = alloca %struct.vec3*
%7 = alloca %struct.vec3*
%8 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %5
store %struct.vec3* %1, %struct.vec3** %6
store %struct.vec3* %2, %struct.vec3** %7
store %struct.vec3* %3, %struct.vec3** %8
%9 = load %struct.vec3*, %struct.vec3** %5
%10 = bitcast %struct.vec3* %9 to float*
%11 = load %struct.vec3*, %struct.vec3** %6
%12 = bitcast %struct.vec3* %11 to float*
%13 = load %struct.vec3*, %struct.vec3** %7
%14 = bitcast %struct.vec3* %13 to float*
%15 = load %struct.vec3*, %struct.vec3** %8
%16 = bitcast %struct.vec3* %15 to float*
%17 = call i32 @vec3_clamp(float* %10, float* %12, float* %14, float* %16)
%18 = load %struct.vec3*, %struct.vec3** %5
ret %struct.vec3* %18
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_clamp(%struct.vec3* returned %0, %struct.vec3* %1, %struct.vec3* %2, %struct.vec3* %3) {
%5 = bitcast %struct.vec3* %0 to float*
%6 = bitcast %struct.vec3* %1 to float*
%7 = bitcast %struct.vec3* %2 to float*
%8 = bitcast %struct.vec3* %3 to float*
%9 = tail call i32 @vec3_clamp(float* %5, float* %6, float* %7, float* %8)
ret %struct.vec3* %0
}
/* Variables and functions */
int /*<<< orphan*/ cpy(unsigned short *, void *, int);
unsigned short getUShort(void *data) {
  unsigned short v;
  cpy(&v, data, sizeof(unsigned short));
  return v;
}


x86 assembly (clang, -O0):
<getUShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xa(%rbp),%rdi
mov    $0x2,%edx
call   1030 <cpy@plt>
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUShort>:
push   %rax
mov    %rdi,%rsi
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <cpy@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i16 @getUShort(i8* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = call i32 @cpy(i16* %2, i8* %0, i32 2)
%5 = load i16, i16* %2
ret i16 %5
}
int dict_int_cmp(const void *k1, const void *k2) {
  const int a = *(const int *)k1;
  const int b = *(const int *)k2;
  return (a > b) - (a < b);
}


x86 assembly (clang, -O0):
<dict_int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x14(%rbp),%ecx
cmp    -0x18(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_int_cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @dict_int_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @dict_int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
unsigned long revend32(unsigned long i) {
  return ((i >> 24) & 0xff) | ((i >> 8) & 0xff00) | ((i << 8) & 0xff0000) |
         ((i << 24) & 0xff000000);
}


x86 assembly (clang, -O0):
<revend32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
and    $0xff00,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x8,%rcx
and    $0xff0000,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x18,%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @revend32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 24
%5 = and i64 %4, 255
%6 = load i64, i64* %2
%7 = lshr i64 %6, 8
%8 = and i64 %7, 65280
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = shl i64 %10, 8
%12 = and i64 %11, 16711680
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = shl i64 %14, 24
%16 = and i64 %15, 4278190080
%17 = or i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @revend32(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
int I_NoAppServicesLobbyGetUserReadyAt(int idx) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesLobbyGetUserReadyAt(i32 %0) {
ret i32 0
}