xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t pdu_phone_bytes(uint8_t *in) {
  uint8_t len = 0;
  while (*in++ != 0xFF)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<pdu_phone_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0xff,(%rax)
je     113d <pdu_phone_bytes+0x3d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <pdu_phone_bytes+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_phone_bytes>:
cmpq   $0xff,(%rdi)
jne    110c <pdu_phone_bytes+0xc>
xor    %eax,%eax
ret
xor    %ecx,%ecx
xchg   %ax,%ax
lea    0x1(%rcx),%rax
cmpq   $0xff,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <pdu_phone_bytes+0x10>
ret

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

LLVM IR (-O2):
define i64 @pdu_phone_bytes(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp eq i64 %2, 255
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i64* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i64, i64* %6, i64 1
%8 = add nuw nsw i64 %5, 1
%9 = load i64, i64* %7
%10 = icmp eq i64 %9, 255
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ embeddedsystemrecursivefunction();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world\n");
  embeddedsystemrecursivefunction();
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @embeddedsystemrecursivefunction()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ OPENSSL_config(int /*<<< orphan*/ *);
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
__attribute__((visibility("default"))) void cryptoshit_init() {
  ERR_load_crypto_strings();
  OpenSSL_add_all_algorithms();
  OPENSSL_config(NULL);
}


x86 assembly (clang, -O0):
<cryptoshit_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ERR_load_crypto_strings@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <OPENSSL_config@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cryptoshit_init>:
push   %rax
xor    %eax,%eax
call   1050 <ERR_load_crypto_strings@plt>
xor    %eax,%eax
call   1040 <OpenSSL_add_all_algorithms@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <OPENSSL_config@plt>

LLVM IR (-O0):
define void @cryptoshit_init() {
%1 = call i32 (...) @ERR_load_crypto_strings()
%2 = call i32 (...) @OpenSSL_add_all_algorithms()
%3 = call i32 @OPENSSL_config(i32* null)
ret void
}

LLVM IR (-O2):
define void @cryptoshit_init() {
%1 = tail call i32 (...) @ERR_load_crypto_strings()
%2 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%3 = tail call i32 @OPENSSL_config(i32* null)
ret void
}
int dummy_jump_to_bootloader(struct bladerf *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.bladerf = type opaque
define i32 @dummy_jump_to_bootloader(%struct.bladerf* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
unsigned char *sha224_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_sha224(unsigned char *out, const unsigned char *in,
                                  size_t in_len) {
  return sha224_buffer(out, in, in_len);
}


x86 assembly (clang, -O0):
<hash_buffer_sha224>:
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 <sha224_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_buffer_sha224>:
jmp    1030 <sha224_buffer@plt>

LLVM IR (-O0):
define i8* @hash_buffer_sha224(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @sha224_buffer(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @hash_buffer_sha224(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @sha224_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ stackGrowth(int *);
int testStackGrowth() {
  int temp;
  stackGrowth(&temp);
}


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

x86 assembly (clang, -O2):
<testStackGrowth>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <stackGrowth@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @testStackGrowth() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @stackGrowth(i32* %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @testStackGrowth() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @stackGrowth(i32* %1)
ret i32 undef
}
/* Variables and functions */
int PnameRef();
PlibraryNameRef() {
  int b = -1;
  ;
  b = PnameRef();
  return (b);
}


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

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

LLVM IR (-O0):
define i32 @PlibraryNameRef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @PnameRef()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PlibraryNameRef() {
%1 = tail call i32 (...) @PnameRef()
ret i32 %1
}
/* Variables and functions */
double floor(double);
double my_round(double num) {
  if (num < 0)
    return -floor(-num + 0.5);
  return floor(num + 0.5);
}


x86 assembly (clang, -O0):
<my_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1179 <my_round+0x69>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb1(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <my_round+0x80>
movsd  0xe7f(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_round>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    113a <my_round+0x2a>
movsd  0xedd(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <floor@plt>
xorpd  0xed8(%rip),%xmm0
pop    %rax
ret
addsd  0xebe(%rip),%xmm0
pop    %rax
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @my_round(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = fadd double %8, 5.000000e-01
%10 = call double @llvm.floor.f64(double %9)
%11 = fneg double %10
store double %11, double* %2
br label %16
12: ; preds = %1
%13 = load double, double* %3
%14 = fadd double %13, 5.000000e-01
%15 = call double @llvm.floor.f64(double %14)
store double %15, double* %2
br label %16
16: ; preds = %12, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @my_round(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fsub double 5.000000e-01, %0
%5 = tail call double @llvm.floor.f64(double %4)
%6 = fneg double %5
br label %10
7: ; preds = %1
%8 = fadd double %0, 5.000000e-01
%9 = tail call double @llvm.floor.f64(double %8)
br label %10
10: ; preds = %7, %3
%11 = phi double [ %6, %3 ], [ %9, %7 ]
ret double %11
}
int test_imm_2Dint16_mem(short *val) {
  return ((*val) & (0x2D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Dint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x2d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_2Dint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 45
%7 = icmp ne i32 %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_2Dint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 45
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ die(char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ write_all_events(int /*<<< orphan*/ *, int);
void replay(char *filename, bool is_verbose) {
  FILE *recfp = NULL;
  recfp = fopen(filename, "r");
  if (recfp == NULL) {
    die("Can't open '%s'", filename);
  }
  write_all_events(recfp, is_verbose);
  fclose(recfp);
}


x86 assembly (clang, -O0):
<replay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1186 <replay+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1060 <die@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <write_all_events@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replay>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbp
lea    0xeaf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116d <replay+0x2d>
lea    0xe9d(%rip),%rdi
mov    %rbp,%rsi
call   1060 <die@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <write_all_events@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [16 x i8] c"Can't open '%s'\00"
define void @replay(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32* null, i32** %5
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
%14 = load i32*, i32** %5
%15 = load i32, i32* %4
%16 = call i32 @write_all_events(i32* %14, i32 %15)
%17 = load i32*, i32** %5
%18 = call i32 @fclose(i32* %17)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [16 x i8] c"Can't open '%s'\00"
define void @replay(i8* %0, i32 %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @write_all_events(i32* %3, i32 %1)
%9 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void print_usage() {
  puts("-----------------------------------------------------------------------"
       "--------");
  printf("Usage: --database='file' [--grammar='file'] [--cores=num] "
         "[--kernelAG=num]\n");
  puts("-----------------------------------------------------------------------"
       "--------");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [80 x i8] c"-------------------------------------------------------------------------------\00"
@.str.1 = [76 x i8] c"Usage: --database='file' [--grammar='file'] [--cores=num] [--kernelAG=num]\0A\00"
define void @print_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [80 x i8] c"-------------------------------------------------------------------------------\00"
@str = [75 x i8] c"Usage: --database='file' [--grammar='file'] [--cores=num] [--kernelAG=num]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}
int px4() {
  int x;
  x = 0;
  return 4;
}


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

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

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

LLVM IR (-O2):
define i32 @px4() {
ret i32 4
}
char *pridej_retezec(char *retezec, char *kam) {
  while (*retezec) {
    *kam = *retezec;
    kam++;
    retezec++;
  }
  return kam;
}


x86 assembly (clang, -O0):
<pridej_retezec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <pridej_retezec+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <pridej_retezec+0xc>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pridej_retezec>:
mov    %rsi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <pridej_retezec+0x21>
add    $0x1,%rdi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <pridej_retezec+0x10>
ret

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

LLVM IR (-O2):
define i8* @pridej_retezec(i8* nocapture %0, i8* writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %9, %5 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void myerr(const char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @myerr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void foo(void *yv, long long ylen) {
  char *y = yv;
  while (ylen > 0) {
    *y++ = 0;
    --ylen;
  }
  __asm__ __volatile__("" : : "r"(yv) : "memory");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1142 <foo+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <foo+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
jle    1126 <foo+0x16>
mov    %rsi,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @foo(i8* %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2
br label %5
5: ; preds = %4, %2
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
int do_648() { return 648; }


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

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

LLVM IR (-O0):
define i32 @do_648() {
ret i32 648
}

LLVM IR (-O2):
define i32 @do_648() {
ret i32 648
}
/* Type definitions */
typedef int uint16_t;

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


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

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

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

LLVM IR (-O2):
define i32 @rotl_16a(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M103_f(char *s) {
  debug("M103_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M103_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M103_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M103_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M103_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M103_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M103_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 24;
  int height = 180;
  printf("I am %d years old.\n");
  printf("I am %d centimeters tall.\n", height);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [27 x i8] c"I am %d centimeters tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 24, i32* %2
store i32 180, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [27 x i8] c"I am %d centimeters tall.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 180)
ret i32 0
}
void foo050(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo050(i32 %0) {
ret void
}
/* Variables and functions */
bool nrf52_errata_7(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_7() {
ret i32 0
}
/* Variables and functions */
float _powf(float, float);
float powf(float x, float y) { return _powf(x, y); }


x86 assembly (clang, -O0):
<powf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <_powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powf>:
jmp    1030 <_powf@plt>

LLVM IR (-O0):
define float @powf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @_powf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @powf(float %0, float %1) {
%3 = tail call float @_powf(float %0, float %1)
ret float %3
}
unsigned char get_byte(char *str) {
  unsigned char c = '\0', step;
  int i;
  for (i = 0; i < 2; i++) {
    c <<= 4;
    step = str[i];
    c |= (step < '9') ? (step - '0') : (step - 'A' + 10);
  }
  return c;
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1178 <get_byte+0x78>
movzbl -0x9(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
cmp    $0x39,%eax
jge    1151 <get_byte+0x51>
movzbl -0xa(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x14(%rbp)
jmp    115e <get_byte+0x5e>
movzbl -0xa(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1113 <get_byte+0x13>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
xor    %edx,%edx
cmp    $0x39,%al
mov    $0x39,%esi
cmovb  %edx,%esi
add    %al,%sil
shl    $0x4,%sil
cmp    $0x39,%cl
mov    $0xd0,%edx
mov    $0xc9,%eax
cmovb  %edx,%eax
add    %cl,%al
or     %sil,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_byte(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %2
store i8 0, i8* %3
store i32 0, i32* %5
br label %6
6: ; preds = %37, %1
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %40
9: ; preds = %6
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 4
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
%14 = load i8*, i8** %2
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
store i8 %18, i8* %4
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = icmp slt i32 %20, 57
br i1 %21, label %22, label %26
22: ; preds = %9
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = sub nsw i32 %24, 48
br label %31
26: ; preds = %9
%27 = load i8, i8* %4
%28 = zext i8 %27 to i32
%29 = sub nsw i32 %28, 65
%30 = add nsw i32 %29, 10
br label %31
31: ; preds = %26, %22
%32 = phi i32 [ %25, %22 ], [ %30, %26 ]
%33 = load i8, i8* %3
%34 = zext i8 %33 to i32
%35 = or i32 %34, %32
%36 = trunc i32 %35 to i8
store i8 %36, i8* %3
br label %37
37: ; preds = %31
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %6
40: ; preds = %6
%41 = load i8, i8* %3
ret i8 %41
}

LLVM IR (-O2):
define zeroext i8 @get_byte(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 57
%4 = select i1 %3, i8 0, i8 57
%5 = add i8 %4, %2
%6 = shl i8 %5, 4
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp ult i8 %8, 57
%10 = select i1 %9, i8 -48, i8 -55
%11 = add i8 %10, %8
%12 = or i8 %11, %6
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void exit(int exit_code) { _exit(exit_code); }


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

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

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

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scalbn(double, int);
int /*<<< orphan*/ scalbnf(float, int);
int /*<<< orphan*/ scalbnl(long double, int);
void uninivar_scalbn(void) {
  float f;
  int i1;
  (void)scalbnf(f, i1);
  double d;
  int i2;
  (void)scalbn(d, i2);
  long double ld;
  int i3;
  (void)scalbnl(ld, i3);
}


x86 assembly (clang, -O0):
<uninivar_scalbn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <scalbnf@plt>
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1040 <scalbn@plt>
fldt   -0x30(%rbp)
mov    -0x34(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <scalbnl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninivar_scalbn>:
sub    $0x18,%rsp
call   1030 <scalbnf@plt>
call   1040 <scalbn@plt>
call   1050 <scalbnl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninivar_scalbn() {
%1 = alloca float
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
%5 = alloca x86_fp80
%6 = alloca i32
%7 = load float, float* %1
%8 = load i32, i32* %2
%9 = call i32 @scalbnf(float %7, i32 %8)
%10 = load double, double* %3
%11 = load i32, i32* %4
%12 = call i32 @scalbn(double %10, i32 %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load i32, i32* %6
%15 = call i32 @scalbnl(x86_fp80 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @uninivar_scalbn() {
%1 = tail call i32 @scalbnf(float undef, i32 undef)
%2 = tail call i32 @scalbn(double undef, i32 undef)
%3 = tail call i32 @scalbnl(x86_fp80 undef, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void version_display() {
  printf("upackddir v."
         "0.0.6"
         "\n"
         "Copyright (C) 1997-2001 Id Software, Inc.\n"
         "Copyright (C) 2002 The Quakeforge Project.\n"
         "Copyright (C) 2003 Fabio Bonelli <fabiobonelli@libero.it>\n");
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"upackddir v.0.0.6\0ACopyright (C) 1997-2001 Id Software, Inc.\0ACopyright (C) 2002 The Quakeforge Project.\0ACopyright (C) 2003 Fabio Bonelli <fabiobonelli@libero.it>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @version_display() {
%1 = call i32 @printf(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [161 x i8] c"upackddir v.0.0.6\0ACopyright (C) 1997-2001 Id Software, Inc.\0ACopyright (C) 2002 The Quakeforge Project.\0ACopyright (C) 2003 Fabio Bonelli <fabiobonelli@libero.it>\00"
define void @version_display() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([161 x i8], [161 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int db_query(char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int get_random() {
  char *sql = "SELECT * FROM Quotes ORDER BY RANDOM() LIMIT 1;";
  int ecode = db_query(sql, 10);
  if (ecode != 0) {
    fprintf(stderr, "There was an error in get_random method\n");
    return ecode;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <db_query@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116e <get_random+0x4e>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <get_random+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rbx
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
call   1040 <db_query@plt>
mov    %eax,%ebx
test   %eax,%eax
je     114d <get_random+0x2d>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"SELECT * FROM Quotes ORDER BY RANDOM() LIMIT 1;\00"
@stderr = global i32 0
@.str.1 = [41 x i8] c"There was an error in get_random method\0A\00"
define i32 @get_random() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @db_query(i8* %4, i32 10)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %3
store i32 %11, i32* %1
br label %13
12: ; preds = %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [48 x i8] c"SELECT * FROM Quotes ORDER BY RANDOM() LIMIT 1;\00"
@stderr = global i32 0
@.str.1 = [41 x i8] c"There was an error in get_random method\0A\00"
define i32 @get_random() {
%1 = tail call i32 @db_query(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
ret i32 %1
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ usleep(int);
int execute() {
  usleep(rand() % 1000000);
  return 1;
}


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <usleep@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rdi
imul   $0x431bde83,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
imul   $0xf4240,%eax,%eax
sub    %eax,%edi
call   1040 <usleep@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execute() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 1000000
%3 = call i32 @usleep(i32 %2)
ret i32 1
}

LLVM IR (-O2):
define i32 @execute() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 1000000
%3 = tail call i32 @usleep(i32 %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ get_mem_attrs();
void set_mem_attributes() { get_mem_attrs(); }


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

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

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

LLVM IR (-O2):
define void @set_mem_attributes() {
%1 = tail call i32 (...) @get_mem_attrs()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isupper(unsigned char);
int all_upper(char *str) {
  while (*str) {
    if (!isupper((unsigned char)*str))
      return 0;
    ++str;
  }
  return 1;
}


x86 assembly (clang, -O0):
<all_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <all_upper+0x4b>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isupper@plt>
cmp    $0x0,%eax
jne    114a <all_upper+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <all_upper+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <all_upper+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_upper>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <all_upper+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %al,%edi
call   1030 <isupper@plt>
test   %eax,%eax
je     1149 <all_upper+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <all_upper+0x20>
jmp    114b <all_upper+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @all_upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isupper(i8 zeroext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ cm_quit_usage();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int cm_quit(char *args) {
  if (args) {
    cm_quit_usage();
    return -1;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<cm_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <cm_quit+0x29>
mov    $0x0,%al
call   1030 <cm_quit_usage@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cm_quit>:
push   %rax
test   %rdi,%rdi
je     1134 <cm_quit+0x14>
xor    %eax,%eax
call   1030 <cm_quit_usage@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @cm_quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @cm_quit_usage()
ret i32 -1
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @cm_quit(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @cm_quit_usage()
ret i32 -1
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_5Eint8_mem(signed char *val) {
  return ((*val) & (0x5E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Eint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x5e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_5Eint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 94
%7 = icmp ne i32 %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_5Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 94
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hip2(struct S *);
void hiphip2(struct S *p) { hip2(p); }


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

x86 assembly (clang, -O2):
<hiphip2>:
jmp    1030 <hip2@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @hiphip2(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = load %struct.S*, %struct.S** %2
%4 = call i32 @hip2(%struct.S* %3)
ret void
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @hiphip2(%struct.S* %0) {
%2 = tail call i32 @hip2(%struct.S* %0)
ret void
}
/* Variables and functions */
float powf(float, float);
float libm_powf(float x, float y) { return powf(x, y); }


x86 assembly (clang, -O0):
<libm_powf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libm_powf>:
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @libm_powf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @powf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @libm_powf(float %0, float %1) {
%3 = tail call float @powf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ c();
int /*<<< orphan*/ printf(char *);
void b() {
  printf("b\n");
  c();
}


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

x86 assembly (clang, -O2):
<b>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <c@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"b\00"
define void @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @c()
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int intervalMillis(struct timeval end, struct timeval start) {
  return ((end.tv_sec - start.tv_sec) * 1000) +
         ((end.tv_usec - start.tv_usec) / 1000);
}


x86 assembly (clang, -O0):
<intervalMillis>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intervalMillis>:
mov    %rdi,%rax
shr    $0x20,%rax
sub    %esi,%edi
shr    $0x20,%rsi
imul   $0x3e8,%edi,%ecx
sub    %esi,%eax
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @intervalMillis(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %3 to i64*
store i64 %0, i64* %5
%6 = bitcast %struct.timeval* %4 to i64*
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %8, %10
%12 = mul nsw i32 %11, 1000
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%16 = load i32, i32* %15
%17 = sub nsw i32 %14, %16
%18 = sdiv i32 %17, 1000
%19 = add nsw i32 %12, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @intervalMillis(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i64 %0, 32
%5 = trunc i64 %4 to i32
%6 = trunc i64 %1 to i32
%7 = lshr i64 %1, 32
%8 = trunc i64 %7 to i32
%9 = sub nsw i32 %3, %6
%10 = mul nsw i32 %9, 1000
%11 = sub nsw i32 %5, %8
%12 = sdiv i32 %11, 1000
%13 = add nsw i32 %12, %10
ret i32 %13
}
int test_imm_87int64_lowword_reg(long long val) {
  return ((val) & (0x87 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_87int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 135
%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_87int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 135
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void SPIDmaDisable(unsigned long ulBase, unsigned long ulFlags) {
  (*((volatile unsigned long *)(ulBase + 0x0000012C))) &= ulFlags;
}


x86 assembly (clang, -O0):
<SPIDmaDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x12c(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x12c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIDmaDisable>:
and    %rsi,0x12c(%rdi)
ret

LLVM IR (-O0):
define void @SPIDmaDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 300
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @SPIDmaDisable(i64 %0, i64 %1) {
%3 = add i64 %0, 300
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}