xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char **argv) { printf("Usage: %s num_volume\n", argv[0]); }


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

x86 assembly (clang, -O2):
<print_usage>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: %s num_volume\0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: %s num_volume\0A\00"
define void @print_usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void handle_error(int error) {
  fprintf(stderr, "Error: %s\n", strerror(error));
}


x86 assembly (clang, -O0):
<handle_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_error>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
call   1040 <strerror@plt>
lea    0xeca(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @handle_error(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* @strerror(i32 %0)
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
unsigned char to_uchar(char ch) { return ch; }


x86 assembly (clang, -O0):
<to_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @to_uchar(i8 returned signext %0) {
ret i8 %0
}
int test_imm_C2uint16_reg(unsigned short val) {
  return ((val) & (0xC2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C2uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 194
%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_C2uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 194
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void interchange(int u, int v) {
  int temp;
  printf("Originally u = %d and v = %d.\n", u, v);
  temp = u;
  u = v;
  v = temp;
  printf("Now u = %d and v = %d.\n", u, v);
}


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

x86 assembly (clang, -O2):
<interchange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Originally u = %d and v = %d.\0A\00"
@.str.1 = [24 x i8] c"Now u = %d and v = %d.\0A\00"
define void @interchange(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
store i32 %9, i32* %5
%10 = load i32, i32* %4
store i32 %10, i32* %3
%11 = load i32, i32* %5
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Originally u = %d and v = %d.\0A\00"
@.str.1 = [24 x i8] c"Now u = %d and v = %d.\0A\00"
define void @interchange(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int test();
main() {
  printf("hello world!\n");
  printf("%d\c\n", test());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%dc\0A\00"
@str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
unsigned int __gnu_h2f_internal(unsigned int, int /*<<< orphan*/);
unsigned int __gnu_h2f_alternative(unsigned int a) {
  return __gnu_h2f_internal(a, 0);
}


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

x86 assembly (clang, -O2):
<__gnu_h2f_alternative>:
xor    %esi,%esi
jmp    1030 <__gnu_h2f_internal@plt>

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

LLVM IR (-O2):
define i32 @__gnu_h2f_alternative(i32 %0) {
%2 = tail call i32 @__gnu_h2f_internal(i32 %0, i32 0)
ret i32 %2
}
int am33xx_bbu_emmc_mlo_register_handler(const char *name, char *devicefile) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @am33xx_bbu_emmc_mlo_register_handler(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @am33xx_bbu_emmc_mlo_register_handler(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void dosfsck_sd() {
  system("/ipc/html/cgi-bin/dosfsck  -v -a /dev/mmc/blk0/part1");
  return;
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"/ipc/html/cgi-bin/dosfsck -v -a /dev/mmc/blk0/part1\00"
define void @dosfsck_sd() {
%1 = call i32 @system(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"/ipc/html/cgi-bin/dosfsck -v -a /dev/mmc/blk0/part1\00"
define void @dosfsck_sd() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rl();
int main() {
  rl();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rl()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REQ;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_bio(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ **);
int /*<<< orphan*/ X509_REQ_it;
X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req) {
  return ASN1_item_d2i_bio(&X509_REQ_it, bp, req);
}


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

x86 assembly (clang, -O2):
<d2i_X509_REQ_bio>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2edb(%rip),%rdi
jmp    1030 <ASN1_item_d2i_bio@plt>

LLVM IR (-O0):
@X509_REQ_it = global i32 0
define i32* @d2i_X509_REQ_bio(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* @ASN1_item_d2i_bio(i32* @X509_REQ_it, i32* %5, i32** %6)
ret i32* %7
}

LLVM IR (-O2):
@X509_REQ_it = global i32 0
define i32* @d2i_X509_REQ_bio(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_bio(i32* @X509_REQ_it, i32* %0, i32** %1)
ret i32* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int ftruncate(int file, off_t length) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<ftruncate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebe(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftruncate>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @ftruncate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @ftruncate(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
void SysCtlPeripheralEnable(unsigned long i) {}


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

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

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

LLVM IR (-O2):
define void @SysCtlPeripheralEnable(i64 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t min_i32(int32_t a, int32_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min_i32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min_i32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_i32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_i32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min_i32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int ansirev(state)
int state;
{
  static int oldstate = 0;
  if (state == oldstate)
    return (0);
  oldstate = state;
  ttflush();
  ttputc(0x1B);
  ttputc('[');
  ttputc(state ? '7' : '0');
  ttputc('m');
  return 0;
}


x86 assembly (clang, -O0):
<ansirev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    0x2f00(%rip),%eax
jne    1146 <ansirev+0x26>
movl   $0x0,-0x4(%rbp)
jmp    119b <ansirev+0x7b>
mov    -0x8(%rbp),%eax
mov    %eax,0x2ee5(%rip)
mov    $0x0,%al
call   1030 <ttflush@plt>
mov    $0x1b,%edi
mov    $0x0,%al
call   1040 <ttputc@plt>
mov    $0x5b,%edi
mov    $0x0,%al
call   1040 <ttputc@plt>
mov    -0x8(%rbp),%ecx
mov    $0x30,%edi
mov    $0x37,%eax
cmp    $0x0,%ecx
cmovne %eax,%edi
mov    $0x0,%al
call   1040 <ttputc@plt>
mov    $0x6d,%edi
mov    $0x0,%al
call   1040 <ttputc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ansirev>:
push   %rbx
cmp    %edi,0x2f0d(%rip)
je     1172 <ansirev+0x52>
mov    %edi,%ebx
mov    %edi,0x2f03(%rip)
xor    %eax,%eax
call   1030 <ttflush@plt>
mov    $0x1b,%edi
xor    %eax,%eax
call   1040 <ttputc@plt>
mov    $0x5b,%edi
xor    %eax,%eax
call   1040 <ttputc@plt>
test   %ebx,%ebx
mov    $0x30,%eax
mov    $0x37,%edi
cmove  %eax,%edi
xor    %eax,%eax
call   1040 <ttputc@plt>
mov    $0x6d,%edi
xor    %eax,%eax
call   1040 <ttputc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@ansirev.oldstate = internal global i32 0
define i32 @ansirev(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @ansirev.oldstate
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* @ansirev.oldstate
%10 = call i32 (...) @ttflush()
%11 = call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 27)
%12 = call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 91)
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 55, i32 48
%17 = call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 %16)
%18 = call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 109)
store i32 0, i32* %2
br label %19
19: ; preds = %8, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@ansirev.oldstate = internal unnamed_addr global i32 0
define i32 @ansirev(i32 %0) {
%2 = load i32, i32* @ansirev.oldstate
%3 = icmp eq i32 %2, %0
br i1 %3, label %12, label %4
4: ; preds = %1
store i32 %0, i32* @ansirev.oldstate
%5 = tail call i32 (...) @ttflush()
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 27)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 91)
%8 = icmp eq i32 %0, 0
%9 = select i1 %8, i32 48, i32 55
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 %9)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @ttputc to i32 (i32, ...)*)(i32 109)
br label %12
12: ; preds = %1, %4
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t min32(int32_t x, int32_t y) { return (x <= y) ? x : y; }


x86 assembly (clang, -O0):
<min32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1127 <min32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min32>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @min32(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int draw_block4x4_uncompressed_r_half_float(const unsigned char *bitstring,
                                            unsigned int *image_buffer,
                                            int flags) {
  *(uint64_t *)&image_buffer[0] = *(uint64_t *)&bitstring[0];
  return 1;
}


x86 assembly (clang, -O0):
<draw_block4x4_uncompressed_r_half_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_block4x4_uncompressed_r_half_float>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @draw_block4x4_uncompressed_r_half_float(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 = getelementptr inbounds i8, i8* %7, i64 0
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 %10, i32* %12
ret i32 1
}

LLVM IR (-O2):
define i32 @draw_block4x4_uncompressed_r_half_float(i8* nocapture %0, i32* nocapture writeonly %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
store i32 %5, i32* %1
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
wchar_t *wcscpy(wchar_t *__restrict dst, const wchar_t *__restrict src) {
  register wchar_t *dscan = dst;
  register const wchar_t *sscan = src;
  if (!sscan)
    return (dst);
  while ((*dscan++ = *sscan++) != L'\0')
    continue;
  return (dst);
}


x86 assembly (clang, -O0):
<wcscpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1134 <wcscpy+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <wcscpy+0x71>
jmp    1139 <wcscpy+0x39>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     1169 <wcscpy+0x69>
jmp    1139 <wcscpy+0x39>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcscpy>:
mov    %rdi,%rax
test   %rsi,%rsi
je     111e <wcscpy+0x1e>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    (%rsi,%rcx,1),%edx
mov    %edx,(%rax,%rcx,1)
add    $0x4,%rcx
test   %edx,%edx
jne    1110 <wcscpy+0x10>
ret

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

LLVM IR (-O2):
define i32* @wcscpy(i32* noalias returned writeonly %0, i32* noalias %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32* [ %9, %4 ], [ %0, %2 ]
%6 = phi i32* [ %7, %4 ], [ %1, %2 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %6
%9 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %8, i32* %5
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ get_strval(char *);
int /*<<< orphan*/ set_numvar(char *, int);
int system(int /*<<< orphan*/);
void cmd_shell(char *str) {
  int retcode;
  retcode = system(get_strval(str));
  set_numvar("#RETCODE", retcode);
}


x86 assembly (clang, -O0):
<cmd_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_strval@plt>
mov    %eax,%edi
call   1030 <system@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1050 <set_numvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_shell>:
push   %rax
call   1040 <get_strval@plt>
mov    %eax,%edi
call   1030 <system@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1050 <set_numvar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"#RETCODE\00"
define void @cmd_shell(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @get_strval(i8* %4)
%6 = call i32 @system(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @set_numvar(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"#RETCODE\00"
define void @cmd_shell(i8* %0) {
%2 = tail call i32 @get_strval(i8* %0)
%3 = tail call i32 @system(i32 %2)
%4 = tail call i32 @set_numvar(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
unsigned long long byteswap64(unsigned long long x) {
  return __builtin_bswap64(x);
}


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

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

LLVM IR (-O0):
define i64 @byteswap64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.bswap.i64(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @byteswap64(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
int test_imm_B0int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xB0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B0int64_midword_mem>:
testb  $0xb0,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B0int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11534336
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void func_ull_ull(unsigned long long l1, unsigned long long l2) {}


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

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

LLVM IR (-O0):
define void @func_ull_ull(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @func_ull_ull(i64 %0, i64 %1) {
ret void
}
double GPS_Math_Deg_To_Rad(double v) {
  return v * (double)((double)3.141592653589 / (double)180.);
}


x86 assembly (clang, -O0):
<GPS_Math_Deg_To_Rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPS_Math_Deg_To_Rad>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @GPS_Math_Deg_To_Rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3F91DF46A2529843
ret double %4
}

LLVM IR (-O2):
define double @GPS_Math_Deg_To_Rad(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529843
ret double %2
}
int ltt_get_alignment(void) { return sizeof(void *); }


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

x86 assembly (clang, -O2):
<ltt_get_alignment>:
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @ltt_get_alignment() {
ret i32 8
}

LLVM IR (-O2):
define i32 @ltt_get_alignment() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("pkttype options:\n"
         "--pkttype-type    [!] type: class the packet belongs to\n"
         "Possible values: broadcast, multicast, host, otherhost any byte "
         "value.\n");
}


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

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

LLVM IR (-O0):
@.str = [145 x i8] c"pkttype options:\0A--pkttype-type [!] type: class the packet belongs to\0APossible values: broadcast, multicast, host, otherhost any byte value.\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [144 x i8] c"pkttype options:\0A--pkttype-type [!] type: class the packet belongs to\0APossible values: broadcast, multicast, host, otherhost any byte value.\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([144 x i8], [144 x i8]* @str, i64 0, i64 0))
ret void
}
double rosenbrok(double x, double y) {
  double f = (x * x - y);
  return f * f + x * x * 0.1;
}


x86 assembly (clang, -O0):
<rosenbrok>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xea3(%rip),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rosenbrok>:
mulsd  %xmm0,%xmm0
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
mulsd  0xeec(%rip),%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @rosenbrok(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fneg double %8
%10 = call double @llvm.fmuladd.f64(double %6, double %7, double %9)
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %5
%13 = load double, double* %3
%14 = load double, double* %3
%15 = fmul double %13, %14
%16 = fmul double %15, 1.000000e-01
%17 = call double @llvm.fmuladd.f64(double %11, double %12, double %16)
ret double %17
}

LLVM IR (-O2):
define double @rosenbrok(double %0, double %1) {
%3 = fneg double %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = fmul double %0, %0
%6 = fmul double %5, 1.000000e-01
%7 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ ver_up_auto_mark_1_2_35();
void ver_up_game_data_1_2_35(void) { ver_up_auto_mark_1_2_35(); }


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

x86 assembly (clang, -O2):
<ver_up_game_data_1_2_35>:
xor    %eax,%eax
jmp    1030 <ver_up_auto_mark_1_2_35@plt>

LLVM IR (-O0):
define void @ver_up_game_data_1_2_35() {
%1 = call i32 (...) @ver_up_auto_mark_1_2_35()
ret void
}

LLVM IR (-O2):
define void @ver_up_game_data_1_2_35() {
%1 = tail call i32 (...) @ver_up_auto_mark_1_2_35()
ret void
}
void test5(_Complex int *x) { (*x)++; }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x4(%rax),%ecx
add    $0x1,%edx
mov    %edx,(%rax)
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test5({ i32, i32 }* %0) {
%2 = alloca { i32, i32 }*
store { i32, i32 }* %0, { i32, i32 }** %2
%3 = load { i32, i32 }*, { i32, i32 }** %2
%4 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %3, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add i32 %5, 1
%9 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %3, i32 0, i32 0
%10 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %3, i32 0, i32 1
store i32 %8, i32* %9
store i32 %7, i32* %10
ret void
}

LLVM IR (-O2):
define void @test5({ i32, i32 }* nocapture %0) {
%2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = add i32 %3, 1
store i32 %4, i32* %2
ret void
}
int gcd(int a, int b) {
  while (b != 0) {
    a %= b;
    {
      (a) ^= (b);
      (b) ^= (a);
      (a) ^= (b);
    };
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1140 <gcd+0x40>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exec_and_send(int, char *);
int /*<<< orphan*/ get_installed_cmd(char **);
void get_installed(int clientfd) {
  char *cmd;
  get_installed_cmd(&cmd);
  exec_and_send(clientfd, cmd);
}


x86 assembly (clang, -O0):
<get_installed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <get_installed_cmd@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <exec_and_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_installed>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
call   1040 <get_installed_cmd@plt>
mov    0x8(%rsp),%rsi
mov    %ebx,%edi
call   1030 <exec_and_send@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @get_installed(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @get_installed_cmd(i8** %2)
%5 = load i8*, i8** %2
%6 = call i32 @exec_and_send(i32 %0, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int match(void) {
  int x = 1;
  printf("%d\n", x);
  int y = 2;
  if (x > 0) {
    int z = 3;
  }
  int z = 4;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1146 <match+0x36>
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @match() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 1, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 2, i32* %3
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 3, i32* %4
br label %11
11: ; preds = %10, %0
store i32 4, i32* %5
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @match() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned int *, int);
void wkd_ctx_set(unsigned char *buf, int reg, unsigned int value) {
  memcpy(buf + reg, &value, 4);
}


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

x86 assembly (clang, -O2):
<wkd_ctx_set>:
push   %rax
mov    %edx,0x4(%rsp)
movslq %esi,%rax
add    %rax,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @wkd_ctx_set(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 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = call i32 @memcpy(i8* %10, i32* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @wkd_ctx_set(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = call i32 @memcpy(i8* %6, i32* %4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int main(void) {
  char name[30];
  printf("Enter name: ");
  fflush(stdin);
  gets(name);
  printf("Name: ");
  puts(name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    -0x30(%rbp),%rdi
call   1050 <gets@plt>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Enter name: \00"
@stdin = global i32 0
@.str.1 = [7 x i8] c"Name: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fflush(i32 %4)
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Enter name: \00"
@stdin = global i32 0
@.str.1 = [7 x i8] c"Name: \00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = tail call i32 @fflush(i32 %4)
%6 = call i32 @gets(i8* %2)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
double EvalAngCor_alpha0_0plus_0plus_14032_L0(double);
double funcAngCor_alpha0_0plus_0plus_14032_L0(double *x, double *par) {
  double result;
  result = par[0] * EvalAngCor_alpha0_0plus_0plus_14032_L0(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngCor_alpha0_0plus_0plus_14032_L0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngCor_alpha0_0plus_0plus_14032_L0@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngCor_alpha0_0plus_0plus_14032_L0>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngCor_alpha0_0plus_0plus_14032_L0@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngCor_alpha0_0plus_0plus_14032_L0(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngCor_alpha0_0plus_0plus_14032_L0(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngCor_alpha0_0plus_0plus_14032_L0(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngCor_alpha0_0plus_0plus_14032_L0(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Variables and functions */
int rand();
int _get_int_random_number(__const int *max_number) {
  int max_int;
  if (max_number == NULL) {
    max_int = 999999;
  } else {
    max_int = *max_number;
  }
  return rand() % max_int;
}


x86 assembly (clang, -O0):
<_get_int_random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <_get_int_random_number+0x23>
movl   $0xf423f,-0xc(%rbp)
jmp    113c <_get_int_random_number+0x2c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_int_random_number>:
push   %rbx
test   %rdi,%rdi
je     111a <_get_int_random_number+0xa>
mov    (%rdi),%ebx
jmp    111f <_get_int_random_number+0xf>
mov    $0xf423f,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_get_int_random_number(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* %0
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 999999, %1 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, %6
ret i32 %8
}
int test_imm_30uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x30 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_30uint64_midword_mem>:
testb  $0x30,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_30uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3145728
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int rand();
int rand_int() {
  int r = rand() % 50;
  return r + 1;
}


x86 assembly (clang, -O0):
<rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x32,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_int() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 50
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @rand_int() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 50
%3 = add nsw i32 %2, 1
ret i32 %3
}
int scan_fromhex(unsigned char c) {
  c -= '0';
  if (c <= 9)
    return c;
  c &= ~0x20;
  c -= 'A' - '0';
  if (c < 6)
    return c + 10;
  return -1;
}


x86 assembly (clang, -O0):
<scan_fromhex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jg     112d <scan_fromhex+0x2d>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <scan_fromhex+0x64>
movzbl -0x5(%rbp),%eax
and    $0xffffffdf,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
sub    $0x11,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x6,%eax
jge    115d <scan_fromhex+0x5d>
movzbl -0x5(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <scan_fromhex+0x64>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_fromhex>:
add    $0xd0,%dil
cmp    $0x9,%dil
ja     110f <scan_fromhex+0xf>
movzbl %dil,%eax
ret
and    $0xdf,%dil
add    $0xef,%dil
mov    $0xffffffff,%eax
cmp    $0x5,%dil
ja     1129 <scan_fromhex+0x29>
movzbl %dil,%eax
add    $0xa,%eax
ret

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

LLVM IR (-O2):
define i32 @scan_fromhex(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i8 %2 to i32
br label %13
6: ; preds = %1
%7 = and i8 %2, -33
%8 = add i8 %7, -17
%9 = icmp ult i8 %8, 6
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = zext i8 %8 to i32
%12 = add nuw nsw i32 %11, 10
br label %13
13: ; preds = %6, %10, %4
%14 = phi i32 [ %5, %4 ], [ %12, %10 ], [ -1, %6 ]
ret i32 %14
}