xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
char *getString();
scalar_t__ strlen(char *);
int /*<<< orphan*/ traiteLigne(char *);
void IF_ExecCS(void) {
  char *f;
  f = getString();
  if (f != NULL) {
    if (strlen(f) > 0)
      traiteLigne(f);
    free((void *)f);
  }
}


x86 assembly (clang, -O0):
<IF_ExecCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getString@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1183 <IF_ExecCS+0x43>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
jle    117a <IF_ExecCS+0x3a>
mov    -0x8(%rbp),%rdi
call   1060 <traiteLigne@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_ExecCS>:
push   %rbx
xor    %eax,%eax
call   1030 <getString@plt>
test   %rax,%rax
je     116e <IF_ExecCS+0x2e>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <strlen@plt>
test   %rax,%rax
jle    1165 <IF_ExecCS+0x25>
mov    %rbx,%rdi
call   1060 <traiteLigne@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @IF_ExecCS() {
%1 = alloca i8*
%2 = call i8* (...) @getString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %15
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i64 @strlen(i8* %6)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %1
%11 = call i32 @traiteLigne(i8* %10)
br label %12
12: ; preds = %9, %5
%13 = load i8*, i8** %1
%14 = call i32 @free(i8* %13)
br label %15
15: ; preds = %12, %0
ret void
}

LLVM IR (-O2):
define void @IF_ExecCS() {
%1 = tail call i8* (...) @getString()
%2 = icmp eq i8* %1, null
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 @strlen(i8* %1)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @traiteLigne(i8* %1)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @free(i8* %1)
br label %10
10: ; preds = %8, %0
ret void
}
void ncore_deferred_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ncore_deferred_init() {
ret void
}
/* Variables and functions */
int mygetline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverseS(char *, int);
int main() {
  char line[1000];
  int len;
  while ((len = mygetline(line, 1000)) > 0) {
    reverseS(line, len);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <mygetline@plt>
mov    %eax,-0x3f4(%rbp)
cmp    $0x0,%eax
jle    118c <main+0x5c>
lea    -0x3f0(%rbp),%rdi
mov    -0x3f4(%rbp),%esi
call   1040 <reverseS@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <mygetline@plt>
test   %eax,%eax
jle    1186 <main+0x56>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <reverseS@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <mygetline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @mygetline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = call i32 @reverseS(i8* %2, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = call i32 @mygetline(i8* %2, i32 1000)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeezze(char *, char *);
int main() {
  char s1[] = "abcdddefghijklmn";
  char s2[] = "cdin888";
  squeeezze(s1, s2);
  printf("%s\n", s1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%al
mov    %al,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <squeeezze@plt>
lea    -0x20(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x20(%rsp)
movabs $0x3838386e696463,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <squeeezze@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [17 x i8] c"abcdddefghijklmn\00"
@__const.main.s2 = [8 x i8] c"cdin888\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca [8 x i8]
%3 = bitcast [17 x i8]* %1 to i8*
%4 = bitcast [8 x i8]* %2 to i8*
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%7 = call i32 @squeeezze(i8* %5, i8* %6)
%8 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [17 x i8] c"abcdddefghijklmn\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = bitcast i64* %2 to i8*
store i64 15824413717521507, i64* %2
%5 = call i32 @squeeezze(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void *strchr(void *, int);
uint32_t __attribute__((no)) vm_strchr(uint32_t a, int b, void *mem) {
  void *s = mem + a;
  void *r = strchr(s, b);
  int ret = r ? r - mem : 0;
  return ret;
}


x86 assembly (clang, -O0):
<vm_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1160 <vm_strchr+0x50>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x30(%rbp)
jmp    116b <vm_strchr+0x5b>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    116b <vm_strchr+0x5b>
mov    -0x30(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vm_strchr>:
push   %rbx
mov    %rdx,%rbx
movslq %edi,%rdi
add    %rdx,%rdi
call   1030 <strchr@plt>
mov    %eax,%edx
sub    %ebx,%edx
xor    %ecx,%ecx
test   %rax,%rax
cmovne %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @vm_strchr(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%10 = load i8*, i8** %6
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr i8, i8* %10, i64 %12
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = load i32, i32* %5
%16 = call i8* @strchr(i8* %14, i32 %15)
store i8* %16, i8** %8
%17 = load i8*, i8** %8
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %25
19: ; preds = %3
%20 = load i8*, i8** %8
%21 = load i8*, i8** %6
%22 = ptrtoint i8* %20 to i64
%23 = ptrtoint i8* %21 to i64
%24 = sub i64 %22, %23
br label %26
25: ; preds = %3
br label %26
26: ; preds = %25, %19
%27 = phi i64 [ %24, %19 ], [ 0, %25 ]
%28 = trunc i64 %27 to i32
store i32 %28, i32* %9
%29 = load i32, i32* %9
ret i32 %29
}

LLVM IR (-O2):
define i32 @vm_strchr(i32 %0, i32 %1, i8* %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr i8, i8* %2, i64 %4
%6 = tail call i8* @strchr(i8* dereferenceable(1) %5, i32 %1)
%7 = icmp eq i8* %6, null
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %2 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = select i1 %7, i32 0, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 30;
  double height = 3321.245;
  int test;
  printf("BROKENTIME.8. %d\n");
  printf("test.9. %d\n", test);
  printf("doubleint %d", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e,-0x8(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
movsd  0xec4(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"BROKENTIME.8. %d\0A\00"
@.str.1 = [12 x i8] c"test.9. %d\0A\00"
@.str.2 = [13 x i8] c"doubleint %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
store i32 30, i32* %2
store double 0x40A9F27D70A3D70A, double* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load double, double* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"BROKENTIME.8. %d\0A\00"
@.str.1 = [12 x i8] c"test.9. %d\0A\00"
@.str.2 = [13 x i8] c"doubleint %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 undef)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double 0x40A9F27D70A3D70A)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Towers();
int main() {
  int i;
  for (i = 0; i < 100; i++)
    Towers();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <Towers@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <Towers@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @Towers()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printLightingVolumeNeedle(int);
int /*<<< orphan*/ printf(char *, int);
void redisplayLightingVolumeNeedle(int light) {
  printf("\x1b[%d;1H", 7);
  printLightingVolumeNeedle(light);
  printf("\x1b[%d;1H", 14);
  return;
}


x86 assembly (clang, -O0):
<redisplayLightingVolumeNeedle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <printLightingVolumeNeedle@plt>
lea    0xeb5(%rip),%rdi
mov    $0xe,%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redisplayLightingVolumeNeedle>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1030 <printLightingVolumeNeedle@plt>
mov    %r14,%rdi
mov    $0xe,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[%d;1H\00"
define void @redisplayLightingVolumeNeedle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%4 = load i32, i32* %2
%5 = call i32 @printLightingVolumeNeedle(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[%d;1H\00"
define void @redisplayLightingVolumeNeedle(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = tail call i32 @printLightingVolumeNeedle(i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
uint8_t char_to_hex(char c) {
  if (c > '9') {
    c |= 0x20;
    c -= 0x57;
  } else {
    c -= 0x30;
  }
  return c;
}


x86 assembly (clang, -O0):
<char_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jle    1130 <char_to_hex+0x30>
movsbl -0x1(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x57,%eax
mov    %al,-0x1(%rbp)
jmp    113a <char_to_hex+0x3a>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_hex>:
mov    %edi,%eax
or     $0x20,%al
add    $0xa9,%al
lea    -0x30(%rdi),%ecx
cmp    $0x3a,%dil
movzbl %cl,%ecx
movzbl %al,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @char_to_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sgt i32 %4, 57
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = or i32 %8, 32
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 87
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %20
15: ; preds = %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 48
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
br label %20
20: ; preds = %15, %6
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @char_to_hex(i8 signext %0) {
%2 = icmp sgt i8 %0, 57
%3 = or i8 %0, 32
%4 = add i8 %3, -87
%5 = add i8 %0, -48
%6 = select i1 %2, i8 %4, i8 %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void exit_fail() {
  puts("-----------------------------");
  puts("[ERROR] Test crashed!");
  exit(-1);
}


x86 assembly (clang, -O0):
<exit_fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [30 x i8] c"-----------------------------\00"
@.str.1 = [22 x i8] c"[ERROR] Test crashed!\00"
define void @exit_fail() {
%1 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [30 x i8] c"-----------------------------\00"
@.str.1 = [22 x i8] c"[ERROR] Test crashed!\00"
define void @exit_fail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int is_digit(char c) { return '0' <= c && c <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <is_digit+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int_fast8_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_int_fast8_t(int_fast8_t const k1,
                                        int_fast8_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_int_fast8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_int_fast8_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_int_fast8_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_int_fast8_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct group {
  char *gr_name;
};
typedef int gid_t;

/* Variables and functions */
struct group *getgrgid(int);
int /*<<< orphan*/ printf(char *, int, ...);
void print_gid(gid_t gid) {
  struct group *gr = getgrgid(gid);
  if (gr) {
    printf("%d(%s)", gid, gr->gr_name);
  } else {
    printf("%d", gid);
  }
}


x86 assembly (clang, -O0):
<print_gid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <getgrgid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115f <print_gid+0x3f>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1170 <print_gid+0x50>
mov    -0x4(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_gid>:
push   %rbx
mov    %edi,%ebx
call   1040 <getgrgid@plt>
test   %rax,%rax
je     1141 <print_gid+0x21>
mov    (%rax),%rdx
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.group = type { i8* }
@.str = [7 x i8] c"%d(%s)\00"
@.str.1 = [3 x i8] c"%d\00"
define void @print_gid(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.group*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.group* @getgrgid(i32 %4)
store %struct.group* %5, %struct.group** %3
%6 = load %struct.group*, %struct.group** %3
%7 = icmp ne %struct.group* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %2
%10 = load %struct.group*, %struct.group** %3
%11 = getelementptr inbounds %struct.group, %struct.group* %10, i32 0, i32 0
%12 = load i8*, i8** %11
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %12)
br label %17
14: ; preds = %1
%15 = load i32, i32* %2
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %8
ret void
}

LLVM IR (-O2):
%struct.group = type { i8* }
@.str = [7 x i8] c"%d(%s)\00"
@.str.1 = [3 x i8] c"%d\00"
define void @print_gid(i32 %0) {
%2 = tail call %struct.group* @getgrgid(i32 %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %6)
br label %10
8: ; preds = %1
%9 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %10
10: ; preds = %8, %4
ret void
}
int compute(int i) { return i * i; }


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

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

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

LLVM IR (-O2):
define i32 @compute(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
char *dlerror(void) { return "unknow error"; }


x86 assembly (clang, -O0):
<dlerror>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlerror>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"unknow error\00"
define i8* @dlerror() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"unknow error\00"
define i8* @dlerror() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
void __attribute__((weak)) EXTI4_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI4_Callback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ opjump(char *, int);
void jump(int label) { opjump("", label); }


x86 assembly (clang, -O0):
<jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <opjump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <opjump@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @jump(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @opjump(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @jump(i32 %0) {
%2 = tail call i32 @opjump(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
START_TEST(test_handle_error) { handle_error("There are %d Monkeys.", 33); }


x86 assembly (clang, -O0):
<START_TEST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x21,%esi
mov    $0x0,%al
call   1030 <handle_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<START_TEST>:
lea    0xee9(%rip),%rdi
mov    $0x21,%esi
xor    %eax,%eax
jmp    1030 <handle_error@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"There are %d Monkeys.\00"
define i32 @START_TEST(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @handle_error to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 33)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [22 x i8] c"There are %d Monkeys.\00"
define i32 @START_TEST(i32 %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @handle_error to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 33)
ret i32 undef
}
void foo_1_1_1_2_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_1_2_2_2_1() {
ret void
}
void nsrEnd2SUBROUTINE_NAME_END() {}


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

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

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

LLVM IR (-O2):
define void @nsrEnd2SUBROUTINE_NAME_END() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkFile(int /*<<< orphan*/);
int /*<<< orphan*/ getFileLocation(int /*<<< orphan*/);
int initProfanity() { checkFile(getFileLocation(0)); }


x86 assembly (clang, -O0):
<initProfanity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <getFileLocation@plt>
mov    %eax,%edi
call   1030 <checkFile@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initProfanity>:
push   %rax
xor    %edi,%edi
call   1040 <getFileLocation@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <checkFile@plt>

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

LLVM IR (-O2):
define i32 @initProfanity() {
%1 = tail call i32 @getFileLocation(i32 0)
%2 = tail call i32 @checkFile(i32 %1)
ret i32 undef
}
/* Variables and functions */
int lengthOfLongestSubstring(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", lengthOfLongestSubstring(argv[1]));
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <lengthOfLongestSubstring@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @lengthOfLongestSubstring(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @lengthOfLongestSubstring(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void process_image(const void *p) {
  fputc('.', stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<process_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    $0x2e,%edi
call   1030 <fputc@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_image>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
mov    $0x2e,%edi
call   1030 <fputc@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @process_image(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputc(i8 signext 46, i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @process_image(i8* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputc(i8 signext 46, i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sighup_handler_child() { exit(101); }


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

x86 assembly (clang, -O2):
<sighup_handler_child>:
push   %rax
mov    $0x65,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sighup_handler_child() {
%1 = call i32 @exit(i32 101)
unreachable
}

LLVM IR (-O2):
define void @sighup_handler_child() {
%1 = tail call i32 @exit(i32 101)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
__attribute__((const)) uint8_t av_clip_uint8(int a) {
  if (a & (~0xFF))
    return (-a) >> 31;
  else
    return a;
}


x86 assembly (clang, -O0):
<av_clip_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffff00,%eax
cmp    $0x0,%eax
je     1128 <av_clip_uint8+0x28>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <av_clip_uint8+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clip_uint8>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
neg    %eax
cmp    $0x100,%edi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @av_clip_uint8(i32 %0) {
%2 = icmp ult i32 %0, 256
%3 = icmp sgt i32 %0, 0
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 %0, i32 %4
ret i32 %5
}
int test_imm_80uint8_reg(unsigned char val) {
  return ((val) & (-0x80 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_80uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff80,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_80uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -128
%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_80uint8_reg(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
char const *spx_php_global_array_get(char *, char const *);
const char *source_handler_http_cookie(const char *parameter) {
  return spx_php_global_array_get("_COOKIE", parameter);
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"_COOKIE\00"
define i8* @source_handler_http_cookie(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @spx_php_global_array_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"_COOKIE\00"
define i8* @source_handler_http_cookie(i8* %0) {
%2 = tail call i8* @spx_php_global_array_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
void genand() {}


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

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

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

LLVM IR (-O2):
define void @genand() {
ret void
}
/* Variables and functions */
scalar_t__ allocate_mem(int, int /*<<< orphan*/, int, unsigned long);
char *allocate_chars(long n_char) {
  return (char *)allocate_mem(5, 0, sizeof(char), (unsigned long)n_char);
}


x86 assembly (clang, -O0):
<allocate_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x5,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <allocate_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_chars>:
mov    %rdi,%rcx
mov    $0x5,%edi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <allocate_mem@plt>

LLVM IR (-O0):
define i8* @allocate_chars(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @allocate_mem(i32 5, i32 0, i32 1, i64 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @allocate_chars(i64 %0) {
%2 = tail call i64 @allocate_mem(i32 5, i32 0, i32 1, i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printstr(void *string) { (void)printf(" %s", *(char **)string); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c" %s\00"
define void @printstr(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bug(int *);
void test_bug_1() {
  int *p = 0;
  bug(p);
}


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

x86 assembly (clang, -O2):
<test_bug_1>:
xor    %edi,%edi
jmp    1030 <bug@plt>

LLVM IR (-O0):
define void @test_bug_1() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
%3 = call i32 @bug(i32* %2)
ret void
}

LLVM IR (-O2):
define void @test_bug_1() {
%1 = tail call i32 @bug(i32* null)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_scale_solutions(int dim, int basis, double *cff) {
  int fail;
  fail = _ada_use_c2phc4c(594, &dim, &basis, cff, 0);
  return fail;
}


x86 assembly (clang, -O0):
<standard_scale_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x252,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_scale_solutions>:
push   %rax
mov    %rdx,%rcx
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x252,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @standard_scale_solutions(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 594, i32* %4, i32* %5, double* %8, i32 0)
store i32 %9, i32* %7
%10 = load i32, i32* %7
ret i32 %10
}

LLVM IR (-O2):
define i32 @standard_scale_solutions(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc4c(i32 594, i32* %4, i32* %5, double* %2, i32 0)
ret i32 %6
}
int my_strlen(char *str) {
  int i = 0;
  while (str[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int dmp_pm_finalize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dmp_pm_finalize() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
unsigned char set_flags(unsigned char *fragment, unsigned char flags) {
  memcpy(fragment, &flags, 1);
  return flags;
}


x86 assembly (clang, -O0):
<set_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_flags>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i8 @set_flags(i8* %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @memcpy(i8* %0, i8* %3, i32 1)
%5 = load i8, i8* %3
ret i8 %5
}
int logicAnd(int x, int y) {
  if (x == 1 && y == 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<logicAnd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    112a <logicAnd+0x2a>
cmpl   $0x1,-0xc(%rbp)
jne    112a <logicAnd+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <logicAnd+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicAnd>:
xor    $0x1,%edi
xor    $0x1,%esi
xor    %eax,%eax
or     %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @logicAnd(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 = icmp eq i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %3
br label %13
12: ; preds = %8, %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @logicAnd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = icmp eq i32 %1, 1
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
#define LOCK_EX 130
int LOCK_NB;
#define LOCK_SH 129
#define LOCK_UN 128
char lockchar(int l) {
  switch (l & ~LOCK_NB) {
  case LOCK_SH:
    return 's';
  case LOCK_EX:
    return 'x';
  case LOCK_UN:
    return 'u';
  default:
    return '*';
  }
}


x86 assembly (clang, -O0):
<lockchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec7(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
sub    $0x80,%eax
je     1162 <lockchar+0x62>
jmp    112a <lockchar+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x81,%eax
je     1150 <lockchar+0x50>
jmp    113d <lockchar+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x82,%eax
je     1159 <lockchar+0x59>
jmp    116b <lockchar+0x6b>
movb   $0x73,-0x1(%rbp)
jmp    116f <lockchar+0x6f>
movb   $0x78,-0x1(%rbp)
jmp    116f <lockchar+0x6f>
movb   $0x75,-0x1(%rbp)
jmp    116f <lockchar+0x6f>
movb   $0x2a,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lockchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
not    %eax
and    %edi,%eax
lea    -0x400(,%rax,8),%ecx
add    $0xffffff80,%eax
mov    $0x787375,%edx
shr    %cl,%edx
cmp    $0x3,%eax
mov    $0x2a,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
@LOCK_NB = global i32 0
define signext i8 @lockchar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @LOCK_NB
%6 = xor i32 %5, -1
%7 = and i32 %4, %6
switch i32 %7, label %11 [
i32 129, label %8
i32 130, label %9
i32 128, label %10
]
8: ; preds = %1
store i8 115, i8* %2
br label %12
9: ; preds = %1
store i8 120, i8* %2
br label %12
10: ; preds = %1
store i8 117, i8* %2
br label %12
11: ; preds = %1
store i8 42, i8* %2
br label %12
12: ; preds = %11, %10, %9, %8
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
@LOCK_NB = global i32 0
define signext i8 @lockchar(i32 %0) {
%2 = load i32, i32* @LOCK_NB
%3 = xor i32 %2, -1
%4 = and i32 %3, %0
%5 = add i32 %4, -128
%6 = icmp ult i32 %5, 3
%7 = trunc i32 %5 to i24
%8 = shl i24 %7, 3
%9 = lshr i24 7893877, %8
%10 = trunc i24 %9 to i8
%11 = select i1 %6, i8 %10, i8 42
ret i8 %11
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=20 REPO_URL=r3p2-01rel2 REVISION=r3p2-01rel2 "
         "CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Dec  6 13:12:54 KST "
         "2013 BUILD=release TARGET_PLATFORM=exynos3250 "
         "MALI_PLATFORM=exynos3250 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 "
         "USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= "
         "USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [355 x i8] c"malidrv: API_VERSION=20 REPO_URL=r3p2-01rel2 REVISION=r3p2-01rel2 CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Dec 6 13:12:54 KST 2013 BUILD=release TARGET_PLATFORM=exynos3250 MALI_PLATFORM=exynos3250 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([355 x i8], [355 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [355 x i8] c"malidrv: API_VERSION=20 REPO_URL=r3p2-01rel2 REVISION=r3p2-01rel2 CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Dec 6 13:12:54 KST 2013 BUILD=release TARGET_PLATFORM=exynos3250 MALI_PLATFORM=exynos3250 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([355 x i8], [355 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("This program only works with X11.\n");
  return -1;
}


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    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"This program only works with X11.\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 ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@str = [34 x i8] c"This program only works with X11.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 -1
}