xunge/DecIR huggingface dataset:
/* Type definitions */
struct d3_album {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_album(struct d3_album *);
int /*<<< orphan*/ m_free(int);
scalar_t__ m_next(int, int *, struct d3_album **);
void d3_close(int db) {
  int p;
  struct d3_album *a;
  for (p = -1; m_next(db, &p, &a);)
    free_album(a);
  m_free(db);
}


x86 assembly (clang, -O0):
<d3_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <m_next@plt>
cmp    $0x0,%rax
je     116a <d3_close+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <free_album@plt>
jmp    1142 <d3_close+0x12>
mov    -0x4(%rbp),%edi
call   1040 <m_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d3_close>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <m_next@plt>
test   %rax,%rax
je     118c <d3_close+0x5c>
lea    0x4(%rsp),%r14
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rdi
call   1030 <free_album@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <m_next@plt>
test   %rax,%rax
jne    1170 <d3_close+0x40>
mov    %ebx,%edi
call   1040 <m_free@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.d3_album = type { i32 }
define void @d3_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.d3_album*
store i32 %0, i32* %2
store i32 -1, i32* %3
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* %2
%7 = call i64 @m_next(i32 %6, i32* %3, %struct.d3_album** %4)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load %struct.d3_album*, %struct.d3_album** %4
%11 = call i32 @free_album(%struct.d3_album* %10)
br label %5
12: ; preds = %5
%13 = load i32, i32* %2
%14 = call i32 @m_free(i32 %13)
ret void
}

LLVM IR (-O2):
%struct.d3_album = type { i32 }
define void @d3_close(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.d3_album*
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.d3_album** %3 to i8*
store i32 -1, i32* %2
%6 = call i64 @m_next(i32 %0, i32* %2, %struct.d3_album** %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1, %8
%9 = load %struct.d3_album*, %struct.d3_album** %3
%10 = call i32 @free_album(%struct.d3_album* %9)
%11 = call i64 @m_next(i32 %0, i32* %2, %struct.d3_album** %3)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %1
%14 = call i32 @m_free(i32 %0)
ret void
}
unsigned int AsmData_encodeInstr(unsigned char op, unsigned char reg1,
                                 unsigned char reg2, unsigned short imm) {
  unsigned int byte2 = (reg1) | ((reg2) << 6);
  return ((unsigned int)op | (byte2 << 8) | (imm << 16));
}


x86 assembly (clang, -O0):
<AsmData_encodeInstr>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %ax,-0x6(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl -0x6(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AsmData_encodeInstr>:
shl    $0xe,%edx
shl    $0x8,%esi
shl    $0x10,%ecx
or     %edx,%ecx
lea    (%rsi,%rdi,1),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @AsmData_encodeInstr(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i16 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i16
%9 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i16 %3, i16* %8
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %7
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 6
%15 = or i32 %11, %14
store i32 %15, i32* %9
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i32, i32* %9
%19 = shl i32 %18, 8
%20 = or i32 %17, %19
%21 = load i16, i16* %8
%22 = zext i16 %21 to i32
%23 = shl i32 %22, 16
%24 = or i32 %20, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @AsmData_encodeInstr(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i16 zeroext %3) {
%5 = zext i8 %1 to i32
%6 = zext i8 %2 to i32
%7 = zext i8 %0 to i32
%8 = shl nuw nsw i32 %6, 14
%9 = shl nuw nsw i32 %5, 8
%10 = zext i16 %3 to i32
%11 = shl nuw i32 %10, 16
%12 = or i32 %9, %7
%13 = or i32 %12, %8
%14 = or i32 %13, %11
ret i32 %14
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bswap_16(uint16_t x) {
  x = (x >> 8) | (x << 8);
  return x;
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bswap_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @bswap_16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("%m\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%m\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void die(char *s) {
  fputs(s, stderr);
  fflush(stderr);
  exit(0);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
void clear_bit(int nr, volatile void *addr) {
  asm volatile("btr %1,%0" : "+m"(*(volatile long *)addr) : "Ir"(nr));
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btr    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
btr    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i64*
%7 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @clear_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
tail call void asm sideeffect "btr $1,$0", "=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %0, i64* elementtype(i64) %3)
ret void
}
int pci_find_aer_capability(struct pci_dev *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_find_aer_capability(%struct.pci_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
char *str_repeat(const char *str, int multiplier, char *buffer) {
  int i;
  for (i = 0; i < multiplier; i++)
    strcat(buffer, str);
  return buffer;
}


x86 assembly (clang, -O0):
<str_repeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <str_repeat+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <str_repeat+0x1a>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_repeat>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
test   %esi,%esi
jle    1130 <str_repeat+0x20>
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcat@plt>
add    $0xffffffff,%ebp
jne    1120 <str_repeat+0x10>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @str_repeat(i8* %0, i32 %1, i8* returned %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @strcat(i8* %2, i8* %0)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %5
10: ; preds = %5, %3
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *create_unique_name(const char *prefix) {
  uint64_t timestamp = (uint64_t)time(NULL);
  static char buf[256];
  sprintf(buf, "%s_%lu", prefix, timestamp);
  return buf;
}


x86 assembly (clang, -O0):
<create_unique_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0x2efa(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ee7(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_unique_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
lea    0x2f0b(%rip),%r14
lea    0xec4(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@create_unique_name.buf = internal global [256 x i8] zeroinitializer
@.str = [7 x i8] c"%s_%lu\00"
define i8* @create_unique_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @create_unique_name.buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @create_unique_name.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@create_unique_name.buf = internal global [256 x i8] zeroinitializer
@.str = [7 x i8] c"%s_%lu\00"
define i8* @create_unique_name(i8* %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @create_unique_name.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @create_unique_name.buf, i64 0, i64 0)
}
__attribute__((no, noclone)) signed __int128 t114_3mul(unsigned __int128 y) {
  signed __int128 r;
  if (__builtin_mul_overflow((signed __int128)(0), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t114_3mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
test   $0x1,%al
jne    114f <t114_3mul+0x3f>
jmp    1156 <t114_3mul+0x46>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t114_3mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 0, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
%15 = icmp ugt i128 %14, 170141183460469231731687303715884105727
%16 = or i1 %13, %15
%17 = sub i128 0, %14
%18 = select i1 false, i128 %17, i128 %14
store i128 %18, i128* %6
br i1 %16, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @bar()
br label %21
21: ; preds = %19, %2
%22 = load i128, i128* %6
store i128 %22, i128* %3
%23 = bitcast i128* %3 to { i64, i64 }*
%24 = load { i64, i64 }, { i64, i64 }* %23
ret { i64, i64 } %24
}

LLVM IR (-O2):
define { i64, i64 } @t114_3mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int foo_bar(void) {
  printf("foo_bar\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"foo_bar\00"
define i32 @foo_bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void Sys_BeginProfiling(void) {}


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

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

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

LLVM IR (-O2):
define void @Sys_BeginProfiling() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int /*<<< orphan*/);
void memset_good2() {
  int arr[10];
  memset(arr, 0, 0);
}


x86 assembly (clang, -O0):
<memset_good2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_good2>:
sub    $0x28,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <memset@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @memset_good2() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%3 = call i32 @memset(i32* %2, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @memset_good2() {
%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 @memset(i32* %3, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ string;

/* Variables and functions */
int /*<<< orphan*/ bzero(void *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(void *, char *);
void *modify(void *string) {
  bzero(string, sizeof(string));
  strcpy(string, "Hello, process!");
  printf("Now string:\n    %s\n", (char *)string);
}


x86 assembly (clang, -O0):
<modify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1050 <bzero@plt>
mov    -0x10(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modify>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%esi
call   1050 <bzero@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, process!\00"
@.str.1 = [20 x i8] c"Now string:\0A %s\0A\00"
define i8* @modify(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @bzero(i8* %4, i32 8)
%6 = load i8*, i8** %3
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello, process!\00"
@.str.1 = [20 x i8] c"Now string:\0A %s\0A\00"
define noalias i8* @modify(i8* %0) {
%2 = tail call i32 @bzero(i8* %0, i32 8)
%3 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i8* undef
}
int fxp_digits2prec(int digits) {
  switch (digits) {
  case 1:
    return 10;
  case 2:
    return 100;
  case 3:
    return 1000;
  case 4:
    return 10000;
  case 5:
    return 100000;
  case 6:
    return 1000000;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<fxp_digits2prec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1178 <fxp_digits2prec+0x78>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xa,-0x4(%rbp)
jmp    117f <fxp_digits2prec+0x7f>
movl   $0x64,-0x4(%rbp)
jmp    117f <fxp_digits2prec+0x7f>
movl   $0x3e8,-0x4(%rbp)
jmp    117f <fxp_digits2prec+0x7f>
movl   $0x2710,-0x4(%rbp)
jmp    117f <fxp_digits2prec+0x7f>
movl   $0x186a0,-0x4(%rbp)
jmp    117f <fxp_digits2prec+0x7f>
movl   $0xf4240,-0x4(%rbp)
jmp    117f <fxp_digits2prec+0x7f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxp_digits2prec>:
add    $0xffffffff,%edi
mov    $0xffffffff,%eax
cmp    $0x5,%edi
ja     111a <fxp_digits2prec+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @fxp_digits2prec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
]
5: ; preds = %1
store i32 10, i32* %2
br label %12
6: ; preds = %1
store i32 100, i32* %2
br label %12
7: ; preds = %1
store i32 1000, i32* %2
br label %12
8: ; preds = %1
store i32 10000, i32* %2
br label %12
9: ; preds = %1
store i32 100000, i32* %2
br label %12
10: ; preds = %1
store i32 1000000, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.fxp_digits2prec = [6 x i32] [i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000]
define i32 @fxp_digits2prec(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.fxp_digits2prec, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ f(unsigned long);
void g(long x) { f((unsigned long)(-1 - x) + 1); }


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

x86 assembly (clang, -O2):
<g>:
neg    %rdi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 -1, %3
%5 = add i64 %4, 1
%6 = call i32 @f(i64 %5)
ret void
}

LLVM IR (-O2):
define void @g(i64 %0) {
%2 = sub i64 0, %0
%3 = tail call i32 @f(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int a = 0;
  printf("Hello, World!\n");
  a++;
  a--;
  a += 2;
  a++;
  a--;
  a++;
  return a >= 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = add nsw i32 %10, -1
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 2
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = add nsw i32 %16, -1
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = icmp sge i32 %20, 3
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummy_ssh() { printf("\n"); }


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

x86 assembly (clang, -O2):
<dummy_ssh>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @dummy_ssh() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(void *block) { free(block); }


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

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

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

LLVM IR (-O2):
define void @my_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int rec(int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a, b;
  printf("Enter Number to find Factorial: ");
  scanf("%d", &a);
  b = rec(a);
  printf("Factorial of %d= %d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <rec@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <rec@plt>
mov    0x4(%rsp),%esi
lea    0xec0(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter Number to find Factorial: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Factorial of %d= %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @rec(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter Number to find Factorial: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Factorial of %d= %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @rec(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, ...);
int main() {
  short int a = 0x9a;
  printf("Size of int is = %d\n", sizeof(short int));
  printf("a = %d, = %x\n", a, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x9a,-0x6(%rbp)
lea    0xed4(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x6(%rbp),%ax
movswl -0x6(%rbp),%edx
lea    0xece(%rip),%rdi
movswl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x9a,%esi
mov    $0x9a,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Size of int is = %d\0A\00"
@.str.1 = [14 x i8] c"a = %d, = %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 154, i16* %2
%3 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i16 signext 2)
%4 = load i16, i16* %2
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i16 signext %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Size of int is = %d\0A\00"
@.str.1 = [14 x i8] c"a = %d, = %x\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i16 signext 2)
%2 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i16 signext 154, i32 154)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_46() {
  Assert_real((isqrt(46) == 6),
              "/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",
              235, ("Integer square root of 46 should be 6"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_46>:
push   %rax
mov    $0x2e,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xeb,%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 = [38 x i8] c"Integer square root of 46 should be 6\00"
define void @t_sqrt_46() {
%1 = call i32 @isqrt(i32 46)
%2 = icmp eq i32 %1, 6
%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 235, i8* getelementptr inbounds ([38 x i8], [38 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 = [38 x i8] c"Integer square root of 46 should be 6\00"
define void @t_sqrt_46() {
%1 = tail call i32 @isqrt(i32 46)
%2 = icmp eq i32 %1, 6
%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 235, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_relief_style_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_relief_style_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_module_info_list() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_module_info_list"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"NOT IMPLEMENTED:pa_context_get_module_info_list\0A\00"
define i32 @pa_context_get_module_info_list() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_context_get_module_info_list\00"
define i32 @pa_context_get_module_info_list() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct Edge {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ edge_oNext(struct Edge *);
struct Edge *edge_sym(int /*<<< orphan*/);
struct Edge *edge_lPrev(struct Edge *edge) {
  return edge_sym(edge_oNext(edge));
}


x86 assembly (clang, -O0):
<edge_lPrev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <edge_oNext@plt>
mov    %eax,%edi
call   1040 <edge_sym@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edge_lPrev>:
push   %rax
call   1030 <edge_oNext@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <edge_sym@plt>

LLVM IR (-O0):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_lPrev(%struct.Edge* %0) {
%2 = alloca %struct.Edge*
store %struct.Edge* %0, %struct.Edge** %2
%3 = load %struct.Edge*, %struct.Edge** %2
%4 = call i32 @edge_oNext(%struct.Edge* %3)
%5 = call %struct.Edge* @edge_sym(i32 %4)
ret %struct.Edge* %5
}

LLVM IR (-O2):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_lPrev(%struct.Edge* %0) {
%2 = tail call i32 @edge_oNext(%struct.Edge* %0)
%3 = tail call %struct.Edge* @edge_sym(i32 %2)
ret %struct.Edge* %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_compute_total_degree_solution(int n, int i, int *m, double *sol) {
  int fail, a[2];
  a[0] = n;
  a[1] = i;
  fail = _ada_use_c2phc4c(142, a, m, sol, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_compute_total_degree_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x24(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x8e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_compute_total_degree_solution>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x8e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_compute_total_degree_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
%10 = alloca [2 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%11 = load i32, i32* %5
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%16 = load i32*, i32** %7
%17 = load double*, double** %8
%18 = call i32 @_ada_use_c2phc4c(i32 142, i32* %15, i32* %16, double* %17, i32 0)
store i32 %18, i32* %9
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @solcon_compute_total_degree_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = call i32 @_ada_use_c2phc4c(i32 142, i32* %7, i32* %2, double* %3, i32 0)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_kflag(int);
void foo(int x) {
  if (x)
    __builtin_arc_kflag(x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112d <foo+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <__builtin_arc_kflag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     1119 <foo+0x9>
jmp    1030 <__builtin_arc_kflag@plt>
ret

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @__builtin_arc_kflag(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
void RTSemEventMultiAddSignaller(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventMultiAddSignaller() {
ret void
}
int iscomment(char sym) { return (sym == '#'); }


x86 assembly (clang, -O0):
<iscomment>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x23,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscomment>:
xor    %eax,%eax
cmp    $0x23,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @iscomment(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 35
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @iscomment(i8 signext %0) {
%2 = icmp eq i8 %0, 35
%3 = zext i1 %2 to i32
ret i32 %3
}
float isNotZero(float x) {
  if ((x > -1e-7) && (x < 1e-7))
    return 0.0F;
  return x;
}


x86 assembly (clang, -O0):
<isNotZero>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114c <isNotZero+0x4c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed3(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114c <isNotZero+0x4c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1156 <isNotZero+0x56>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNotZero>:
cvtss2sd %xmm0,%xmm2
movsd  0xef4(%rip),%xmm1
ucomisd %xmm2,%xmm1
xorpd  %xmm1,%xmm1
jbe    1125 <isNotZero+0x25>
ucomisd 0xeea(%rip),%xmm2
jbe    1132 <isNotZero+0x32>
movapd %xmm1,%xmm0
ret
movaps %xmm0,%xmm1
ucomisd 0xed8(%rip),%xmm2
ja     1120 <isNotZero+0x20>
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @isNotZero(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 0xBE7AD7F29ABCAF48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp olt double %9, 0x3E7AD7F29ABCAF48
br i1 %10, label %11, label %12
11: ; preds = %7
store float 0.000000e+00, float* %2
br label %14
12: ; preds = %7, %1
%13 = load float, float* %3
store float %13, float* %2
br label %14
14: ; preds = %12, %11
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @isNotZero(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ogt double %2, 0xBE7AD7F29ABCAF48
%4 = fcmp olt double %2, 0x3E7AD7F29ABCAF48
%5 = and i1 %3, %4
%6 = select i1 %5, float 0.000000e+00, float %0
ret float %6
}
void ENGINE_load_dynamic(void) {}


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

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

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

LLVM IR (-O2):
define void @ENGINE_load_dynamic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_NormalizeQuaternion_init(void) {
  _hmt_register_covercase("HMM_NormalizeQuaternion", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_NormalizeQuaternion_init>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"HMM_NormalizeQuaternion\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_NormalizeQuaternion_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"HMM_NormalizeQuaternion\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_NormalizeQuaternion_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "Usage %s options\n", progname);
  fprintf(stderr, "-n NCOLORS  allcoate NCOLORS colors\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xece(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Usage %s options\0A\00"
@.str.1 = [37 x i8] c"-n NCOLORS allcoate NCOLORS colors\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Usage %s options\0A\00"
@.str.1 = [37 x i8] c"-n NCOLORS allcoate NCOLORS colors\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double sinus(double, int);
double cos(double arg) {
  if (arg < 0)
    arg = -arg;
  return sinus(arg, 1);
}


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114c <cos+0x3c>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <sinus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
movapd 0xee8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
mov    $0x1,%edi
jmp    1030 <sinus@plt>

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = call double @sinus(double %9, i32 1)
ret double %10
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = tail call double @sinus(double %4, i32 1)
ret double %5
}
void bar(int *pc) {
  static const void *l[] = {&&lab0, &&end};
  foo(0);
  goto *l[*pc];
lab0:
  foo(0);
  pc++;
  goto *l[*pc];
end:
  return;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
lea    0x2efd(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    1176 <bar+0x66>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
lea    0x2ecd(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    1176 <bar+0x66>
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<bar>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <foo@plt>
movslq (%rbx),%rax
lea    0x2ce6(%rip),%r14
jmp    *(%r14,%rax,8)
xchg   %ax,%ax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <foo@plt>
add    $0x4,%rbx
movslq (%rbx),%rax
jmp    *(%r14,%rax,8)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@bar.l = internal global [2 x i8*] [i8* blockaddress(@bar, %9), i8* blockaddress(@bar, %18)]
define void @bar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 0)
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* @bar.l, i64 0, i64 %6
%8 = load i8*, i8** %7
br label %19
9: ; preds = %19
%10 = call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 0)
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %2
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2 x i8*], [2 x i8*]* @bar.l, i64 0, i64 %15
%17 = load i8*, i8** %16
br label %19
18: ; preds = %19
ret void
19: ; preds = %9, %1
%20 = phi i8* [ %8, %1 ], [ %17, %9 ]
indirectbr i8* %20, [label %9, label %18]
}

LLVM IR (-O2):
@bar.l = internal unnamed_addr constant [2 x i8*] [i8* blockaddress(@bar, %3), i8* blockaddress(@bar, %6)]
define void @bar(i32* nocapture %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 0)
br label %7
3: ; preds = %7
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 0)
%5 = getelementptr inbounds i32, i32* %8, i64 1
br label %7
6: ; preds = %7
ret void
7: ; preds = %3, %1
%8 = phi i32* [ %0, %1 ], [ %5, %3 ]
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x i8*], [2 x i8*]* @bar.l, i64 0, i64 %10
%12 = load i8*, i8** %11
indirectbr i8* %12, [label %3, label %6]
}