xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ contains_only_valid_bases(char const *);
char *sequence_from_file(char const *);
char *strdup(char const *);
char *sequence(const char *arg) {
  return contains_only_valid_bases(arg) ? strdup(arg) : sequence_from_file(arg);
}


x86 assembly (clang, -O0):
<sequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <contains_only_valid_bases@plt>
cmp    $0x0,%rax
je     1161 <sequence+0x31>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
jmp    116e <sequence+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <sequence_from_file@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence>:
push   %rbx
mov    %rdi,%rbx
call   1040 <contains_only_valid_bases@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1147 <sequence+0x17>
pop    %rbx
jmp    1050 <strdup@plt>
pop    %rbx
jmp    1030 <sequence_from_file@plt>

LLVM IR (-O0):
define i8* @sequence(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @contains_only_valid_bases(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i8* @strdup(i8* %7)
br label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i8* @sequence_from_file(i8* %10)
br label %12
12: ; preds = %9, %6
%13 = phi i8* [ %8, %6 ], [ %11, %9 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @sequence(i8* %0) {
%2 = tail call i64 @contains_only_valid_bases(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @strdup(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i8* @sequence_from_file(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
int bail(char *why1, char *why2) {
  fprintf(stderr, "gzjoin error: %s%s, output incomplete\n", why1, why2);
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bail>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"gzjoin error: %s%s, output incomplete\0A\00"
define i32 @bail(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"gzjoin error: %s%s, output incomplete\0A\00"
define i32 @bail(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void EraseScrAll() { WRITETEST("\033[2J"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @EraseScrAll() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int bcd_weekday(const char *bcd) {
  return ((((((bcd_mjd(bcd)) - 1) % (7)) + (7)) % (7)) + 1);
}


x86 assembly (clang, -O0):
<bcd_weekday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <bcd_mjd@plt>
sub    $0x1,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x7,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd_weekday>:
push   %rax
xor    %eax,%eax
call   1030 <bcd_mjd@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
movslq %ecx,%rcx
imul   $0xffffffff92492493,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0xffffffff,%eax
add    $0x7,%al
movzbl %al,%eax
lea    (%rax,%rax,8),%ecx
lea    (%rax,%rcx,4),%ecx
shr    $0x8,%ecx
mov    %eax,%edx
sub    %cl,%dl
shr    %dl
add    %cl,%dl
shr    $0x2,%dl
movzbl %dl,%ecx
lea    0x0(,%rcx,8),%edx
sub    %ecx,%edx
sub    %dl,%al
add    $0x1,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bcd_weekday(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @bcd_mjd to i32 (i8*, ...)*)(i8* %3)
%5 = sub nsw i32 %4, 1
%6 = srem i32 %5, 7
%7 = add nsw i32 %6, 7
%8 = srem i32 %7, 7
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @bcd_weekday(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bcd_mjd to i32 (i8*, ...)*)(i8* %0)
%3 = add nsw i32 %2, -1
%4 = srem i32 %3, 7
%5 = trunc i32 %4 to i8
%6 = add nsw i8 %5, 7
%7 = urem i8 %6, 7
%8 = add nuw nsw i8 %7, 1
%9 = zext i8 %8 to i32
ret i32 %9
}
/* Variables and functions */
int csum_partial(char *, int, int);
int /*<<< orphan*/ memcpy(char *, char *, int);
unsigned int csum_partial_copy(char *src, char *dst, int len, int sum) {
  sum = csum_partial(src, len, sum);
  memcpy(dst, src, len);
  return sum;
}


x86 assembly (clang, -O0):
<csum_partial_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <csum_partial@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_partial_copy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <csum_partial@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @csum_partial_copy(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @csum_partial(i8* %0, i32 %2, i32 %3)
%6 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t make_vga_entry(char c, uint8_t color) {
  return ((uint16_t)c) | ((uint16_t)color) << 8;
}


x86 assembly (clang, -O0):
<make_vga_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @make_vga_entry(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @make_vga_entry(i8 signext %0, i64 %1) {
%3 = sext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 8
%6 = or i32 %5, %3
ret i32 %6
}
int test_imm_78int16_reg(short val) {
  return ((val) & (0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x78,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_78int16_reg>:
test   $0x78,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_78int16_reg(i16 signext %0) {
%2 = and i16 %0, 120
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void double_unlock_bad(pthread_mutex_t *m) {
  pthread_mutex_unlock(m);
  pthread_mutex_unlock(m);
}


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

x86 assembly (clang, -O2):
<double_unlock_bad>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pthread_mutex_unlock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define void @double_unlock_bad(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int xfread_value(int /*<<< orphan*/ *, char *, int);
int xfread_word(FILE *fp, char *filename) {
  return xfread_value(fp, filename, 2) & 0xFFFF;
}


x86 assembly (clang, -O0):
<xfread_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <xfread_value@plt>
and    $0xffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfread_word>:
push   %rax
mov    $0x2,%edx
call   1030 <xfread_value@plt>
movzwl %ax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xfread_word(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @xfread_value(i32* %5, i8* %6, i32 2)
%8 = and i32 %7, 65535
ret i32 %8
}

LLVM IR (-O2):
define i32 @xfread_word(i32* %0, i8* %1) {
%3 = tail call i32 @xfread_value(i32* %0, i8* %1, i32 2)
%4 = and i32 %3, 65535
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ get_imull_ops();
int /*<<< orphan*/ get_imull_ops_len();
int /*<<< orphan*/ write_bytes(char *, unsigned char *, unsigned int,
                               unsigned int *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void output_multiply(unsigned char *buf, unsigned int buf_size,
                     unsigned int *bytes_written) {
  write_bytes("multiply", buf, buf_size, bytes_written, get_imull_ops(),
              get_imull_ops_len());
}


x86 assembly (clang, -O0):
<output_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <get_imull_ops@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <get_imull_ops_len@plt>
mov    -0x38(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    %eax,%r9d
lea    0xe7d(%rip),%rdi
call   1040 <write_bytes@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_multiply>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <get_imull_ops@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <get_imull_ops_len@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
mov    %ebp,%r8d
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <write_bytes@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"multiply\00"
define void @output_multiply(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 (...) @get_imull_ops()
%11 = call i32 (...) @get_imull_ops_len()
%12 = call i32 @write_bytes(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i32* %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"multiply\00"
define void @output_multiply(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 (...) @get_imull_ops()
%5 = tail call i32 (...) @get_imull_ops_len()
%6 = tail call i32 @write_bytes(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32* %2, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int value_to_hex_character(char);
void print_byte(char value) {
  char ah = value / 16;
  char al = value % 16;
  printf("%c%c", value_to_hex_character(ah), value_to_hex_character(al));
}


x86 assembly (clang, -O0):
<print_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%edi
call   1040 <value_to_hex_character@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x3(%rbp),%edi
call   1040 <value_to_hex_character@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %ebx,%eax
sar    $0x7,%al
shr    $0x4,%al
add    %bl,%al
mov    %eax,%ecx
and    $0xf0,%cl
sub    %cl,%bl
sar    $0x4,%al
movsbl %al,%edi
call   1040 <value_to_hex_character@plt>
mov    %eax,%ebp
movsbl %bl,%edi
call   1040 <value_to_hex_character@plt>
lea    0xeae(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%c%c\00"
define void @print_byte(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = sdiv i32 %6, 16
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = srem i32 %10, 16
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i8, i8* %3
%14 = call i32 @value_to_hex_character(i8 signext %13)
%15 = load i8, i8* %4
%16 = call i32 @value_to_hex_character(i8 signext %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c%c\00"
define void @print_byte(i8 signext %0) {
%2 = sdiv i8 %0, 16
%3 = srem i8 %0, 16
%4 = tail call i32 @value_to_hex_character(i8 signext %2)
%5 = tail call i32 @value_to_hex_character(i8 signext %3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
short EOF;
scalar_t__ feof(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
short geth(FILE *iop) {
  union {
    unsigned short w;
    short s;
  } r;
  r.w = getc(iop);
  r.w += (getc(iop) << 8);
  if (feof(iop))
    return (EOF);
  return ((int)r.s);
}


x86 assembly (clang, -O0):
<geth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getc@plt>
mov    %ax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,%ecx
shl    $0x8,%ecx
movzwl -0x18(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%rax
je     1177 <geth+0x57>
mov    0x2e7d(%rip),%rax
mov    (%rax),%ax
mov    %ax,-0x2(%rbp)
jmp    117f <geth+0x5f>
movswl -0x18(%rbp),%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geth>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbp
call   1040 <getc@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
call   1040 <getc@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <feof@plt>
test   %rax,%rax
je     1152 <geth+0x32>
mov    0x2e9b(%rip),%rax
movzwl (%rax),%ebx
jmp    1158 <geth+0x38>
shl    $0x8,%ebx
add    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%union.anon = type { i16 }
@EOF = global i16 0
define signext i16 @geth(i32* %0) {
%2 = alloca i16
%3 = alloca i32*
%4 = alloca %union.anon
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @getc(i32* %5)
%7 = trunc i32 %6 to i16
%8 = bitcast %union.anon* %4 to i16*
store i16 %7, i16* %8
%9 = load i32*, i32** %3
%10 = call i32 @getc(i32* %9)
%11 = shl i32 %10, 8
%12 = bitcast %union.anon* %4 to i16*
%13 = load i16, i16* %12
%14 = zext i16 %13 to i32
%15 = add nsw i32 %14, %11
%16 = trunc i32 %15 to i16
store i16 %16, i16* %12
%17 = load i32*, i32** %3
%18 = call i64 @feof(i32* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %1
%21 = load i16, i16* @EOF
store i16 %21, i16* %2
br label %27
22: ; preds = %1
%23 = bitcast %union.anon* %4 to i16*
%24 = load i16, i16* %23
%25 = sext i16 %24 to i32
%26 = trunc i32 %25 to i16
store i16 %26, i16* %2
br label %27
27: ; preds = %22, %20
%28 = load i16, i16* %2
ret i16 %28
}

LLVM IR (-O2):
@EOF = global i16 0
define signext i16 @geth(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = tail call i64 @feof(i32* %0)
%5 = icmp eq i64 %4, 0
%6 = load i16, i16* @EOF
%7 = shl i32 %3, 8
%8 = add i32 %7, %2
%9 = trunc i32 %8 to i16
%10 = select i1 %5, i16 %9, i16 %6
ret i16 %10
}
void chx_prio_init(void) {}


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

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

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

LLVM IR (-O2):
define void @chx_prio_init() {
ret void
}
int guppy_instance_post_setup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @guppy_instance_post_setup() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void put32bits(uint8_t **buffer, uint32_t value) {
  value = htonl(value);
  memcpy(*buffer, &value, 4);
  *buffer += 4;
}


x86 assembly (clang, -O0):
<put32bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put32bits>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
mov    (%rbx),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
addq   $0x10,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @put32bits(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 = call i32 @htonl(i32 %5)
store i32 %6, i32* %4
%7 = load i32**, i32*** %3
%8 = load i32*, i32** %7
%9 = call i32 @memcpy(i32* %8, i32* %4, i32 4)
%10 = load i32**, i32*** %3
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32* %12, i32** %10
ret void
}

LLVM IR (-O2):
define void @put32bits(i32** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htonl(i32 %1)
store i32 %4, i32* %3
%5 = load i32*, i32** %0
%6 = call i32 @memcpy(i32* %5, i32* %3, i32 4)
%7 = load i32*, i32** %0
%8 = getelementptr inbounds i32, i32* %7, i64 4
store i32* %8, i32** %0
ret void
}
void _Z16_Jv_SetStackSizePKc(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z16_Jv_SetStackSizePKc() {
ret void
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int is_newline(wchar_t ch) { return ch == '\n' || ch == '\f' || ch == '\v'; }


x86 assembly (clang, -O0):
<is_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_newline+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_newline+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xb,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_newline>:
mov    $0x1,%eax
cmp    $0xa,%dil
je     1111 <is_newline+0x11>
cmp    $0xc,%dil
jne    1112 <is_newline+0x12>
ret
xor    %eax,%eax
cmp    $0xb,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_newline(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, 10
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 12
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 11
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_newline(i8 signext %0) {
switch i8 %0, label %2 [
i8 12, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
char *strrchr(char *, char);
void expe2d(char *cp) {
  char *expchar = strrchr(cp, 'e');
  if (expchar) {
    *expchar = 'd';
  }
}


x86 assembly (clang, -O0):
<expe2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x65,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <expe2d+0x30>
mov    -0x10(%rbp),%rax
movb   $0x64,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expe2d>:
push   %rax
mov    $0x65,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1123 <expe2d+0x13>
movb   $0x64,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @expe2d(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 101)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 100, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @expe2d(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 101)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 100, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nclogtextn(int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void nclogtext(int tag, const char *text) {
  nclogtextn(tag, text, strlen(text));
}


x86 assembly (clang, -O0):
<nclogtext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <nclogtextn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nclogtext>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <nclogtextn@plt>

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

LLVM IR (-O2):
define void @nclogtext(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @nclogtextn(i32 %0, i8* %1, i32 %3)
ret void
}
int test_imm_62int16_reg(short val) {
  return ((val) & (0x62 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_62int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x62,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_62int16_reg>:
test   $0x62,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_62int16_reg(i16 signext %0) {
%2 = and i16 %0, 98
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned int const S(unsigned int const *, int);
unsigned int Sig1(const unsigned int *x) {
  return S(x, 17) ^ S(x, 19) ^ (*x >> 10);
}


x86 assembly (clang, -O0):
<Sig1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x11,%esi
call   1030 <S@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x13,%esi
call   1030 <S@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
shr    $0xa,%ecx
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sig1>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x11,%esi
call   1030 <S@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x13,%esi
call   1030 <S@plt>
xor    %ebp,%eax
mov    (%rbx),%ecx
shr    $0xa,%ecx
xor    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Sig1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @S(i32* %3, i32 17)
%5 = load i32*, i32** %2
%6 = call i32 @S(i32* %5, i32 19)
%7 = xor i32 %4, %6
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = lshr i32 %9, 10
%11 = xor i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @Sig1(i32* %0) {
%2 = tail call i32 @S(i32* %0, i32 17)
%3 = tail call i32 @S(i32* %0, i32 19)
%4 = xor i32 %3, %2
%5 = load i32, i32* %0
%6 = lshr i32 %5, 10
%7 = xor i32 %4, %6
ret i32 %7
}
int last_digit(int num) {
  while (num / 10 != 0)
    num /= 10;
  return num;
}


x86 assembly (clang, -O0):
<last_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     112e <last_digit+0x2e>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1107 <last_digit+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_digit>:
mov    %edi,%eax
lea    0x9(%rax),%ecx
cmp    $0x13,%ecx
jb     1131 <last_digit+0x31>
nopw   0x0(%rax,%rax,1)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <last_digit+0x10>
ret

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

LLVM IR (-O2):
define i32 @last_digit(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nsw i32 %6, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i32 [ %0, %1 ], [ %6, %4 ]
ret i32 %10
}
int test_imm_CFint64_lowword_reg(long long val) {
  return ((val) & (0xCF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CFint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xcf,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CFint64_lowword_reg>:
test   $0xcf,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CFint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 207
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void MSP430TimerM$CompareB0$fired(void) {
  MSP430TimerM$CompareB0$default$fired();
}


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

x86 assembly (clang, -O2):
<MSP430TimerM$CompareB0$fired>:
xor    %eax,%eax
jmp    1030 <MSP430TimerM$CompareB0$default$fired@plt>

LLVM IR (-O0):
define void @"MSP430TimerM$CompareB0$fired"() {
%1 = call i32 (...) @"MSP430TimerM$CompareB0$default$fired"()
ret void
}

LLVM IR (-O2):
define void @"MSP430TimerM$CompareB0$fired"() {
%1 = tail call i32 (...) @"MSP430TimerM$CompareB0$default$fired"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
int main(void) {
  panic("hello world!\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 <panic@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_bi_w_epel_v6_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_v6_8_sse4() {
ret void
}
/* Type definitions */
struct timezone {
  int tz_minuteswest;
  int tz_dsttime;
};

/* Variables and functions */
int settimeofday(int /*<<< orphan*/, struct timezone *);
int set_tz(int min, int dst) {
  struct timezone tz;
  tz.tz_minuteswest = min;
  tz.tz_dsttime = dst;
  return settimeofday(0, &tz);
}


x86 assembly (clang, -O0):
<set_tz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
lea    -0x10(%rbp),%rsi
call   1030 <settimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timezone = type { i32, i32 }
define i32 @set_tz(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timezone
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.timezone, %struct.timezone* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.timezone, %struct.timezone* %5, i32 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @settimeofday(i32 0, %struct.timezone* %5)
ret i32 %10
}

LLVM IR (-O2):
%struct.timezone = type { i32, i32 }
define i32 @set_tz(i32 %0, i32 %1) {
%3 = alloca %struct.timezone
%4 = bitcast %struct.timezone* %3 to i8*
%5 = getelementptr inbounds %struct.timezone, %struct.timezone* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timezone, %struct.timezone* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i32 @settimeofday(i32 0, %struct.timezone* %3)
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ requestor;
};
struct TYPE_4__ {
  TYPE_1__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xselectionrequest_requestor(void *_p) {
  return (unsigned long)((XEvent *)_p)->xselectionrequest.requestor;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xselectionrequest_requestor(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ signbit(double);
double fabs(double x) { return signbit(x) ? -x : x; }


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <signbit@plt>
cmp    $0x0,%rax
je     1157 <fabs+0x47>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <fabs+0x51>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
call   1030 <signbit@plt>
test   %rax,%rax
je     1132 <fabs+0x22>
movaps (%rsp),%xmm0
xorps  0xed3(%rip),%xmm0
add    $0x18,%rsp
ret
movaps (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @signbit(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = fneg double %7
br label %11
9: ; preds = %1
%10 = load double, double* %2
br label %11
11: ; preds = %9, %6
%12 = phi double [ %8, %6 ], [ %10, %9 ]
ret double %12
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = tail call i64 @signbit(double %0)
%3 = icmp eq i64 %2, 0
%4 = fneg double %0
%5 = select i1 %3, double %0, double %4
ret double %5
}
double f(double x, double y[], int i) {
  if (i == 0)
    return (y[1]);
  if (i == 1)
    return (-1 * y[0]);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    112d <f+0x2d>
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114c <f+0x4c>
cmpl   $0x1,-0x1c(%rbp)
jne    114c <f+0x4c>
mov    -0x18(%rbp),%rax
movsd  0xebd(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x1,%esi
je     110f <f+0xf>
test   %esi,%esi
jne    111a <f+0x1a>
movsd  0x8(%rdi),%xmm0
ret
movsd  (%rdi),%xmm0
xorps  0xee6(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0, double* %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca i32
store double %0, double* %5
store double* %1, double** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load double*, double** %6
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
store double %13, double* %4
br label %22
14: ; preds = %3
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = fmul double -1.000000e+00, %20
store double %21, double* %4
br label %22
22: ; preds = %10, %17, %14
%23 = load double, double* %4
ret double %23
}

LLVM IR (-O2):
define double @f(double %0, double* nocapture %1, i32 %2) {
switch i32 %2, label %10 [
i32 0, label %4
i32 1, label %7
]
4: ; preds = %3
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
br label %10
7: ; preds = %3
%8 = load double, double* %1
%9 = fneg double %8
br label %10
10: ; preds = %3, %4, %7
%11 = phi double [ %6, %4 ], [ %9, %7 ], [ undef, %3 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "http [-n numthreads] [-s seconds] [-t] ip port path\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"http [-n numthreads] [-s seconds] [-t] ip port path\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"http [-n numthreads] [-s seconds] [-t] ip port path\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
struct vec4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec4_subtract(float *, float *, float *);
__attribute__((always_)) struct vec4 *
psvec4_subtract(struct vec4 *result, struct vec4 *a, struct vec4 *b) {
  vec4_subtract((float *)result, (float *)a, (float *)b);
  return result;
}


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

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

LLVM IR (-O0):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_subtract(%struct.vec4* %0, %struct.vec4* %1, %struct.vec4* %2) {
%4 = alloca %struct.vec4*
%5 = alloca %struct.vec4*
%6 = alloca %struct.vec4*
store %struct.vec4* %0, %struct.vec4** %4
store %struct.vec4* %1, %struct.vec4** %5
store %struct.vec4* %2, %struct.vec4** %6
%7 = load %struct.vec4*, %struct.vec4** %4
%8 = bitcast %struct.vec4* %7 to float*
%9 = load %struct.vec4*, %struct.vec4** %5
%10 = bitcast %struct.vec4* %9 to float*
%11 = load %struct.vec4*, %struct.vec4** %6
%12 = bitcast %struct.vec4* %11 to float*
%13 = call i32 @vec4_subtract(float* %8, float* %10, float* %12)
%14 = load %struct.vec4*, %struct.vec4** %4
ret %struct.vec4* %14
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_subtract(%struct.vec4* returned %0, %struct.vec4* %1, %struct.vec4* %2) {
%4 = bitcast %struct.vec4* %0 to float*
%5 = bitcast %struct.vec4* %1 to float*
%6 = bitcast %struct.vec4* %2 to float*
%7 = tail call i32 @vec4_subtract(float* %4, float* %5, float* %6)
ret %struct.vec4* %0
}
void foregr_() {}


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

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

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

LLVM IR (-O2):
define void @foregr_() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glTexCoord2s(int /*<<< orphan*/, int /*<<< orphan*/);
void TexCoord2s(GLshort s, GLshort t) { glTexCoord2s(s, t); }


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

x86 assembly (clang, -O2):
<TexCoord2s>:
jmp    1030 <glTexCoord2s@plt>

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

LLVM IR (-O2):
define void @TexCoord2s(i32 %0, i32 %1) {
%3 = tail call i32 @glTexCoord2s(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_put_hex(unsigned int, int);
int /*<<< orphan*/ serial_puts(char *);
void do_exception(unsigned reason) {
  serial_puts("Enter Exception:");
  serial_put_hex(reason, 32);
  (*((volatile unsigned *)(0xc1100000 + ((0x2640) << 2))) =
       (1 << 22) | 1000000);
}


x86 assembly (clang, -O0):
<do_exception>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <serial_puts@plt>
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
call   1040 <serial_put_hex@plt>
mov    $0xc1109900,%eax
movl   $0x4f4240,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_exception>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <serial_puts@plt>
mov    %ebx,%edi
mov    $0x20,%esi
call   1040 <serial_put_hex@plt>
mov    $0xc1109900,%eax
movl   $0x4f4240,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter Exception:\00"
define void @do_exception(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @serial_puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @serial_put_hex(i32 %4, i32 32)
store volatile i32 5194304, i32* inttoptr (i64 3239090432 to i32*)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter Exception:\00"
define void @do_exception(i32 %0) {
%2 = tail call i32 @serial_puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @serial_put_hex(i32 %0, i32 32)
store volatile i32 5194304, i32* inttoptr (i64 3239090432 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_106() {
  Assert_real((isqrt(106) == 10),
              "/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",
              535, ("Integer square root of 106 should be 10"));
}


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

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