xunge/DecIR huggingface dataset:
/* Variables and functions */
int read_keypad();
int getchar() {
  int c = 0;
  while (read_keypad())
    ;
  while (!c)
    c = read_keypad();
  return c;
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <read_keypad@plt>
cmp    $0x0,%eax
je     1134 <getchar+0x24>
jmp    111f <getchar+0xf>
jmp    1139 <getchar+0x29>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114f <getchar+0x3f>
jmp    115e <getchar+0x4e>
mov    $0x0,%al
call   1030 <read_keypad@plt>
mov    %eax,-0x4(%rbp)
jmp    1139 <getchar+0x29>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_keypad@plt>
test   %eax,%eax
jne    1120 <getchar+0x10>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_keypad@plt>
test   %eax,%eax
je     1130 <getchar+0x20>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getchar() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @read_keypad()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1, %4
%5 = tail call i32 (...) @read_keypad()
%6 = icmp eq i32 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
ret i32 %5
}
char *ft_strcpy(char *s1, char const *s2) {
  int i;
  i = 0;
  while (s2[i] != 0x00) {
    s1[i] = ((char *)s2)[i];
    i++;
  }
  s1[i] = 0x00;
  return (s1);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <ft_strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <ft_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <ft_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <ft_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define i8* @ft_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %3
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 0, i8* %30
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
int dbg_time_print() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dbg_time_print() {
ret i32 0
}
/* Variables and functions */
char *stralloc(char *);
char *strrchr(char *, char);
char *_glmDirName(char *path) {
  char *dir;
  char *s;
  dir = stralloc(path);
  s = strrchr(dir, '/');
  if (s)
    s[1] = '\0';
  else
    dir[0] = '\0';
  return dir;
}


x86 assembly (clang, -O0):
<_glmDirName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <stralloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1163 <_glmDirName+0x43>
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
jmp    116a <_glmDirName+0x4a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glmDirName>:
push   %rbx
call   1030 <stralloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
movb   $0x0,(%rcx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_glmDirName(i8* %0) {
%2 = tail call i8* @stralloc(i8* %0)
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %2, i8 signext 47)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* %2, i8* %5
store i8 0, i8* %6
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M208_f(char *s) {
  debug("M208_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c"M208_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M208_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetLoudness(void *, int);
int /*<<< orphan*/ printf(char *, unsigned int, char *);
void UPnPRenderingControl_GetLoudness(void *upnptoken, unsigned int InstanceID,
                                      char *Channel) {
  printf("Invoke: UPnPRenderingControl_GetLoudness(%u,%s);\r\n", InstanceID,
         Channel);
  UPnPResponse_RenderingControl_GetLoudness(upnptoken, 1);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetLoudness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <UPnPResponse_RenderingControl_GetLoudness@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_GetLoudness>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_GetLoudness@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Invoke: UPnPRenderingControl_GetLoudness(%u,%s);\0D\0A\00"
define void @UPnPRenderingControl_GetLoudness(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_RenderingControl_GetLoudness(i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"Invoke: UPnPRenderingControl_GetLoudness(%u,%s);\0D\0A\00"
define void @UPnPRenderingControl_GetLoudness(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = tail call i32 @UPnPResponse_RenderingControl_GetLoudness(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vecNd_add_new(double *, double *, double const *, int const);
void vecNd_add(double a[], const double b[], const int n) {
  vecNd_add_new(a, a, b, n);
}


x86 assembly (clang, -O0):
<vecNd_add>:
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    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <vecNd_add_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecNd_add>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <vecNd_add_new@plt>

LLVM IR (-O0):
define void @vecNd_add(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 = load double*, double** %4
%9 = load double*, double** %5
%10 = load i32, i32* %6
%11 = call i32 @vecNd_add_new(double* %7, double* %8, double* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @vecNd_add(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @vecNd_add_new(double* %0, double* %0, double* %1, i32 %2)
ret void
}
int test_imm_48int32_mem(int *val) {
  return ((*val) & (0x48 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_48int32_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, 72
%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_48int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 72
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_91int64_midword_reg(long long val) {
  return ((val >> 16) & (0x91 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_91int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 145
%6 = icmp ne i64 %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_91int64_midword_reg(i64 %0) {
%2 = and i64 %0, 9502720
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  while (x >= 0) {
    x = x + y;
    y = z;
    z = -z - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1166 <main+0x56>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
sub    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SA1DirectIndirectIndexedLong(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op97M1(void) { STA8(SA1DirectIndirectIndexedLong(2)); }


x86 assembly (clang, -O0):
<Op97M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1DirectIndirectIndexedLong@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op97M1>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1DirectIndirectIndexedLong@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op97M1() {
%1 = call i32 @SA1DirectIndirectIndexedLong(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op97M1() {
%1 = tail call i32 @SA1DirectIndirectIndexedLong(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
int howManyPrimes(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  double a, b, c;
  printf("%u\n", howManyPrimes(1, 1000));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1040 <howManyPrimes@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1040 <howManyPrimes@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @howManyPrimes(i32 1, i32 1000)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @howManyPrimes(i32 1, i32 1000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int BaseTransform(int base) {
  switch (base) {
  case 'a':
  case 'A':
    return 'A';
  case 'c':
  case 'C':
    return 'C';
  case 'g':
  case 'G':
    return 'G';
  case 't':
  case 'T':
    return 'T';
  default:
    return '-';
  }
}


x86 assembly (clang, -O0):
<BaseTransform>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x33,%eax
ja     1160 <BaseTransform+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x41,-0x4(%rbp)
jmp    1167 <BaseTransform+0x67>
movl   $0x43,-0x4(%rbp)
jmp    1167 <BaseTransform+0x67>
movl   $0x47,-0x4(%rbp)
jmp    1167 <BaseTransform+0x67>
movl   $0x54,-0x4(%rbp)
jmp    1167 <BaseTransform+0x67>
movl   $0x2d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaseTransform>:
add    $0xffffffbf,%edi
cmp    $0x33,%edi
ja     112f <BaseTransform+0x2f>
mov    $0x41,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x43,%eax
ret
mov    $0x47,%eax
ret
mov    $0x54,%eax
ret
mov    $0x2d,%eax
ret

LLVM IR (-O0):
define i32 @BaseTransform(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 97, label %5
i32 65, label %5
i32 99, label %6
i32 67, label %6
i32 103, label %7
i32 71, label %7
i32 116, label %8
i32 84, label %8
]
5: ; preds = %1, %1
store i32 65, i32* %2
br label %10
6: ; preds = %1, %1
store i32 67, i32* %2
br label %10
7: ; preds = %1, %1
store i32 71, i32* %2
br label %10
8: ; preds = %1, %1
store i32 84, i32* %2
br label %10
9: ; preds = %1
store i32 45, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @BaseTransform(i32 %0) {
switch i32 %0, label %5 [
i32 97, label %6
i32 65, label %6
i32 99, label %2
i32 67, label %2
i32 103, label %3
i32 71, label %3
i32 116, label %4
i32 84, label %4
]
2: ; preds = %1, %1
br label %6
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3, %2
%7 = phi i32 [ 45, %5 ], [ 84, %4 ], [ 71, %3 ], [ 67, %2 ], [ 65, %1 ], [ 65, %1 ]
ret i32 %7
}
/* Variables and functions */
int sestej(int);
int vsotaStevk(int v, int n) {
  if (n == 0) {
    return v;
  }
  return vsotaStevk(sestej(v), n - 1);
}


x86 assembly (clang, -O0):
<vsotaStevk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1143 <vsotaStevk+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <vsotaStevk+0x3b>
mov    -0x8(%rbp),%edi
call   1040 <sestej@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <vsotaStevk@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsotaStevk>:
push   %rbx
mov    %edi,%eax
test   %esi,%esi
je     112c <vsotaStevk+0x1c>
mov    %esi,%ebx
nopl   0x0(%rax)
mov    %eax,%edi
call   1030 <sestej@plt>
add    $0xffffffff,%ebx
jne    1120 <vsotaStevk+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @vsotaStevk(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = tail call i32 @sestej(i32 %6)
%8 = add nsw i32 %5, -1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i32 [ %0, %2 ], [ %7, %4 ]
ret i32 %11
}
void RTMemLockedAllocTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemLockedAllocTag() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gfx_color(int, int, int);
int /*<<< orphan*/ gfx_text(int, double, char *);
int /*<<< orphan*/ my_gfx_cleararea(int, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void display_level(int level) {
  my_gfx_cleararea(13 * 20, 0, 6 * 20, 2 * 20);
  char level_string[20];
  gfx_color(34, 202, 51);
  sprintf(level_string, "LEVEL %d", level);
  gfx_text(13 * 20, 1.5 * 20, level_string);
}


x86 assembly (clang, -O0):
<display_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x104,%edi
xor    %esi,%esi
mov    $0x78,%edx
mov    $0x28,%ecx
call   1050 <my_gfx_cleararea@plt>
mov    $0x22,%edi
mov    $0xca,%esi
mov    $0x33,%edx
call   1040 <gfx_color@plt>
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe85(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rsi
mov    $0x104,%edi
movsd  0xe67(%rip),%xmm0
call   1030 <gfx_text@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_level>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
mov    $0x104,%edi
xor    %esi,%esi
mov    $0x78,%edx
mov    $0x28,%ecx
call   1050 <my_gfx_cleararea@plt>
mov    $0x22,%edi
mov    $0xca,%esi
mov    $0x33,%edx
call   1040 <gfx_color@plt>
lea    0xe8f(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %ebp,%edx
call   1060 <sprintf@plt>
movsd  0xe72(%rip),%xmm0
mov    $0x104,%edi
mov    %rbx,%rsi
call   1030 <gfx_text@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"LEVEL %d\00"
define void @display_level(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 %0, i32* %2
%4 = call i32 @my_gfx_cleararea(i32 260, i32 0, i32 120, i32 40)
%5 = call i32 @gfx_color(i32 34, i32 202, i32 51)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = call i32 @gfx_text(i32 260, double 3.000000e+01, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"LEVEL %d\00"
define void @display_level(i32 %0) {
%2 = alloca [20 x i8]
%3 = tail call i32 @my_gfx_cleararea(i32 260, i32 0, i32 120, i32 40)
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @gfx_color(i32 34, i32 202, i32 51)
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @gfx_text(i32 260, double 3.000000e+01, i8* %4)
ret void
}
int debug_defined() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @debug_defined() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int override_redirect;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
void set_XSetWindowAttributes_override_redirect(void *_p, int _v) {
  ((XSetWindowAttributes *)_p)->override_redirect = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XSetWindowAttributes_override_redirect>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XSetWindowAttributes_override_redirect(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XSetWindowAttributes_override_redirect(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void ScaleRowDown38_16_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown38_16_C() {
ret void
}
/* Variables and functions */
char *getPath2(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getUserGameDataDir();
char *getUserGraphicsDir() {
  static char *usergraphics_dir = NULL;
  if (usergraphics_dir == NULL)
    usergraphics_dir = getPath2(getUserGameDataDir(), "graphics");
  return usergraphics_dir;
}


x86 assembly (clang, -O0):
<getUserGraphicsDir>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f0c(%rip)
jne    114e <getUserGraphicsDir+0x2e>
mov    $0x0,%al
call   1030 <getUserGameDataDir@plt>
mov    %eax,%edi
lea    0xebe(%rip),%rsi
call   1040 <getPath2@plt>
mov    %rax,0x2eea(%rip)
mov    0x2ee3(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUserGraphicsDir>:
push   %rax
mov    0x2f10(%rip),%rax
test   %rax,%rax
je     112f <getUserGraphicsDir+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <getUserGameDataDir@plt>
lea    0xec3(%rip),%rsi
mov    %eax,%edi
call   1040 <getPath2@plt>
mov    %rax,0x2eed(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@getUserGraphicsDir.usergraphics_dir = internal global i8* null
@.str = [9 x i8] c"graphics\00"
define i8* @getUserGraphicsDir() {
%1 = load i8*, i8** @getUserGraphicsDir.usergraphics_dir
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @getUserGameDataDir()
%5 = call i8* @getPath2(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** @getUserGraphicsDir.usergraphics_dir
br label %6
6: ; preds = %3, %0
%7 = load i8*, i8** @getUserGraphicsDir.usergraphics_dir
ret i8* %7
}

LLVM IR (-O2):
@getUserGraphicsDir.usergraphics_dir = internal unnamed_addr global i8* null
@.str = [9 x i8] c"graphics\00"
define i8* @getUserGraphicsDir() {
%1 = load i8*, i8** @getUserGraphicsDir.usergraphics_dir
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @getUserGameDataDir()
%5 = tail call i8* @getPath2(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** @getUserGraphicsDir.usergraphics_dir
br label %6
6: ; preds = %3, %0
%7 = phi i8* [ %5, %3 ], [ %1, %0 ]
ret i8* %7
}
int ltoi(long val) {
  union {
    int i;
    long l;
  } x;
  x.l = val;
  return x.i;
}


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

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

LLVM IR (-O0):
%union.anon = type { i64 }
define i32 @ltoi(i64 %0) {
%2 = alloca i64
%3 = alloca %union.anon
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = bitcast %union.anon* %3 to i64*
store i64 %4, i64* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ltoi(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: bucket code <a> <b>\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"usage: bucket code <a> <b>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"usage: bucket code <a> <b>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void mov_m8_reg8(unsigned char *m8, int reg8) {
  put8(0x88);
  put8((reg8 << 3) | 5);
  put32((unsigned int)(m8));
}


x86 assembly (clang, -O0):
<mov_m8_reg8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x88,%edi
call   1030 <put8@plt>
mov    -0xc(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_m8_reg8>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x88,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_m8_reg8(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 136)
%6 = load i32, i32* %4
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @mov_m8_reg8(i8* %0, i32 %1) {
%3 = tail call i32 @put8(i32 136)
%4 = shl i32 %1, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i8* %0 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
int calculate(char opt, int op1, int op2) {
  int n;
  switch (opt) {
  case '+':
    n = (op1 + op2);
    break;
  case '-':
    n = (op1 - op2);
    break;
  case '/':
    n = (op1 / op2);
    break;
  case '*':
    n = (op1 * op2);
    break;
  }
  return n;
}


x86 assembly (clang, -O0):
<calculate>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     116f <calculate+0x6f>
mov    -0x18(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116f <calculate+0x6f>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116f <calculate+0x6f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
jmp    116f <calculate+0x6f>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate>:
mov    %edx,%ecx
add    $0xffffffd6,%edi
cmp    $0x5,%edi
ja     111d <calculate+0x1d>
lea    0xeef(%rip),%rax
movslq (%rax,%rdi,4),%rdx
add    %rax,%rdx
jmp    *%rdx
imul   %esi,%ecx
mov    %ecx,%eax
ret
add    %esi,%ecx
mov    %ecx,%eax
ret
sub    %ecx,%esi
mov    %esi,%eax
ret
mov    %esi,%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @calculate(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
switch i32 %9, label %26 [
i32 43, label %10
i32 45, label %14
i32 47, label %18
i32 42, label %22
]
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
store i32 %13, i32* %7
br label %26
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
store i32 %17, i32* %7
br label %26
18: ; preds = %3
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = sdiv i32 %19, %20
store i32 %21, i32* %7
br label %26
22: ; preds = %3
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = mul nsw i32 %23, %24
store i32 %25, i32* %7
br label %26
26: ; preds = %3, %22, %18, %14, %10
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @calculate(i8 signext %0, i32 %1, i32 %2) {
%4 = sext i8 %0 to i32
switch i32 %4, label %13 [
i32 43, label %5
i32 45, label %7
i32 47, label %9
i32 42, label %11
]
5: ; preds = %3
%6 = add nsw i32 %2, %1
br label %13
7: ; preds = %3
%8 = sub nsw i32 %1, %2
br label %13
9: ; preds = %3
%10 = sdiv i32 %1, %2
br label %13
11: ; preds = %3
%12 = mul nsw i32 %2, %1
br label %13
13: ; preds = %3, %11, %9, %7, %5
%14 = phi i32 [ undef, %3 ], [ %12, %11 ], [ %10, %9 ], [ %8, %7 ], [ %6, %5 ]
ret i32 %14
}
int main() {
  int a = 10;
  if (a > 15) {
    return 3;
  } else if (a < 5) {
    return 2;
  } else {
    if (a != 10)
      return 4;
    else
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jle    1128 <main+0x28>
movl   $0x3,-0x4(%rbp)
jmp    115b <main+0x5b>
cmpl   $0x5,-0x8(%rbp)
jge    113e <main+0x3e>
movl   $0x2,-0x4(%rbp)
jmp    115b <main+0x5b>
cmpl   $0xa,-0x8(%rbp)
je     1154 <main+0x54>
movl   $0x4,-0x4(%rbp)
jmp    115b <main+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double stddev_double(int, double *);
double stddev(int n, double *data) { return stddev_double(n, data); }


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

x86 assembly (clang, -O2):
<stddev>:
jmp    1030 <stddev_double@plt>

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

LLVM IR (-O2):
define double @stddev(i32 %0, double* %1) {
%3 = tail call double @stddev_double(i32 %0, double* %1)
ret double %3
}
int color_offset_f3(int x, int y) {
  return ((y << 10) + (((x << 10) * 218) / 39) - (20166 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0xda,%eax,%eax
mov    $0x27,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0x13b1800,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f3>:
shl    $0xa,%esi
imul   $0x36800,%edi,%eax
cltq
imul   $0xffffffffd20d20d3,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
add    %esi,%eax
add    $0xfec4e800,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 218
%10 = sdiv i32 %9, 39
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 20649984
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f3(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 223232
%5 = sdiv i32 %4, 39
%6 = add nsw i32 %5, -20649984
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int ne_put_init_global(int, int, int, int, int, int);
int ne_test_pinig(int fileid) {
  int nng = 100, neg = 50, nebg = 5, nnsg = 2, nssg = 3;
  return (ne_put_init_global(fileid, nng, neg, nebg, nnsg, nssg));
}


x86 assembly (clang, -O0):
<ne_test_pinig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x32,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <ne_put_init_global@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_test_pinig>:
mov    $0x64,%esi
mov    $0x32,%edx
mov    $0x5,%ecx
mov    $0x2,%r8d
mov    $0x3,%r9d
jmp    1030 <ne_put_init_global@plt>

LLVM IR (-O0):
define i32 @ne_test_pinig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
store i32 100, i32* %3
store i32 50, i32* %4
store i32 5, i32* %5
store i32 2, i32* %6
store i32 3, i32* %7
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @ne_put_init_global(i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @ne_test_pinig(i32 %0) {
%2 = tail call i32 @ne_put_init_global(i32 %0, i32 100, i32 50, i32 5, i32 2, i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char const);
int /*<<< orphan*/ stderr;
char transform_char(const char in) {
  fprintf(
      stderr,
      "[INFO](%s:%d:) "
      "transform_char in: %d"
      "\n",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/amiq-consulting/amiq_blog/refs/heads/master/"
      "amiq_sv_dpi_c_how_to_map_systemverilog_data_types_to_c_using_dpi_c/src/"
      "dpi_c_misc.h",
      94, in);
  return -1 - in;
}


x86 assembly (clang, -O0):
<transform_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
lea    0xef1(%rip),%rdx
mov    $0x5e,%ecx
movsbl -0x1(%rbp),%r8d
call   1030 <fprintf@plt>
movsbl -0x1(%rbp),%ecx
mov    $0xffffffff,%eax
sub    %ecx,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform_char>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xefc(%rip),%rdx
mov    $0x5e,%ecx
mov    %ebx,%r8d
call   1030 <fprintf@plt>
not    %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"[INFO](%s:%d:) transform_char in: %d\0A\00"
@.str.1 = [218 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/amiq-consulting/amiq_blog/refs/heads/master/amiq_sv_dpi_c_how_to_map_systemverilog_data_types_to_c_using_dpi_c/src/dpi_c_misc.h\00"
define signext i8 @transform_char(i8 signext %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 ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str.1, i64 0, i64 0), i32 94, i8 signext %4)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = sub nsw i32 -1, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"[INFO](%s:%d:) transform_char in: %d\0A\00"
@.str.1 = [218 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/amiq-consulting/amiq_blog/refs/heads/master/amiq_sv_dpi_c_how_to_map_systemverilog_data_types_to_c_using_dpi_c/src/dpi_c_misc.h\00"
define signext i8 @transform_char(i8 signext %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str.1, i64 0, i64 0), i32 94, i8 signext %0)
%4 = xor i8 %0, -1
ret i8 %4
}
void overlapping_strcpy(char *dst, const char *src) {
  if (dst != src) {
    while ((*dst = *src) != '\0') {
      dst++;
      src++;
    }
  }
}


x86 assembly (clang, -O0):
<overlapping_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1159 <overlapping_strcpy+0x59>
jmp    111f <overlapping_strcpy+0x1f>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1154 <overlapping_strcpy+0x54>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <overlapping_strcpy+0x1f>
jmp    1159 <overlapping_strcpy+0x59>
pop    %rbp
ret

x86 assembly (clang, -O2):
<overlapping_strcpy>:
cmp    %rsi,%rdi
je     112f <overlapping_strcpy+0x2f>
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     112f <overlapping_strcpy+0x2f>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <overlapping_strcpy+0x20>
ret

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

LLVM IR (-O2):
define void @overlapping_strcpy(i8* writeonly %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = load i8, i8* %1
store i8 %5, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %11, %7 ], [ %1, %4 ]
%9 = phi i8* [ %10, %7 ], [ %0, %4 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
store i8 %12, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %4, %2
ret void
}
/* Variables and functions */
scalar_t__ pow(int, int);
int sqrt(scalar_t__);
int main() {
  int a;
  a = sqrt(pow(((2 * 4) / 3), 2) - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%esi
mov    %esi,%edi
call   1030 <pow@plt>
mov    %rax,%rdi
sub    $0x1,%rdi
call   1040 <sqrt@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
lea    -0x1(%rax),%rdi
call   1040 <sqrt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i64 @pow(i32 2, i32 2)
%3 = sub nsw i64 %2, 1
%4 = call i32 @sqrt(i64 %3)
store i32 %4, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @pow(i32 2, i32 2)
%2 = add nsw i64 %1, -1
%3 = tail call i32 @sqrt(i64 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ signal(int, void (*)(int));
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int);
void signal_func(int sig) {
  static const char text[] = "signal_func\n";
  signal(sig, signal_func);
  write(STDOUT_FILENO, text, sizeof text - 1);
}


x86 assembly (clang, -O0):
<signal_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rsi
call   1040 <signal@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
mov    $0xc,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_func>:
push   %rax
mov    0x2eb0(%rip),%rsi
call   1040 <signal@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
mov    $0xc,%edx
pop    %rax
jmp    1030 <write@plt>

LLVM IR (-O0):
@signal_func.text = internal constant [13 x i8] c"signal_func\0A\00"
@STDOUT_FILENO = global i32 0
define void @signal_func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @signal(i32 %3, void (i32)* @signal_func)
%5 = load i32, i32* @STDOUT_FILENO
%6 = call i32 @write(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @signal_func.text, i64 0, i64 0), i32 12)
ret void
}

LLVM IR (-O2):
@signal_func.text = internal constant [13 x i8] c"signal_func\0A\00"
@STDOUT_FILENO = global i32 0
define void @signal_func(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @signal_func)
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @signal_func.text, i64 0, i64 0), i32 12)
ret void
}
int red_counter() {
  static int counter = 10;
  counter = counter + 1;
  return counter;
}


x86 assembly (clang, -O0):
<red_counter>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
mov    0x2f07(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<red_counter>:
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
ret

LLVM IR (-O0):
@red_counter.counter = internal global i32 10
define i32 @red_counter() {
%1 = load i32, i32* @red_counter.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @red_counter.counter
%3 = load i32, i32* @red_counter.counter
ret i32 %3
}

LLVM IR (-O2):
@red_counter.counter = internal unnamed_addr global i32 10
define i32 @red_counter() {
%1 = load i32, i32* @red_counter.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @red_counter.counter
ret i32 %2
}