xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ mouseClickOnButtons(int, int, int, int);
void mousePopUpButtonFunc(int mouseButton, int mouseButtonState,
                          int mousePositionX, int mousePositionY) {
  mouseClickOnButtons(mouseButton, mouseButtonState, mousePositionX,
                      mousePositionY);
}


x86 assembly (clang, -O0):
<mousePopUpButtonFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <mouseClickOnButtons@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mousePopUpButtonFunc>:
jmp    1030 <mouseClickOnButtons@plt>

LLVM IR (-O0):
define void @mousePopUpButtonFunc(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @mouseClickOnButtons(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @mousePopUpButtonFunc(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @mouseClickOnButtons(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
const char *bootpart_type(const char *scheme) { return ("freebsd-boot"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"freebsd-boot\00"
define i8* @bootpart_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"freebsd-boot\00"
define i8* @bootpart_type(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int x, y;
  scanf("%d %d", &x, &y);
  printf(y & 1 ? "impossible\n" : "possible");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%ecx
and    $0x1,%ecx
lea    0xec2(%rip),%rdi
lea    0xeaf(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [12 x i8] c"impossible\0A\00"
@.str.2 = [9 x i8] c"possible\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %3
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @printf(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [12 x i8] c"impossible\0A\00"
@.str.2 = [9 x i8] c"possible\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0)
%10 = call i32 @printf(i8* dereferenceable(1) %9)
ret i32 0
}
void wait(int loop) {
  int i, j;
  for (i = 1; i <= 8; i = i * 2) {
    for (j = 0; j < loop; j = j + 1)
      *(char *)0x90080000 = i;
  }
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jg     1158 <wait+0x58>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1145 <wait+0x45>
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    $0x90080000,%eax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <wait+0x1f>
jmp    114a <wait+0x4a>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <wait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
test   %edi,%edi
jle    110c <wait+0xc>
mov    $0x90080000,%eax
movb   $0x8,(%rax)
ret

LLVM IR (-O0):
define void @wait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 8
br i1 %7, label %8, label %23
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %16, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32, i32* %3
%15 = trunc i32 %14 to i8
store i8 %15, i8* inttoptr (i64 2416443392 to i8*)
br label %16
16: ; preds = %13
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %9
19: ; preds = %9
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = mul nsw i32 %21, 2
store i32 %22, i32* %3
br label %5
23: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @wait(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
store i8 8, i8* inttoptr (i64 2416443392 to i8*)
br label %4
4: ; preds = %1, %3
ret void
}
int maxofthree(int a, int b, int c) {
  int max = a;
  if (b > max) {
    max = b;
  }
  if (c > max) {
    max = c;
  }
  return max;
}


x86 assembly (clang, -O0):
<maxofthree>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1125 <maxofthree+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1137 <maxofthree+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @maxofthree(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ inet_ntoa(struct in_addr);
int /*<<< orphan*/ ntohl(int);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int main(int argc, const char *argv[]) {
  struct in_addr ia;
  int hex;
  sscanf(argv[1], "0x%x", &hex);
  ia.s_addr = ntohl(hex);
  puts(inet_ntoa(ia));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9b(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x1c(%rbp),%edi
call   1060 <ntohl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
lea    0xeb4(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1050 <sscanf@plt>
mov    0x4(%rsp),%edi
call   1060 <ntohl@plt>
mov    %eax,%edi
call   1040 <inet_ntoa@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [5 x i8] c"0x%x\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.in_addr
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %7)
%12 = load i32, i32* %7
%13 = call i32 @ntohl(i32 %12)
%14 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
store i32 %13, i32* %14
%15 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i32 @inet_ntoa(i32 %16)
%18 = call i32 @puts(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"0x%x\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @ntohl(i32 %8)
%10 = call i32 @inet_ntoa(i32 %9)
%11 = call i32 @puts(i32 %10)
ret i32 0
}
void foo581(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo581(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SXTAB16(uint32_t x, uint32_t y) {
  return (
      (uint32_t)((((((int32_t)y << 24) >> 24) + (((int32_t)x << 16) >> 16)) &
                  (int32_t)0x0000FFFF) |
                 (((((int32_t)y << 8) >> 8) + (((int32_t)x >> 16) << 16)) &
                  (int32_t)0xFFFF0000)));
}


x86 assembly (clang, -O0):
<__SXTAB16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x18,%eax
sar    $0x18,%eax
mov    -0x8(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
add    %ecx,%eax
and    $0xffff,%eax
mov    -0x10(%rbp),%rcx
shl    $0x8,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rdx
sar    $0x10,%edx
shl    $0x10,%edx
add    %edx,%ecx
and    $0xffff0000,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SXTAB16>:
movsbl %sil,%eax
add    %edi,%eax
movzwl %ax,%eax
shl    $0x8,%esi
sar    $0x8,%esi
and    $0xffff0000,%edi
add    %esi,%edi
and    $0xffff0000,%edi
or     %eax,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @__SXTAB16(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 24
%8 = ashr i32 %7, 24
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 16
%12 = ashr i32 %11, 16
%13 = add nsw i32 %8, %12
%14 = and i32 %13, 65535
%15 = load i64, i64* %4
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 8
%18 = ashr i32 %17, 8
%19 = load i64, i64* %3
%20 = trunc i64 %19 to i32
%21 = ashr i32 %20, 16
%22 = shl i32 %21, 16
%23 = add nsw i32 %18, %22
%24 = and i32 %23, -65536
%25 = or i32 %14, %24
%26 = sext i32 %25 to i64
ret i64 %26
}

LLVM IR (-O2):
define i64 @__SXTAB16(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %3, 24
%5 = ashr exact i32 %4, 24
%6 = trunc i64 %0 to i32
%7 = add i32 %5, %6
%8 = and i32 %7, 65535
%9 = shl i32 %3, 8
%10 = ashr exact i32 %9, 8
%11 = and i32 %6, -65536
%12 = add nsw i32 %10, %11
%13 = and i32 %12, -65536
%14 = or i32 %8, %13
%15 = sext i32 %14 to i64
ret i64 %15
}
/* Variables and functions */
char *malloc_or_die(scalar_t__, char const *, int);
scalar_t__ safestrlen(char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
char *safestrdup(const char *p, const char *file, int line) {
  char *new = 0;
  if (p == 0)
    p = "";
  new = malloc_or_die(safestrlen(p) + 1, file, line);
  strcpy(new, p);
  return (new);
}


x86 assembly (clang, -O0):
<safestrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1161 <safestrdup+0x31>
lea    0xea3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <safestrlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <malloc_or_die@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safestrdup>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
test   %rdi,%rdi
lea    0xebc(%rip),%rbp
cmovne %rdi,%rbp
mov    %rbp,%rdi
call   1050 <safestrlen@plt>
lea    0x1(%rax),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <malloc_or_die@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @safestrdup(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i8* null, i8** %7
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %3
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %4
br label %11
11: ; preds = %10, %3
%12 = load i8*, i8** %4
%13 = call i64 @safestrlen(i8* %12)
%14 = add nsw i64 %13, 1
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i8* @malloc_or_die(i64 %14, i8* %15, i32 %16)
store i8* %17, i8** %7
%18 = load i8*, i8** %7
%19 = load i8*, i8** %4
%20 = call i32 @strcpy(i8* %18, i8* %19)
%21 = load i8*, i8** %7
ret i8* %21
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @safestrdup(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%6 = tail call i64 @safestrlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = tail call i8* @malloc_or_die(i64 %7, i8* %1, i32 %2)
%9 = tail call i32 @strcpy(i8* %8, i8* %5)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int yyselect();
null_point() {
  switch (yyselect()) {
  case 108: {
    printf("Find");
  } break;
  }
}


x86 assembly (clang, -O0):
<null_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <yyselect@plt>
sub    $0x6c,%eax
jne    1149 <null_point+0x29>
jmp    113d <null_point+0x1d>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_point>:
push   %rax
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x6c,%eax
jne    1139 <null_point+0x19>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Find\00"
define i32 @null_point() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %5 [
i32 108, label %3
]
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"Find\00"
define i32 @null_point() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 108
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
ret i32 undef
}
int main() {
  int a, b, x, y, t, gcd, lcm;
  a = x;
  b = 1;
  t = -a;
  a++;
  while (b != 0) {
    t = b;
    b = a / b;
    a = t;
  }
  gcd = a;
  lcm = (x * y) / (a - b);
  t = a + b + x + y + t;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <main+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
store i32 1, i32* %3
%10 = load i32, i32* %2
%11 = sub nsw i32 0, %10
store i32 %11, i32* %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %14
14: ; preds = %17, %0
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %3
store i32 %18, i32* %6
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = sdiv i32 %19, %20
store i32 %21, i32* %3
%22 = load i32, i32* %6
store i32 %22, i32* %2
br label %14
23: ; preds = %14
%24 = load i32, i32* %2
store i32 %24, i32* %7
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = mul nsw i32 %25, %26
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = sub nsw i32 %28, %29
%31 = sdiv i32 %27, %30
store i32 %31, i32* %8
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = add nsw i32 %32, %33
%35 = load i32, i32* %4
%36 = add nsw i32 %34, %35
%37 = load i32, i32* %5
%38 = add nsw i32 %36, %37
%39 = load i32, i32* %6
%40 = add nsw i32 %38, %39
store i32 %40, i32* %6
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int rand_num(int max) {
  static int _a = 1;
  if (_a) {
    srand(time(NULL));
    _a = 0;
  }
  return rand() % max;
}


x86 assembly (clang, -O0):
<rand_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,0x2ef6(%rip)
je     1162 <rand_num+0x32>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,0x2ed6(%rip)
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_num>:
push   %rbx
mov    %edi,%ebx
cmpb   $0x0,0x2f02(%rip)
jne    1151 <rand_num+0x21>
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movb   $0x1,0x2eeb(%rip)
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@rand_num._a = internal global i32 1
define i32 @rand_num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @rand_num._a
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
store i32 0, i32* @rand_num._a
br label %8
8: ; preds = %5, %1
%9 = call i32 (...) @rand()
%10 = load i32, i32* %2
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
@rand_num._a = internal unnamed_addr global i1 false
define i32 @rand_num(i32 %0) {
%2 = load i1, i1* @rand_num._a
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @time(i32* null)
%5 = tail call i32 @srand(i32 %4)
store i1 true, i1* @rand_num._a
br label %6
6: ; preds = %3, %1
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, %0
ret i32 %8
}
int strcmp(const char *s1, const char *s2) {
  while (*s1++ == *s2++) {
    if (!*s1)
      return 0;
  }
  return *s1 - *s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1156 <strcmp+0x56>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1151 <strcmp+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1169 <strcmp+0x69>
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
cmp    -0x1(%rsi,%rcx,1),%al
movzbl (%rdi,%rcx,1),%eax
jne    1125 <strcmp+0x25>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
movsbl %al,%eax
movsbl (%rsi,%rcx,1),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
br label %4
4: ; preds = %13, %2
%5 = phi i8 [ %3, %2 ], [ %12, %13 ]
%6 = phi i8* [ %0, %2 ], [ %8, %13 ]
%7 = phi i8* [ %1, %2 ], [ %9, %13 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = icmp eq i8 %5, %10
%12 = load i8, i8* %8
br i1 %11, label %13, label %15
13: ; preds = %4
%14 = icmp eq i8 %12, 0
br i1 %14, label %20, label %4
15: ; preds = %4
%16 = sext i8 %12 to i32
%17 = load i8, i8* %9
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %16, %18
br label %20
20: ; preds = %13, %15
%21 = phi i32 [ %19, %15 ], [ 0, %13 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int i = 2;
  switch (i) {
  case 1:
    printf("one\n");
    break;
  case 2:
    printf("two\n");
    break;
  case 3:
    printf("three\n");
    break;
  default:
    printf("default\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     115c <main+0x4c>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     116d <main+0x5d>
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     117e <main+0x6e>
jmp    118f <main+0x7f>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x8b>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x8b>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x8b>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"one\0A\00"
@.str.1 = [5 x i8] c"two\0A\00"
@.str.2 = [7 x i8] c"three\0A\00"
@.str.3 = [9 x i8] c"default\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %12
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"two\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void f(void) {
  int a[100], b[100];
  int i;
  int t;
#pragma hlt distribute expand(t)
  for (i = 0; i < 100; i++) {
    t = a[i] + 1;
    b[i] = t * 2;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
movl   $0x0,-0x324(%rbp)
cmpl   $0x64,-0x324(%rbp)
jge    1164 <f+0x64>
movslq -0x324(%rbp),%rax
mov    -0x190(%rbp,%rax,4),%eax
add    $0x1,%eax
mov    %eax,-0x328(%rbp)
mov    -0x328(%rbp),%ecx
shl    $0x1,%ecx
movslq -0x324(%rbp),%rax
mov    %ecx,-0x320(%rbp,%rax,4)
mov    -0x324(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x324(%rbp)
jmp    1115 <f+0x15>
add    $0x2b0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca [100 x i32]
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %3
br label %5
5: ; preds = %19, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %17
store i32 %15, i32* %18
br label %19
19: ; preds = %8
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
void rmnl(char *s) {
  char *cp;
  cp = strrchr(s, '\n');
  if (cp != NULL)
    *cp = '\0';
}


x86 assembly (clang, -O0):
<rmnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <rmnl+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmnl>:
push   %rax
mov    $0xa,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1123 <rmnl+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @rmnl(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 10)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @rmnl(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *jsonCmd(char *, int);
char *jsonCmdGetVersion(void) { return (jsonCmd("getversion", 1)); }


x86 assembly (clang, -O0):
<jsonCmdGetVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <jsonCmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonCmdGetVersion>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <jsonCmd@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"getversion\00"
define i8* @jsonCmdGetVersion() {
%1 = call i8* @jsonCmd(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
ret i8* %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"getversion\00"
define i8* @jsonCmdGetVersion() {
%1 = tail call i8* @jsonCmd(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
ret i8* %1
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
int pause() {
  int ch;
  printf("Press [Enter] to continue\n");
  while ((ch = getchar()) != '\n' && ch != EOF)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1160 <pause+0x40>
mov    -0x4(%rbp),%eax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1170 <pause+0x50>
jmp    1175 <pause+0x55>
jmp    1134 <pause+0x14>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb4(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1150 <pause+0x30>
cmp    (%rbx),%eax
jne    1140 <pause+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Press [Enter] to continue\0A\00"
@EOF = global i32 0
define i32 @pause() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %12, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %1
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br label %10
10: ; preds = %6, %3
%11 = phi i1 [ false, %3 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %3
13: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@str = [26 x i8] c"Press [Enter] to continue\00"
define i32 @pause() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @getchar()
%4 = icmp ne i32 %3, 10
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 0
}
void _glapi_check_table(const struct _glapi_table *table) { (void)table; }


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

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

LLVM IR (-O0):
%struct._glapi_table = type opaque
define void @_glapi_check_table(%struct._glapi_table* %0) {
%2 = alloca %struct._glapi_table*
store %struct._glapi_table* %0, %struct._glapi_table** %2
%3 = load %struct._glapi_table*, %struct._glapi_table** %2
ret void
}

LLVM IR (-O2):
%struct._glapi_table = type opaque
define void @_glapi_check_table(%struct._glapi_table* nocapture %0) {
ret void
}
void _matrix_3x1_mul_constant(float m[3][1], float a) {
  int i;
  for (i = 0; i < 3; ++i) {
    m[i][0] = a * m[i][0];
  }
}


x86 assembly (clang, -O0):
<_matrix_3x1_mul_constant>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    114b <_matrix_3x1_mul_constant+0x4b>
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <_matrix_3x1_mul_constant+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_matrix_3x1_mul_constant>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @_matrix_3x1_mul_constant([1 x float]* %0, float %1) {
%3 = alloca [1 x float]*
%4 = alloca float
%5 = alloca i32
store [1 x float]* %0, [1 x float]** %3
store float %1, float* %4
store i32 0, i32* %5
br label %6
6: ; preds = %23, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %26
9: ; preds = %6
%10 = load float, float* %4
%11 = load [1 x float]*, [1 x float]** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [1 x float], [1 x float]* %11, i64 %13
%15 = getelementptr inbounds [1 x float], [1 x float]* %14, i64 0, i64 0
%16 = load float, float* %15
%17 = fmul float %10, %16
%18 = load [1 x float]*, [1 x float]** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [1 x float], [1 x float]* %18, i64 %20
%22 = getelementptr inbounds [1 x float], [1 x float]* %21, i64 0, i64 0
store float %17, float* %22
br label %23
23: ; preds = %9
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %6
26: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @_matrix_3x1_mul_constant([1 x float]* nocapture %0, float %1) {
%3 = getelementptr inbounds [1 x float], [1 x float]* %0, i64 0, i64 0
%4 = load float, float* %3
%5 = fmul float %4, %1
store float %5, float* %3
%6 = getelementptr inbounds [1 x float], [1 x float]* %0, i64 1, i64 0
%7 = load float, float* %6
%8 = fmul float %7, %1
store float %8, float* %6
%9 = getelementptr inbounds [1 x float], [1 x float]* %0, i64 2, i64 0
%10 = load float, float* %9
%11 = fmul float %10, %1
store float %11, float* %9
ret void
}
int __attribute__((target("avx"))) fwd_decl_avx(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @fwd_decl_avx() {
ret i32 2
}

LLVM IR (-O2):
define i32 @fwd_decl_avx() {
ret i32 2
}
int *f(int *p) {
  int *r = p;
  return r;
}


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

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

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

LLVM IR (-O2):
define i32* @f(i32* readnone returned %0) {
ret i32* %0
}
int symphonia_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @symphonia_init() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ rtn;
typedef int int64_t;

/* Variables and functions */
scalar_t__ getxattr(char const *, char const *, int *, int);
int fsfr_getxattr_int(const char *fpath, const char *name) {
  int64_t rtn = -1;
  if (getxattr(fpath, name, &rtn, sizeof(rtn)) > 0)
    return (int)rtn;
  return -1;
}


x86 assembly (clang, -O0):
<fsfr_getxattr_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <getxattr@plt>
cmp    $0x0,%rax
jle    1152 <fsfr_getxattr_int+0x42>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <fsfr_getxattr_int+0x49>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsfr_getxattr_int>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <getxattr@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jle    1139 <fsfr_getxattr_int+0x29>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fsfr_getxattr_int(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = call i64 @getxattr(i8* %0, i8* %1, i32* %3, i32 4)
%6 = icmp sgt i64 %5, 0
%7 = load i32, i32* %3
%8 = select i1 %6, i32 %7, i32 -1
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ DH;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ITEM_rptr(int /*<<< orphan*/);
int /*<<< orphan*/ *ASN1_item_dup(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ DHparams;
DH *DHparams_dup(DH *dh) { return ASN1_item_dup(ASN1_ITEM_rptr(DHparams), dh); }


x86 assembly (clang, -O0):
<DHparams_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <ASN1_item_dup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DHparams_dup>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <ASN1_item_dup@plt>

LLVM IR (-O0):
@DHparams = global i32 0
define i32* @DHparams_dup(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @DHparams
%4 = call i32 @ASN1_ITEM_rptr(i32 %3)
%5 = load i32*, i32** %2
%6 = call i32* @ASN1_item_dup(i32 %4, i32* %5)
ret i32* %6
}

LLVM IR (-O2):
@DHparams = global i32 0
define i32* @DHparams_dup(i32* %0) {
%2 = load i32, i32* @DHparams
%3 = tail call i32 @ASN1_ITEM_rptr(i32 %2)
%4 = tail call i32* @ASN1_item_dup(i32 %3, i32* %0)
ret i32* %4
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf8(int f, int n) { return (cbuf(f, n, 8)); }


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

x86 assembly (clang, -O2):
<cbuf8>:
mov    $0x8,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf8(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 8)
ret i32 %3
}
int isspecial(int ch) {
  if ((ch == 44) || (ch == 59) || (ch == 61))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isspecial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2c,-0x8(%rbp)
je     1125 <isspecial+0x25>
cmpl   $0x3b,-0x8(%rbp)
je     1125 <isspecial+0x25>
cmpl   $0x3d,-0x8(%rbp)
jne    1131 <isspecial+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <isspecial+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspecial>:
cmp    $0x3d,%edi
ja     111d <isspecial+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x2800100000000000,%rdx
bt     %rcx,%rdx
jae    111d <isspecial+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isspecial(i32 %0) {
switch i32 %0, label %2 [
i32 61, label %3
i32 59, label %3
i32 44, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PutBitsOnPins(int);
int /*<<< orphan*/ usleep(int);
void write_lcd(int bits) {
  PutBitsOnPins(bits + 0x80);
  PutBitsOnPins(bits);
  usleep(500);
}


x86 assembly (clang, -O0):
<write_lcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x80,%edi
call   1030 <PutBitsOnPins@plt>
mov    -0x4(%rbp),%edi
call   1030 <PutBitsOnPins@plt>
mov    $0x1f4,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_lcd>:
push   %rbx
mov    %edi,%ebx
lea    0x80(%rbx),%edi
call   1030 <PutBitsOnPins@plt>
mov    %ebx,%edi
call   1030 <PutBitsOnPins@plt>
mov    $0x1f4,%edi
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @write_lcd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 128
%5 = call i32 @PutBitsOnPins(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @PutBitsOnPins(i32 %6)
%8 = call i32 @usleep(i32 500)
ret void
}

LLVM IR (-O2):
define void @write_lcd(i32 %0) {
%2 = add nsw i32 %0, 128
%3 = tail call i32 @PutBitsOnPins(i32 %2)
%4 = tail call i32 @PutBitsOnPins(i32 %0)
%5 = tail call i32 @usleep(i32 500)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __spawni(pid_t *pid, const char *file,
             const posix_spawn_file_actions_t *file_actions,
             const posix_spawnattr_t *attrp, char *const argv[],
             char *const envp[], int xflags) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__spawni>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__spawni>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__spawni(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8**
%13 = alloca i8**
%14 = alloca i32
store i32* %0, i32** %8
store i8* %1, i8** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i8** %4, i8*** %12
store i8** %5, i8*** %13
store i32 %6, i32* %14
%15 = load i32, i32* @ENOSYS
%16 = call i32 @__set_errno(i32 %15)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__spawni(i32* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i8** nocapture readnone %4, i8** nocapture readnone %5, i32 %6) {
%8 = load i32, i32* @ENOSYS
%9 = tail call i32 @__set_errno(i32 %8)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEif_acmpeq(int, int /*<<< orphan*/ *);
void code_if_acmpeq(int label) { appendCODE(makeCODEif_acmpeq(label, NULL)); }


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

x86 assembly (clang, -O2):
<code_if_acmpeq>:
push   %rax
xor    %esi,%esi
call   1040 <makeCODEif_acmpeq@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <appendCODE@plt>

LLVM IR (-O0):
define void @code_if_acmpeq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @makeCODEif_acmpeq(i32 %3, i32* null)
%5 = call i32 @appendCODE(i32 %4)
ret void
}

LLVM IR (-O2):
define void @code_if_acmpeq(i32 %0) {
%2 = tail call i32 @makeCODEif_acmpeq(i32 %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ word;

/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[200];
  memset(word, 0, sizeof(word));
  scanf("%200[^\n]", word);
  printf("%ld", hash(word));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1050 <memset@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1050 <memset@plt>
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%200[^\0A]\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 200)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%8 = call i32 @hash(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%200[^\0A]\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 200)
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @hash(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}