xunge/DecIR huggingface dataset:
int test_imm_9Cint16_mem(short *val) {
  return ((*val) & (0x9C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Cint16_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, 156
%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_9Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 156
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void wpas_p2p_remain_on_channel_cb(struct wpa_supplicant *wpa_s,
                                   unsigned int freq, unsigned int duration) {}


x86 assembly (clang, -O0):
<wpas_p2p_remain_on_channel_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_remain_on_channel_cb(%struct.wpa_supplicant* %0, i32 %1, i32 %2) {
%4 = alloca %struct.wpa_supplicant*
%5 = alloca i32
%6 = alloca i32
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_remain_on_channel_cb(%struct.wpa_supplicant* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setHSN(int);
int /*<<< orphan*/ setTSN(int);
void init_Settings() {
  setHSN(9891);
  setTSN(002);
}


x86 assembly (clang, -O0):
<init_Settings>:
push   %rbp
mov    %rsp,%rbp
mov    $0x26a3,%edi
call   1040 <setHSN@plt>
mov    $0x2,%edi
call   1030 <setTSN@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_Settings>:
push   %rax
mov    $0x26a3,%edi
call   1040 <setHSN@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <setTSN@plt>

LLVM IR (-O0):
define void @init_Settings() {
%1 = call i32 @setHSN(i32 9891)
%2 = call i32 @setTSN(i32 2)
ret void
}

LLVM IR (-O2):
define void @init_Settings() {
%1 = tail call i32 @setHSN(i32 9891)
%2 = tail call i32 @setTSN(i32 2)
ret void
}
int initialize_trim_array(int trim_array[50]) {
  int i;
  for (i = 0; i < 50; i++)
    trim_array[i] = -1;
  return 1;
}


x86 assembly (clang, -O0):
<initialize_trim_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1136 <initialize_trim_array+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <initialize_trim_array+0xf>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_trim_array>:
pcmpeqd %xmm0,%xmm0
movdqu %xmm0,0xb0(%rdi)
movdqu %xmm0,0xa0(%rdi)
movdqu %xmm0,0x90(%rdi)
movdqu %xmm0,0x80(%rdi)
movdqu %xmm0,0x70(%rdi)
movdqu %xmm0,0x60(%rdi)
movdqu %xmm0,0x50(%rdi)
movdqu %xmm0,0x40(%rdi)
movdqu %xmm0,0x30(%rdi)
movdqu %xmm0,0x20(%rdi)
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,(%rdi)
movq   $0xffffffffffffffff,0xc0(%rdi)
ff ff ff ff
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @initialize_trim_array(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret i32 1
}
f() {
  int x = 1;
  char big[0x1000];
  ({
    __label__ mylabel;
  mylabel:
    x++;
    if (x != 3)
      goto mylabel;
  });
  exit(0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     113a <f+0x2a>
jmp    1122 <f+0x12>
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca [4096 x i8]
store i32 1, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
unreachable
}

LLVM IR (-O2):
define i32 @f() {
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void adserror(char *s) { printf("syntax error in expr (%s).\n", s); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"syntax error in expr (%s).\0A\00"
define void @adserror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"syntax error in expr (%s).\0A\00"
define void @adserror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int sysfs_create_files(struct kobject *kobj, const struct attribute **attr) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
%struct.attribute = type opaque
define i32 @sysfs_create_files(%struct.kobject* %0, %struct.attribute** %1) {
%3 = alloca %struct.kobject*
%4 = alloca %struct.attribute**
store %struct.kobject* %0, %struct.kobject** %3
store %struct.attribute** %1, %struct.attribute*** %4
ret i32 0
}

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute = type opaque
define i32 @sysfs_create_files(%struct.kobject* nocapture readnone %0, %struct.attribute** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
size_t strnlen(const char *str, size_t n) {
  const char *start = str;
  while (n-- > 0 && *str)
    str++;
  return str - start;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jbe    1142 <strnlen+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1163 <strnlen+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1125 <strnlen+0x25>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1125 <strnlen+0x25>
add    $0xffffffffffffffff,%rsi
add    $0x1,%rax
test   %rsi,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @strnlen(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 = %18, %2
%8 = load i64, i64* %4
%9 = add i64 %8, -1
store i64 %9, i64* %4
%10 = icmp ugt i64 %8, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %11, %7
%17 = phi i1 [ false, %7 ], [ %15, %11 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %7
21: ; preds = %16
%22 = load i8*, i8** %3
%23 = load i8*, i8** %5
%24 = ptrtoint i8* %22 to i64
%25 = ptrtoint i8* %23 to i64
%26 = sub i64 %24, %25
ret i64 %26
}

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ %9, %12 ], [ %1, %4 ]
%8 = phi i8* [ %13, %12 ], [ %0, %4 ]
%9 = add i64 %7, -1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %12, %2
%16 = phi i8* [ %0, %2 ], [ %5, %12 ], [ %8, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float get_LCG_Pseudorandom_Number() {
  static uint32_t seed = 42;
  seed = (seed * 3877 + 29573) % 139968;
  return ((float)(8192 - 1)) / 139968 * seed;
}


x86 assembly (clang, -O0):
<get_LCG_Pseudorandom_Number>:
push   %rbp
mov    %rsp,%rbp
imul   $0xf25,0x2f12(%rip),%eax
add    $0x7385,%eax
mov    $0x222c0,%ecx
cltd
idiv   %ecx
mov    %edx,0x2eff(%rip)
cvtsi2ssl 0x2ef7(%rip),%xmm1
movss  0xecf(%rip),%xmm0
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_LCG_Pseudorandom_Number>:
imul   $0xf25,0x2f16(%rip),%eax
add    $0x7385,%eax
cltq
imul   $0x1df75681,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2e,%rcx
add    %edx,%ecx
imul   $0x222c0,%ecx,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
mov    %eax,0x2ee9(%rip)
mulss  0xec1(%rip),%xmm0
ret

LLVM IR (-O0):
@get_LCG_Pseudorandom_Number.seed = internal global i32 42
define float @get_LCG_Pseudorandom_Number() {
%1 = load i32, i32* @get_LCG_Pseudorandom_Number.seed
%2 = mul nsw i32 %1, 3877
%3 = add nsw i32 %2, 29573
%4 = srem i32 %3, 139968
store i32 %4, i32* @get_LCG_Pseudorandom_Number.seed
%5 = load i32, i32* @get_LCG_Pseudorandom_Number.seed
%6 = sitofp i32 %5 to float
%7 = fmul float 0x3FADF666C0000000, %6
ret float %7
}

LLVM IR (-O2):
@get_LCG_Pseudorandom_Number.seed = internal unnamed_addr global i32 42
define float @get_LCG_Pseudorandom_Number() {
%1 = load i32, i32* @get_LCG_Pseudorandom_Number.seed
%2 = mul nsw i32 %1, 3877
%3 = add nsw i32 %2, 29573
%4 = srem i32 %3, 139968
store i32 %4, i32* @get_LCG_Pseudorandom_Number.seed
%5 = sitofp i32 %4 to float
%6 = fmul float %5, 0x3FADF666C0000000
ret float %6
}
double fmax(double x, double y) { return (x > y) ? x : y; }


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <fmax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <fmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int test_imm_0Eint16_reg(short val) {
  return ((val) & (-0x0E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Eint16_reg>:
test   $0xfff2,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Eint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -14
%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_0Eint16_reg(i16 signext %0) {
%2 = and i16 %0, -14
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int Bematech_FI_NumeroCupom(Var, Retorno) {
  return Formata("\x1b|30|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_NumeroCupom>:
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
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_NumeroCupom>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|30|\1B\00"
define i32 @Bematech_FI_NumeroCupom(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 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|30|\1B\00"
define i32 @Bematech_FI_NumeroCupom(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn49() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn49");
  return result;
}


x86 assembly (clang, -O0):
<fn49>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn49>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn49\00"
define i8* @fn49() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn49\00"
define i8* @fn49() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int test(int a) { return a + a; }


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

x86 assembly (clang, -O2):
<test>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
char *stringToPointer(char *str) { return str; }


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

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

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

LLVM IR (-O2):
define i8* @stringToPointer(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ sort(int);
int main(void) {
  sort(19);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x13,%edi
call   1030 <sort@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sort(i32 19)
ret i32 0
}
int ft_max2(int n1, int n2) {
  if (n1 > n2)
    return (n1);
  return (n2);
}


x86 assembly (clang, -O0):
<ft_max2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <ft_max2+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <ft_max2+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_max2>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_max2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int digitConverter(char digit) {
  int temp;
  switch (digit) {
  case '0':
    temp = 0;
    break;
  case '1':
    temp = 1;
    break;
  case '2':
    temp = 2;
    break;
  case '3':
    temp = 3;
    break;
  case '4':
    temp = 4;
    break;
  case '5':
    temp = 5;
    break;
  case '6':
    temp = 6;
    break;
  case '7':
    temp = 7;
    break;
  case '8':
    temp = 8;
    break;
  case '9':
    temp = 9;
    break;
  default:
    temp = 10;
    break;
  }
  return temp;
}


x86 assembly (clang, -O0):
<digitConverter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11ac <digitConverter+0xac>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0x1,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0x2,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0x3,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0x4,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0x5,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0x6,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0x7,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0x8,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0x9,-0x8(%rbp)
jmp    11b3 <digitConverter+0xb3>
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitConverter>:
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
mov    $0xa,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @digitConverter(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %16 [
i32 48, label %6
i32 49, label %7
i32 50, label %8
i32 51, label %9
i32 52, label %10
i32 53, label %11
i32 54, label %12
i32 55, label %13
i32 56, label %14
i32 57, label %15
]
6: ; preds = %1
store i32 0, i32* %3
br label %17
7: ; preds = %1
store i32 1, i32* %3
br label %17
8: ; preds = %1
store i32 2, i32* %3
br label %17
9: ; preds = %1
store i32 3, i32* %3
br label %17
10: ; preds = %1
store i32 4, i32* %3
br label %17
11: ; preds = %1
store i32 5, i32* %3
br label %17
12: ; preds = %1
store i32 6, i32* %3
br label %17
13: ; preds = %1
store i32 7, i32* %3
br label %17
14: ; preds = %1
store i32 8, i32* %3
br label %17
15: ; preds = %1
store i32 9, i32* %3
br label %17
16: ; preds = %1
store i32 10, i32* %3
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @digitConverter(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = select i1 %4, i32 %3, i32 10
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void fwriteint64_t(uint64_t data, FILE *fp) { fwrite(&data, 1, 8, fp); }


x86 assembly (clang, -O0):
<fwriteint64_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwriteint64_t>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @fwriteint64_t(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 1, i32 8, i32* %1)
ret void
}
/* Variables and functions */
double cfrac_tan(double, int);
double prec_tan(double x) {
  return cfrac_tan(x, (int)(3.5984361197 * x + 4.1991));
}


x86 assembly (clang, -O0):
<prec_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xed1(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xecd(%rip),%xmm2
addsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <cfrac_tan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prec_tan>:
movsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee4(%rip),%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <cfrac_tan@plt>

LLVM IR (-O0):
define double @prec_tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 0x400CC998E056DA67, double %4, double 4.199100e+00)
%6 = fptosi double %5 to i32
%7 = call double @cfrac_tan(double %3, i32 %6)
ret double %7
}

LLVM IR (-O2):
define double @prec_tan(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x400CC998E056DA67, double 4.199100e+00)
%3 = fptosi double %2 to i32
%4 = tail call double @cfrac_tan(double %0, i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello world!\n");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@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 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void private_free(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @private_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astGAttr(int attr, double value, double *old_value, int prim) {
  Report("astGAttr");
  return 0;
}


x86 assembly (clang, -O0):
<astGAttr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <Report@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"astGAttr\00"
define i32 @astGAttr(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = call i32 @Report(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"astGAttr\00"
define i32 @astGAttr(i32 %0, double %1, double* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @Report(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int clock_increment_hour(int hour) {
  if (hour >= 23)
    return 0;
  else
    return ++hour;
}


x86 assembly (clang, -O0):
<clock_increment_hour>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x17,-0x8(%rbp)
jl     111d <clock_increment_hour+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1129 <clock_increment_hour+0x29>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_increment_hour>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x17,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clock_increment_hour(i32 %0) {
%2 = icmp sgt i32 %0, 22
%3 = add nsw i32 %0, 1
%4 = select i1 %2, i32 0, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fire_exit() {
  printf("Oh look, a fire exit. That's why we are still under budget. Level "
         "Cleared \n");
}


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

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

LLVM IR (-O0):
@.str = [76 x i8] c"Oh look, a fire exit. That's why we are still under budget. Level Cleared \0A\00"
define void @fire_exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [75 x i8] c"Oh look, a fire exit. That's why we are still under budget. Level Cleared \00"
define void @fire_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int sayi;
  printf("Lutfen sayi giiniz: ");
  scanf("%d", &sayi);
  if (sayi % 2 == 0) {
    printf("Sayi cift");
  } else
    printf("Sayi tek.");
  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>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1170 <main+0x50>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xece(%rip),%rax
lea    0xed1(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Lutfen sayi giiniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Sayi cift\00"
@.str.3 = [10 x i8] c"Sayi tek.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Lutfen sayi giiniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Sayi cift\00"
@.str.3 = [10 x i8] c"Sayi tek.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_rtp_client();
int /*<<< orphan*/ test_rtp_server();
void test_rtp(int run_as_client) {
  if (run_as_client) {
    test_rtp_client();
  } else {
    test_rtp_server();
  }
}


x86 assembly (clang, -O0):
<test_rtp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <test_rtp+0x21>
mov    $0x0,%al
call   1040 <test_rtp_client@plt>
jmp    1148 <test_rtp+0x28>
mov    $0x0,%al
call   1030 <test_rtp_server@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rtp>:
xor    %eax,%eax
test   %edi,%edi
je     112b <test_rtp+0xb>
jmp    1040 <test_rtp_client@plt>
jmp    1030 <test_rtp_server@plt>

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

LLVM IR (-O2):
define void @test_rtp(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @test_rtp_client()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @test_rtp_server()
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ glob_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
void globfree(glob_t *pglob) { abort(); }


x86 assembly (clang, -O0):
<globfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<globfree>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @globfree(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @globfree(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
void basic_register_cmds(void) {}


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

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

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

LLVM IR (-O2):
define void @basic_register_cmds() {
ret void
}
const char *POPT_next_char(const char *str) {
  const char *p = str;
  while (*p != '\0') {
    p++;
    if (((unsigned)*p & 0xc0) != (unsigned)0x80)
      break;
  }
  return p;
}


x86 assembly (clang, -O0):
<POPT_next_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <POPT_next_char+0x4d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1148 <POPT_next_char+0x48>
jmp    114d <POPT_next_char+0x4d>
jmp    1110 <POPT_next_char+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<POPT_next_char>:
mov    %rdi,%rax
mov    (%rdi),%cl
cs nopw 0x0(%rax,%rax,1)
nop
test   %cl,%cl
je     1126 <POPT_next_char+0x26>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
mov    %ecx,%edx
and    $0xc0,%dl
cmp    $0x80,%dl
je     1110 <POPT_next_char+0x10>
ret

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

LLVM IR (-O2):
define i8* @POPT_next_char(i8* %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %7, %1
%4 = phi i8 [ %9, %7 ], [ %2, %1 ]
%5 = phi i8* [ %8, %7 ], [ %0, %1 ]
%6 = icmp eq i8 %4, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %8
%10 = and i8 %9, -64
%11 = icmp eq i8 %10, -128
br i1 %11, label %3, label %12
12: ; preds = %7, %3
%13 = phi i8* [ %8, %7 ], [ %5, %3 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: idnlookup [-hTa] [-t timeout] host\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"usage: idnlookup [-hTa] [-t timeout] host\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"usage: idnlookup [-hTa] [-t timeout] host\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
int foo(unsigned b) {
  unsigned t = -1;
  int x = b <= t;
  long l = __builtin_expect(x, 0);
  return l;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %2
store i32 -1, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp ule i32 %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void raw_mode(void) { system("/bin/stty raw"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"/bin/stty raw\00"
define void @raw_mode() {
%1 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"/bin/stty raw\00"
define void @raw_mode() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(double, double);
double pow_fun(double lhs, double rhs) { return pow(lhs, rhs); }


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

x86 assembly (clang, -O2):
<pow_fun>:
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @pow_fun(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
int main() {
  typedef struct {
    int x;
    int y;
  } COORDS;
  typedef struct {
    COORDS loc;
    char name[32];
  } OBJECT;
  volatile OBJECT ABC;
  while (1) {
    ABC.loc.x = 3;
    ABC.loc.y = 7;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x30(%rbp)
movl   $0x7,-0x2c(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
movl   $0x3,-0x4(%rsp)
movl   $0x7,-0x8(%rsp)
jmp    1100 <main>

LLVM IR (-O0):
%struct.OBJECT = type { %struct.COORDS, [32 x i8] }
%struct.COORDS = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.OBJECT
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = getelementptr inbounds %struct.OBJECT, %struct.OBJECT* %2, i32 0, i32 0
%5 = getelementptr inbounds %struct.COORDS, %struct.COORDS* %4, i32 0, i32 0
store volatile i32 3, i32* %5
%6 = getelementptr inbounds %struct.OBJECT, %struct.OBJECT* %2, i32 0, i32 0
%7 = getelementptr inbounds %struct.COORDS, %struct.COORDS* %6, i32 0, i32 1
store volatile i32 7, i32* %7
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
store volatile i32 3, i32* %1
store volatile i32 7, i32* %2
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xf3() {
  Assert_real((isalnum(243) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              1220, ("isalnum should be 0 for 0xf3"));
}


x86 assembly (clang, -O0):
<t_isalnum_0xf3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf3,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4c4,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0xf3>:
push   %rax
mov    $0xf3,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4c4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xf3\00"
define void @t_isalnum_0xf3() {
%1 = call i64 @isalnum(i32 243)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1220, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xf3\00"
define void @t_isalnum_0xf3() {
%1 = tail call i64 @isalnum(i32 243)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1220, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pic_send_EOI_normal(int);
void isr_irq_4() { pic_send_EOI_normal(4); }


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

x86 assembly (clang, -O2):
<isr_irq_4>:
mov    $0x4,%edi
jmp    1030 <pic_send_EOI_normal@plt>

LLVM IR (-O0):
define void @isr_irq_4() {
%1 = call i32 @pic_send_EOI_normal(i32 4)
ret void
}

LLVM IR (-O2):
define void @isr_irq_4() {
%1 = tail call i32 @pic_send_EOI_normal(i32 4)
ret void
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ copy_page(void *, void *);
void copy_user_page(void *to, void *from, unsigned long vaddr,
                    struct page *page) {
  copy_page(to, from);
}


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

x86 assembly (clang, -O2):
<copy_user_page>:
jmp    1030 <copy_page@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @copy_user_page(i8* %0, i8* %1, i64 %2, %struct.page* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.page*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store %struct.page* %3, %struct.page** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @copy_page(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @copy_user_page(i8* %0, i8* %1, i64 %2, %struct.page* nocapture readnone %3) {
%5 = tail call i32 @copy_page(i8* %0, i8* %1)
ret void
}
double foo(double d) { return __builtin_pow(d, 2); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 2.000000e+00)
ret double %4
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int rand();
uint64_t randomint64() {
  uint64_t a = rand();
  uint64_t b = rand() & 0xffff;
  uint64_t c = rand() & 0xffff;
  uint64_t d = (rand() & 0xffff) + 1;
  return a << 48 | b << 32 | c << 16 | d;
}


x86 assembly (clang, -O0):
<randomint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomint64>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rand@plt>

LLVM IR (-O0):
define i32 @randomint64() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @rand()
store i32 %5, i32* %1
%6 = call i32 (...) @rand()
%7 = and i32 %6, 65535
store i32 %7, i32* %2
%8 = call i32 (...) @rand()
%9 = and i32 %8, 65535
store i32 %9, i32* %3
%10 = call i32 (...) @rand()
%11 = and i32 %10, 65535
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %1
%14 = shl i32 %13, 48
%15 = load i32, i32* %2
%16 = shl i32 %15, 32
%17 = or i32 %14, %16
%18 = load i32, i32* %3
%19 = shl i32 %18, 16
%20 = or i32 %17, %19
%21 = load i32, i32* %4
%22 = or i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @randomint64() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
ret i32 poison
}