xunge/DecIR huggingface dataset:
void mdp4_dsi_cmd_overlay_blt(struct msm_fb_data_type *mfd,
                              struct msmfb_overlay_blt *req) {}


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

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

LLVM IR (-O0):
%struct.msm_fb_data_type = type opaque
%struct.msmfb_overlay_blt = type opaque
define void @mdp4_dsi_cmd_overlay_blt(%struct.msm_fb_data_type* %0, %struct.msmfb_overlay_blt* %1) {
%3 = alloca %struct.msm_fb_data_type*
%4 = alloca %struct.msmfb_overlay_blt*
store %struct.msm_fb_data_type* %0, %struct.msm_fb_data_type** %3
store %struct.msmfb_overlay_blt* %1, %struct.msmfb_overlay_blt** %4
ret void
}

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
%struct.msmfb_overlay_blt = type opaque
define void @mdp4_dsi_cmd_overlay_blt(%struct.msm_fb_data_type* nocapture %0, %struct.msmfb_overlay_blt* nocapture %1) {
ret void
}
/* Variables and functions */
char *_crop_sentence(char *sentence, size_t length) {
  sentence += 5 + 2;
  sentence[length - 9] = '\0';
  if ('*' == sentence[length - 12]) {
    sentence[length - 12] = '\0';
  }
  return sentence;
}


x86 assembly (clang, -O0):
<_crop_sentence>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x9,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0xc,%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x2a,%eax
cmp    %ecx,%eax
jne    1155 <_crop_sentence+0x55>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0xc,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_crop_sentence>:
lea    0x7(%rdi),%rax
movb   $0x0,-0x2(%rsi,%rdi,1)
cmpb   $0x2a,-0x5(%rsi,%rdi,1)
jne    1115 <_crop_sentence+0x15>
movb   $0x0,-0xc(%rax,%rsi,1)
ret

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

LLVM IR (-O2):
define i8* @_crop_sentence(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 7
%4 = add i64 %1, -9
%5 = getelementptr inbounds i8, i8* %3, i64 %4
store i8 0, i8* %5
%6 = add i64 %1, -12
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 42
br i1 %9, label %10, label %11
10: ; preds = %2
store i8 0, i8* %7
br label %11
11: ; preds = %10, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float a = (3.31 * 10 - 8 * 2.01 * 10 - 7);
  float b = (7.16 * 10 - 6 + 2.01 * 10 - 8);
  float answer;
  answer = a / b;
  printf("(3.31 * 10 - 8 * 2.01 * 10 - 7) / (7.16 * 10 - 6 + 2.01 * 10 - 8) \n "
         "= %e\n",
         answer);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [74 x i8] c"(3.31 * 10 - 8 * 2.01 * 10 - 7) / (7.16 * 10 - 6 + 2.01 * 10 - 8) \0A = %e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 0xC060D66660000000, float* %2
store float 0x40536CCCC0000000, float* %3
%5 = load float, float* %2
%6 = load float, float* %3
%7 = fdiv float %5, %6
store float %7, float* %4
%8 = load float, float* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [74 x i8] c"(3.31 * 10 - 8 * 2.01 * 10 - 7) / (7.16 * 10 - 6 + 2.01 * 10 - 8) \0A = %e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), float 0xBFFBBCC9A0000000)
ret i32 0
}
int fdd_get_bitcell_period(int rate) {
  int bit_rate = 250;
  switch (rate) {
  case 0:
    bit_rate = 500;
    break;
  case 1:
    bit_rate = 300;
    break;
  case 2:
    bit_rate = 250;
    break;
  case 3:
    bit_rate = 1000;
    break;
  }
  return 1000000 / bit_rate * 2;
}


x86 assembly (clang, -O0):
<fdd_get_bitcell_period>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xfa,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     115e <fdd_get_bitcell_period+0x5e>
mov    -0x10(%rbp),%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1f4,-0x8(%rbp)
jmp    115e <fdd_get_bitcell_period+0x5e>
movl   $0x12c,-0x8(%rbp)
jmp    115e <fdd_get_bitcell_period+0x5e>
movl   $0xfa,-0x8(%rbp)
jmp    115e <fdd_get_bitcell_period+0x5e>
movl   $0x3e8,-0x8(%rbp)
mov    $0xf4240,%eax
cltd
idivl  -0x8(%rbp)
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdd_get_bitcell_period>:
mov    $0xfa,%ecx
cmp    $0x3,%edi
ja     1117 <fdd_get_bitcell_period+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%ecx
mov    $0xf4240,%eax
xor    %edx,%edx
div    %ecx
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fdd_get_bitcell_period(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 250, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i32 500, i32* %3
br label %9
6: ; preds = %1
store i32 300, i32* %3
br label %9
7: ; preds = %1
store i32 250, i32* %3
br label %9
8: ; preds = %1
store i32 1000, i32* %3
br label %9
9: ; preds = %1, %8, %7, %6, %5
%10 = load i32, i32* %3
%11 = sdiv i32 1000000, %10
%12 = mul nsw i32 %11, 2
ret i32 %12
}

LLVM IR (-O2):
@switch.table.fdd_get_bitcell_period = [4 x i32] [i32 500, i32 300, i32 250, i32 1000]
define i32 @fdd_get_bitcell_period(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.fdd_get_bitcell_period, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 250, %1 ], [ %6, %3 ]
%9 = udiv i32 1000000, %8
%10 = shl nuw nsw i32 %9, 1
ret i32 %10
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int ffs32(int);
int ffs64(uint64_t word) {
  uint32_t h = word & 0xffffffff;
  if (!h)
    return ffs32(word >> 32) + 32;
  return ffs32(h);
}


x86 assembly (clang, -O0):
<ffs64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1148 <ffs64+0x38>
mov    -0x8(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <ffs32@plt>
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <ffs64+0x43>
mov    -0xc(%rbp),%edi
call   1030 <ffs32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs64>:
test   %edi,%edi
je     1119 <ffs64+0x9>
jmp    1030 <ffs32@plt>
push   %rax
call   1030 <ffs32@plt>
add    $0x20,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ffs64(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @ffs32(i32 poison)
%5 = add nsw i32 %4, 32
br label %8
6: ; preds = %1
%7 = tail call i32 @ffs32(i32 %0)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ %5, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char const *);
void uninit_fopen(void) {
  const char *filename, *mode;
  FILE *fp;
  fp = fopen(filename, "rt");
  fclose(fp);
  fp = fopen("filename.txt", mode);
  fclose(fp);
}


x86 assembly (clang, -O0):
<uninit_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninit_fopen>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
call   1030 <fclose@plt>
lea    0xec7(%rip),%rdi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rt\00"
@.str.1 = [13 x i8] c"filename.txt\00"
define void @uninit_fopen() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32*
%4 = load i8*, i8** %1
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fclose(i32* %6)
%8 = load i8*, i8** %2
%9 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %8)
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = call i32 @fclose(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"rt\00"
@.str.1 = [13 x i8] c"filename.txt\00"
define void @uninit_fopen() {
%1 = tail call i32* @fopen(i8* undef, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* undef)
%4 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
char getchar();
char toupper(char);
char lirecaractere() {
  char caractere = 0;
  caractere = getchar();
  caractere = toupper(caractere);
  while (getchar() != '\n')
    ;
  return caractere;
}


x86 assembly (clang, -O0):
<lirecaractere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     115a <lirecaractere+0x3a>
jmp    1142 <lirecaractere+0x22>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lirecaractere>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1140 <lirecaractere+0x20>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @lirecaractere() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = call signext i8 @toupper(i8 signext %3)
store i8 %4, i8* %1
br label %5
5: ; preds = %9, %0
%6 = call signext i8 (...) @getchar()
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @lirecaractere() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call signext i8 @toupper(i8 signext %1)
br label %3
3: ; preds = %3, %0
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3
ret i8 %2
}
int main() {
  printf("Current function is %s\n", __func__);
  double c = hypot(3.3f, 4.4f);
  printf("%lf\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xeb4(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
call   1040 <hypot@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xec3(%rip),%rdi
mov    $0x1,%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
lea    0xef9(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0xec2(%rip),%xmm0
movsd  0xec2(%rip),%xmm1
call   1040 <hypot@plt>
lea    0xedb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Current function is %s\0A\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%4 = call double @hypot(double 0x400A666660000000, double 0x40119999A0000000)
store double %4, double* %2
%5 = load double, double* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Current function is %s\0A\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%2 = tail call double @hypot(double 0x400A666660000000, double 0x40119999A0000000)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %2)
ret i32 0
}
char up(unsigned char in) {
  if (in >= 97 && in <= 172) {
    return (char)in - 32;
  } else if (in >= 65 && in <= 90) {
    return (char)in;
  } else {
    return ' ';
  }
}


x86 assembly (clang, -O0):
<up>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1135 <up+0x35>
movzbl -0x2(%rbp),%eax
cmp    $0xac,%eax
jg     1135 <up+0x35>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    115e <up+0x5e>
movzbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     115a <up+0x5a>
movzbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     115a <up+0x5a>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    115e <up+0x5e>
movb   $0x20,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<up>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
lea    -0x41(%rdi),%edx
cmp    $0x1a,%dl
mov    $0x20,%edx
cmovb  %edi,%edx
cmp    $0x4c,%al
movzbl %cl,%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @up(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 172
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %27
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i8, i8* %3
%22 = zext i8 %21 to i32
%23 = icmp sle i32 %22, 90
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i8, i8* %3
store i8 %25, i8* %2
br label %27
26: ; preds = %20, %16
store i8 32, i8* %2
br label %27
27: ; preds = %26, %24, %11
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @up(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 76
%4 = add i8 %0, -32
%5 = add i8 %0, -65
%6 = icmp ult i8 %5, 26
%7 = select i1 %6, i8 %0, i8 32
%8 = select i1 %3, i8 %4, i8 %7
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *c) {
  printf("<exCSS Configurator/>\n"
         " :: Usage:\n"
         "     %s <filename>\n"
         " Used to configure .ex files\n"
         " Copyright (C) 2015 Marius Messerschmidt\n",
         c);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [123 x i8] c"<exCSS Configurator/>\0A :: Usage:\0A %s <filename>\0A Used to configure .ex files\0A Copyright (C) 2015 Marius Messerschmidt\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [123 x i8] c"<exCSS Configurator/>\0A :: Usage:\0A %s <filename>\0A Used to configure .ex files\0A Copyright (C) 2015 Marius Messerschmidt\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ optval;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int const, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
bool setSocketReuseAddress(const int socket) {
  int optval = 1;
  return (setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, &optval,
                     sizeof(optval)) != -1);
}


x86 assembly (clang, -O0):
<setSocketReuseAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSocketReuseAddress>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @setSocketReuseAddress(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @setSocketReuseAddress(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
%7 = icmp ne i32 %6, -1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ console_put(int /*<<< orphan*/);
void console_put_string_raw(const char *str) {
  while (*str)
    console_put(*str++);
}


x86 assembly (clang, -O0):
<console_put_string_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <console_put_string_raw+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <console_put@plt>
jmp    111c <console_put_string_raw+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_put_string_raw>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <console_put_string_raw+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <console_put@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <console_put_string_raw+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @console_put_string_raw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @console_put(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @console_put_string_raw(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @console_put(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void save_the_world(void) { printf("There is no hope!"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"There is no hope!\00"
define void @save_the_world() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"There is no hope!\00"
define void @save_the_world() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int dspd_strtou64(char const *, int /*<<< orphan*/ *, int);
int dspd_strtoull(const char *str, unsigned long long *n, int base) {
  return dspd_strtou64(str, (uint64_t *)n, base);
}


x86 assembly (clang, -O0):
<dspd_strtoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <dspd_strtou64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dspd_strtoull>:
jmp    1030 <dspd_strtou64@plt>

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

LLVM IR (-O2):
define i32 @dspd_strtoull(i8* %0, i64* %1, i32 %2) {
%4 = bitcast i64* %1 to i32*
%5 = tail call i32 @dspd_strtou64(i8* %0, i32* %4, i32 %2)
ret i32 %5
}
int bar(unsigned c, unsigned d) { return (c - d - 1) < c; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
sub    $0x1,%eax
cmp    -0x4(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
cmp    %edi,%esi
setb   %al
ret

LLVM IR (-O0):
define i32 @bar(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 = sub i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %3
%10 = icmp ult i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int f(void) {
  int a[20];
  a[0] = 33;
  a[2] = 19;
  return a[2];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x21,-0x50(%rbp)
movl   $0x13,-0x48(%rbp)
mov    -0x48(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca [20 x i32]
%2 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
store i32 33, i32* %2
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 2
store i32 19, i32* %3
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f() {
ret i32 19
}
int Operand_mx_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0x3) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_mx_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffffc,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_mx_encode>:
xor    %eax,%eax
cmpl   $0x4,(%rdi)
setae  %al
ret

LLVM IR (-O0):
define i32 @Operand_mx_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @Operand_mx_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ splitSum(int, int);
void goldbachConjecture(int n) { splitSum(n, 1); }


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

x86 assembly (clang, -O2):
<goldbachConjecture>:
mov    $0x1,%esi
jmp    1030 <splitSum@plt>

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

LLVM IR (-O2):
define void @goldbachConjecture(i32 %0) {
%2 = tail call i32 @splitSum(i32 %0, i32 1)
ret void
}
int test_imm_6Cint32_mem(int *val) {
  return ((*val) & (0x6C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Cint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 108
%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_6Cint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 108
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, int);
void version(char *name) { printf("%s Version %d.%d\n", name, 0, 99); }


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

x86 assembly (clang, -O2):
<version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
mov    $0x63,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s Version %d.%d\0A\00"
define void @version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0, i32 99)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s Version %d.%d\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0, i32 99)
ret void
}
/* Variables and functions */
scalar_t__ __builtin_llfloor(double);
int /*<<< orphan*/ link_failure_builtin_llfloor();
void test_builtin_llfloor(double d) {
  if (__builtin_llfloor(d) != __builtin_llfloor(d))
    link_failure_builtin_llfloor();
}


x86 assembly (clang, -O0):
<test_builtin_llfloor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_llfloor@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_llfloor@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_llfloor+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_llfloor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_llfloor>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <__builtin_llfloor@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <__builtin_llfloor@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_llfloor+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_llfloor@plt>

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

LLVM IR (-O2):
define void @test_builtin_llfloor(double %0) {
%2 = tail call i64 @__builtin_llfloor(double %0)
%3 = tail call i64 @__builtin_llfloor(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_llfloor()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) { fprintf(stderr, "%s: <n> <min_hd>\n", argv0); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"%s: <n> <min_hd>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void yywrap() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ PTRACE_PEEKTEXT;
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, void *, int /*<<< orphan*/);
int get_instruction(pid_t pid, int addr) {
  return ptrace(PTRACE_PEEKTEXT, pid, (void *)addr, 0);
}


x86 assembly (clang, -O0):
<get_instruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
movslq -0x8(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_instruction>:
mov    %edi,%eax
mov    0x2ec7(%rip),%rcx
mov    (%rcx),%edi
movslq %esi,%rdx
mov    %eax,%esi
xor    %ecx,%ecx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_PEEKTEXT = global i32 0
define i32 @get_instruction(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @PTRACE_PEEKTEXT
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = call i32 @ptrace(i32 %5, i32 %6, i8* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
@PTRACE_PEEKTEXT = global i32 0
define i32 @get_instruction(i32 %0, i32 %1) {
%3 = load i32, i32* @PTRACE_PEEKTEXT
%4 = sext i32 %1 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @ptrace(i32 %3, i32 %0, i8* %5, i32 0)
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ receber(int, char *, int);
void do_add(int sock) {
  char *msg = (char *)malloc(100);
  receber(sock, msg, 100);
}


x86 assembly (clang, -O0):
<do_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x64,%edx
call   1040 <receber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_add>:
push   %rbx
mov    %edi,%ebx
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %ebx,%edi
mov    %rax,%rsi
mov    $0x64,%edx
pop    %rbx
jmp    1040 <receber@plt>

LLVM IR (-O0):
define void @do_add(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 100)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = load i8*, i8** %3
%8 = call i32 @receber(i32 %6, i8* %7, i32 100)
ret void
}

LLVM IR (-O2):
define void @do_add(i32 %0) {
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @receber(i32 %0, i8* %3, i32 100)
ret void
}
void rectangle(int size, float *array) { ; }


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

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

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

LLVM IR (-O2):
define void @rectangle(i32 %0, float* nocapture %1) {
ret void
}
char *foo(char *tmp) {
  asm("" : "=r"(tmp) : "0"(tmp));
  return tmp + 2;
}


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

x86 assembly (clang, -O2):
<foo>:
lea    0x2(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 2
ret i8* %6
}

LLVM IR (-O2):
define i8* @foo(i8* readnone %0) {
%2 = tail call i8* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
%3 = getelementptr inbounds i8, i8* %2, i64 2
ret i8* %3
}
/* Type definitions */
typedef int u_long;

/* Variables and functions */
int cmp(const void *p1, const void *p2) {
  u_long *pl1 = (u_long *)p1;
  u_long *pl2 = (u_long *)p2;
  return *pl1 - *pl2;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
unsigned char *mem_copy_dword2vect_big(unsigned char *,
                                       int /*<<< orphan*/ const);
unsigned char *arch_mem_copy_dword2vect_big(unsigned char *v,
                                            const uint32_t dword) {
  return mem_copy_dword2vect_big(v, dword);
}


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

x86 assembly (clang, -O2):
<arch_mem_copy_dword2vect_big>:
jmp    1030 <mem_copy_dword2vect_big@plt>

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

LLVM IR (-O2):
define i8* @arch_mem_copy_dword2vect_big(i8* %0, i32 %1) {
%3 = tail call i8* @mem_copy_dword2vect_big(i8* %0, i32 %1)
ret i8* %3
}
/* Type definitions */
typedef unsigned int uint8_t;
typedef unsigned int uint16_t;

/* Variables and functions */
uint8_t GET_COMM_ALIGN(uint16_t n_desc) { return (n_desc >> 8u) & 0x0fu; }


x86 assembly (clang, -O0):
<GET_COMM_ALIGN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_COMM_ALIGN>:
mov    %edi,%eax
shr    $0x8,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @GET_COMM_ALIGN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 8
%5 = and i32 %4, 15
ret i32 %5
}

LLVM IR (-O2):
define i32 @GET_COMM_ALIGN(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 15
ret i32 %3
}
void kgsl_core_debugfs_close(void) {}


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

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

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

LLVM IR (-O2):
define void @kgsl_core_debugfs_close() {
ret void
}
char *dgettext(const char *domain, const char *msgid) { return (char *)msgid; }


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

x86 assembly (clang, -O2):
<dgettext>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @dgettext(i8* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
void Timer0A_Disable(void) {
  (*((volatile unsigned long *)0x4003000C)) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<Timer0A_Disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4003000c,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0x4003000c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer0A_Disable>:
andq   $0xfffffffffffffffe,0x4003000c
40 fe
ret

LLVM IR (-O0):
define void @Timer0A_Disable() {
%1 = load volatile i64, i64* inttoptr (i64 1073938444 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 1073938444 to i64*)
ret void
}

LLVM IR (-O2):
define void @Timer0A_Disable() {
%1 = load volatile i64, i64* inttoptr (i64 1073938444 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 1073938444 to i64*)
ret void
}
/* Variables and functions */
double pgamma(double, double, int, int);
double __attribute__((const)) pchisq(double x, double deg, int tail) {
  return pgamma(x / 2., deg / 2., 1., tail);
}


x86 assembly (clang, -O0):
<pchisq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xebd(%rip),%xmm2
divsd  %xmm2,%xmm1
mov    -0x14(%rbp),%esi
mov    $0x1,%edi
call   1030 <pgamma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pchisq>:
mov    %edi,%esi
movsd  0xee6(%rip),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm1
mov    $0x1,%edi
jmp    1030 <pgamma@plt>

LLVM IR (-O0):
define double @pchisq(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = fdiv double %7, 2.000000e+00
%9 = load double, double* %5
%10 = fdiv double %9, 2.000000e+00
%11 = load i32, i32* %6
%12 = call double @pgamma(double %8, double %10, i32 1, i32 %11)
ret double %12
}

LLVM IR (-O2):
define double @pchisq(double %0, double %1, i32 %2) {
%4 = fmul double %0, 5.000000e-01
%5 = fmul double %1, 5.000000e-01
%6 = tail call double @pgamma(double %4, double %5, i32 1, i32 %2)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "Usage: %s {sleep time in milliseconds}.\n", prog);
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
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 = [41 x i8] c"Usage: %s {sleep time in milliseconds}.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Usage: %s {sleep time in milliseconds}.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int exists_runnable_thread();
int stop_simulation(void) {
  int tmp;
  int _retres2;
  {
    { tmp = exists_runnable_thread(); }
    if (tmp) {
      _retres2 = 0;
      goto return_label;
    } else {
    }
    _retres2 = 1;
  return_label:
    return (_retres2);
  }
}


x86 assembly (clang, -O0):
<stop_simulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <exists_runnable_thread@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <stop_simulation+0x28>
movl   $0x0,-0x8(%rbp)
jmp    1144 <stop_simulation+0x34>
jmp    113d <stop_simulation+0x2d>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_simulation>:
push   %rax
xor    %eax,%eax
call   1030 <exists_runnable_thread@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @stop_simulation() {
%1 = tail call i32 (...) @exists_runnable_thread()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void numa_set_localalloc(void) {}


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

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

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

LLVM IR (-O2):
define void @numa_set_localalloc() {
ret void
}
void skipspace(char **c) {
  while (**c == ' ')
    (*c)++;
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    112e <skipspace+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <skipspace+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
mov    (%rdi),%rax
cmpb   $0x20,(%rax)
jne    111c <skipspace+0x1c>
add    $0x1,%rax
nopl   0x0(%rax)
mov    %rax,(%rdi)
cmpb   $0x20,(%rax)
lea    0x1(%rax),%rax
je     1110 <skipspace+0x10>
ret

LLVM IR (-O0):
define void @skipspace(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %9, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @skipspace(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 32
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i8* [ %7, %5 ], [ %2, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double rint(double x) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @rint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @rint(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}