xunge/DecIR huggingface dataset:
char *GetBW(int BW) {
  switch (BW) {
  case 3:
    return "10M";
  case 0:
    return "20M";
  case 1:
    return "40M";
  default:
    return "N/A";
  }
}


x86 assembly (clang, -O0):
<GetBW>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     114c <GetBW+0x4c>
jmp    111a <GetBW+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     115c <GetBW+0x5c>
jmp    112b <GetBW+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
jne    116c <GetBW+0x6c>
jmp    113c <GetBW+0x3c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <GetBW+0x77>
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <GetBW+0x77>
lea    0xea5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <GetBW+0x77>
lea    0xe99(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBW>:
cmp    $0x3,%edi
ja     1117 <GetBW+0x17>
movslq %edi,%rax
lea    0xf01(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xeee(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"10M\00"
@.str.1 = [4 x i8] c"20M\00"
@.str.2 = [4 x i8] c"40M\00"
@.str.3 = [4 x i8] c"N/A\00"
define i8* @GetBW(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 3, label %5
i32 0, label %6
i32 1, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"10M\00"
@.str.1 = [4 x i8] c"20M\00"
@.str.2 = [4 x i8] c"40M\00"
@.str.3 = [4 x i8] c"N/A\00"
@reltable.GetBW = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.GetBW to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.GetBW to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.GetBW to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.GetBW to i64)) to i32)]
define i8* @GetBW(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.GetBW to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ LCDSend(int, int /*<<< orphan*/);
void LCDContrast(unsigned char contrast) {
  LCDSend(0x21, 0);
  LCDSend(0x80 | contrast, 0);
  LCDSend(0x20, 0);
}


x86 assembly (clang, -O0):
<LCDContrast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <LCDSend@plt>
movzbl -0x1(%rbp),%edi
or     $0x80,%edi
xor    %esi,%esi
call   1030 <LCDSend@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <LCDSend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDContrast>:
push   %rbx
mov    %edi,%ebx
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <LCDSend@plt>
or     $0x80,%bl
movzbl %bl,%edi
xor    %esi,%esi
call   1030 <LCDSend@plt>
mov    $0x20,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <LCDSend@plt>

LLVM IR (-O0):
define void @LCDContrast(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @LCDSend(i32 33, i32 0)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = or i32 128, %5
%7 = call i32 @LCDSend(i32 %6, i32 0)
%8 = call i32 @LCDSend(i32 32, i32 0)
ret void
}

LLVM IR (-O2):
define void @LCDContrast(i8 zeroext %0) {
%2 = tail call i32 @LCDSend(i32 33, i32 0)
%3 = or i8 %0, -128
%4 = zext i8 %3 to i32
%5 = tail call i32 @LCDSend(i32 %4, i32 0)
%6 = tail call i32 @LCDSend(i32 32, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int f();
int main(void) {
  int y = f();
  __CRAB_assert(y >= 0 && y <= 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 <f@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1152 <main+0x32>
cmpl   $0x1,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %edi,%edi
cmp    $0x2,%eax
setb   %dil
call   1040 <__CRAB_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @f()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 1
br label %9
9: ; preds = %6, %0
%10 = phi i1 [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @__CRAB_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp ult i32 %1, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @__CRAB_assert(i32 %3)
ret i32 0
}
void pthread_attr_setschedpolicy() {}


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

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

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

LLVM IR (-O2):
define void @pthread_attr_setschedpolicy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mem_warn(char *, int, int);
int willus_mem_alloc(double **, long, char *);
int willus_mem_alloc_warn(void **ptr, int size, char *name, int exitcode) {
  int status;
  status = willus_mem_alloc((double **)ptr, (long)size, name);
  if (!status)
    mem_warn(name, size, exitcode);
  return (status);
}


x86 assembly (clang, -O0):
<willus_mem_alloc_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <willus_mem_alloc@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1163 <willus_mem_alloc_warn+0x43>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1040 <mem_warn@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<willus_mem_alloc_warn>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%ebp
movslq %esi,%rsi
call   1030 <willus_mem_alloc@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    114a <willus_mem_alloc_warn+0x2a>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <mem_warn@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @willus_mem_alloc_warn(i8** %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8** %0 to double**
%6 = sext i32 %1 to i64
%7 = tail call i32 @willus_mem_alloc(double** %5, i64 %6, i8* %2)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @mem_warn(i8* %2, i32 %1, i32 %3)
br label %11
11: ; preds = %9, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("X = %d\n", a + b);
  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    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [8 x i8] c"X = %d\0A\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* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [8 x i8] c"X = %d\0A\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* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int ispunct(int c) {
  return ((c >= 0x21 && c <= 0x7e) &&
          !((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ||
            (c >= 0x30 && c <= 0x39)));
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     117e <ispunct+0x7e>
xor    %eax,%eax
cmpl   $0x7e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     117e <ispunct+0x7e>
cmpl   $0x41,-0x4(%rbp)
jl     113e <ispunct+0x3e>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jle    1176 <ispunct+0x76>
cmpl   $0x61,-0x4(%rbp)
jl     1157 <ispunct+0x57>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jle    1176 <ispunct+0x76>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x7(%rbp)
jl     1170 <ispunct+0x70>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
lea    -0x21(%rdi),%ecx
xor    %eax,%eax
cmp    $0x5d,%ecx
ja     1126 <ispunct+0x26>
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffa5,%eax
cmp    $0xffffffe6,%eax
setb   %al
add    $0xffffffc6,%edi
cmp    $0xfffffff6,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %31
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br i1 %7, label %8, label %31
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %28, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 122
br i1 %19, label %28, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp sge i32 %21, 48
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 57
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ false, %20 ], [ %25, %23 ]
br label %28
28: ; preds = %26, %17, %11
%29 = phi i1 [ true, %17 ], [ true, %11 ], [ %27, %26 ]
%30 = xor i1 %29, true
br label %31
31: ; preds = %28, %5, %1
%32 = phi i1 [ false, %5 ], [ false, %1 ], [ %30, %28 ]
%33 = zext i1 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = and i32 %0, -33
%6 = add nsw i32 %5, -91
%7 = icmp ult i32 %6, -26
%8 = add nsw i32 %0, -58
%9 = icmp ult i32 %8, -10
%10 = select i1 %7, i1 %9, i1 false
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ power(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int b, e;
  printf("Enter a base number, and the power upto which you want to find: ");
  scanf("%d %d", &b, &e);
  power(b, e);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <power@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xefd(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <power@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [65 x i8] c"Enter a base number, and the power upto which you want to find: \00"
@.str.1 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @power(i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [65 x i8] c"Enter a base number, and the power upto which you want to find: \00"
@.str.1 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @power(i32 %7, i32 %8)
ret i32 0
}
const char *WlzVersion() {
  static char wlzVersion[] = "unknown";
  return (wlzVersion);
}


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

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

LLVM IR (-O0):
@WlzVersion.wlzVersion = internal global [8 x i8] c"unknown\00"
define i8* @WlzVersion() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @WlzVersion.wlzVersion, i64 0, i64 0)
}

LLVM IR (-O2):
@WlzVersion.wlzVersion = internal global [8 x i8] c"unknown\00"
define i8* @WlzVersion() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @WlzVersion.wlzVersion, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ bug(int, int);
int main(void) {
  bug(5, 36863);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bug(i32 5, i32 36863)
ret i32 0
}
/* Variables and functions */
int exit_status_();
int exit_status(void) {
  int r = exit_status_();
  if (r > 255)
    r = 255;
  return r;
}


x86 assembly (clang, -O0):
<exit_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <exit_status_@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    1136 <exit_status+0x26>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_status>:
push   %rax
xor    %eax,%eax
call   1030 <exit_status_@plt>
cmp    $0xff,%eax
mov    $0xff,%ecx
cmovge %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @exit_status() {
%1 = alloca i32
%2 = call i32 (...) @exit_status_()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 255
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 255, i32* %1
br label %6
6: ; preds = %5, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @exit_status() {
%1 = tail call i32 (...) @exit_status_()
%2 = icmp slt i32 %1, 255
%3 = select i1 %2, i32 %1, i32 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cont(double, double);
int /*<<< orphan*/ move(double, double);
void line(double x0, double y0, double x1, double y1) {
  move(x0, y0);
  cont(x1, y1);
}


x86 assembly (clang, -O0):
<line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <move@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <cont@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line>:
sub    $0x18,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1040 <move@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1030 <cont@plt>

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

LLVM IR (-O2):
define void @line(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @move(double %0, double %1)
%6 = tail call i32 @cont(double %2, double %3)
ret void
}
char *skip_delim(char *str) {
  while ((*str == '\t' || *str == '\n' || *str == '\r') && *str != '\0')
    str++;
  return str;
}


x86 assembly (clang, -O0):
<skip_delim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     113d <skip_delim+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     113d <skip_delim+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
jne    114d <skip_delim+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115d <skip_delim+0x5d>
jmp    116e <skip_delim+0x6e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_delim+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_delim>:
mov    %rdi,%rax
mov    $0x2600,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%edx
cmp    $0xd,%rdx
ja     1125 <skip_delim+0x25>
bt     %rdx,%rcx
jae    1125 <skip_delim+0x25>
add    $0x1,%rax
jmp    1110 <skip_delim+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_delim(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 10, label %5
i8 13, label %5
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
int my_mod(int a, int b) { return a % b; }


x86 assembly (clang, -O0):
<my_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @my_mod(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @my_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
double rtlg1(double, double);
double rtlg2(double, double);
double rtlg(double a, double x) {
  if (x <= 0.0)
    return 1.0;
  if (x <= (1.0 + a))
    return rtlg1(a, x);
  return rtlg2(a, x);
}


x86 assembly (clang, -O0):
<rtlg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1152 <rtlg+0x32>
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119b <rtlg+0x7b>
movsd  -0x18(%rbp),%xmm1
movsd  0xea1(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1187 <rtlg+0x67>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <rtlg1@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    119b <rtlg+0x7b>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <rtlg2@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtlg>:
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
jae    1141 <rtlg+0x21>
movsd  0xece(%rip),%xmm2
addsd  %xmm0,%xmm2
ucomisd %xmm1,%xmm2
jae    114a <rtlg+0x2a>
jmp    1030 <rtlg2@plt>
movsd  0xeb7(%rip),%xmm0
ret
jmp    1040 <rtlg1@plt>

LLVM IR (-O0):
define double @rtlg(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp ole double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* %3
br label %22
9: ; preds = %2
%10 = load double, double* %5
%11 = load double, double* %4
%12 = fadd double 1.000000e+00, %11
%13 = fcmp ole double %10, %12
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load double, double* %4
%16 = load double, double* %5
%17 = call double @rtlg1(double %15, double %16)
store double %17, double* %3
br label %22
18: ; preds = %9
%19 = load double, double* %4
%20 = load double, double* %5
%21 = call double @rtlg2(double %19, double %20)
store double %21, double* %3
br label %22
22: ; preds = %18, %14, %8
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @rtlg(double %0, double %1) {
%3 = fcmp ugt double %1, 0.000000e+00
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = fadd double %0, 1.000000e+00
%6 = fcmp ult double %5, %1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call double @rtlg1(double %0, double %1)
br label %11
9: ; preds = %4
%10 = tail call double @rtlg2(double %0, double %1)
br label %11
11: ; preds = %2, %9, %7
%12 = phi double [ %8, %7 ], [ %10, %9 ], [ 1.000000e+00, %2 ]
ret double %12
}
void _Jv_GetJNIEnvNewFrame() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_GetJNIEnvNewFrame() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ USB0_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void USB0_IRQHandler(void) {
  USB0_DriverIRQHandler();
}


x86 assembly (clang, -O0):
<USB0_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <USB0_DriverIRQHandler@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define weak void @USB0_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @USB0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @USB0_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @USB0_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DifferingObjectSize0(void *const);
int /*<<< orphan*/ DifferingObjectSize1(void *const);
int /*<<< orphan*/ DifferingObjectSize2(void *const);
int /*<<< orphan*/ DifferingObjectSize3(void *const);
void test10(void *const p __attribute__((pass_object_size(1)))) {
  DifferingObjectSize2(p);
  DifferingObjectSize0(p);
  DifferingObjectSize1(p);
  DifferingObjectSize3(p);
}


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <DifferingObjectSize2@plt>
mov    -0x8(%rbp),%rdi
call   1050 <DifferingObjectSize0@plt>
mov    -0x8(%rbp),%rdi
call   1030 <DifferingObjectSize1@plt>
mov    -0x8(%rbp),%rdi
call   1040 <DifferingObjectSize3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
push   %rbx
mov    %rdi,%rbx
call   1060 <DifferingObjectSize2@plt>
mov    %rbx,%rdi
call   1050 <DifferingObjectSize0@plt>
mov    %rbx,%rdi
call   1030 <DifferingObjectSize1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <DifferingObjectSize3@plt>

LLVM IR (-O0):
define void @test10(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @DifferingObjectSize2(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @DifferingObjectSize0(i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @DifferingObjectSize1(i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @DifferingObjectSize3(i8* %11)
ret void
}

LLVM IR (-O2):
define void @test10(i8* %0, i64 %1) {
%3 = tail call i32 @DifferingObjectSize2(i8* %0)
%4 = tail call i32 @DifferingObjectSize0(i8* %0)
%5 = tail call i32 @DifferingObjectSize1(i8* %0)
%6 = tail call i32 @DifferingObjectSize3(i8* %0)
ret void
}
MUL(unsigned i) { return 2 * i; }


x86 assembly (clang, -O0):
<MUL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @MUL(i32 %0) {
%2 = shl i32 %0, 1
ret i32 %2
}
/* Variables and functions */
scalar_t__ ischar(char *);
int real(char *s) {
  if (s == NULL)
    return (0);
  if (ischar(s))
    return (1);
  if (*s == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <real+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1175 <real+0x65>
mov    -0x10(%rbp),%rdi
call   1030 <ischar@plt>
cmp    $0x0,%rax
je     1152 <real+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1175 <real+0x65>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116e <real+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    1175 <real+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real>:
push   %rbx
test   %rdi,%rdi
je     112d <real+0x1d>
mov    %rdi,%rbx
call   1030 <ischar@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1131 <real+0x21>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
cmpb   $0x0,(%rbx)
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @real(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @ischar(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i8, i8* %0
%8 = icmp ne i8 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
void g(struct Bar { int i; } * x) {
  struct Bar y;
  y.i = 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Bar = type { i32 }
define void @g(%struct.Bar* %0) {
%2 = alloca %struct.Bar*
%3 = alloca %struct.Bar
store %struct.Bar* %0, %struct.Bar** %2
%4 = getelementptr inbounds %struct.Bar, %struct.Bar* %3, i32 0, i32 0
store i32 1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.Bar = type { i32 }
define void @g(%struct.Bar* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ __LDREXB(scalar_t__ volatile *);
scalar_t__ __STREXB(scalar_t__, scalar_t__ volatile *);
uint8_t atomic_decr_u8(uint8_t *valuePtr, uint8_t delta) {
  uint8_t newValue;
  do {
    newValue = __LDREXB((volatile uint8_t *)valuePtr) - delta;
  } while (__STREXB(newValue, (volatile uint8_t *)valuePtr));
  return newValue;
}


x86 assembly (clang, -O0):
<atomic_decr_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__LDREXB@plt>
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <__STREXB@plt>
cmp    $0x0,%rax
jne    1130 <atomic_decr_u8+0x10>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_decr_u8>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <__LDREXB@plt>
mov    %rax,%rbx
sub    %r14,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <__STREXB@plt>
test   %rax,%rax
jne    1130 <atomic_decr_u8+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @atomic_decr_u8(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
br label %6
6: ; preds = %11, %2
%7 = load i64*, i64** %3
%8 = call i64 @__LDREXB(i64* %7)
%9 = load i64, i64* %4
%10 = sub nsw i64 %8, %9
store i64 %10, i64* %5
br label %11
11: ; preds = %6
%12 = load i64, i64* %5
%13 = load i64*, i64** %3
%14 = call i64 @__STREXB(i64 %12, i64* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %6, label %16
16: ; preds = %11
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
define i64 @atomic_decr_u8(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @__LDREXB(i64* %0)
%5 = sub nsw i64 %4, %1
%6 = tail call i64 @__STREXB(i64 %5, i64* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i64 %5
}
int fn3(int x, int y) {
  int tem1 = x | y;
  int tem2 = y ^ ~x;
  return tem1 & tem2;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
mov    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = xor i32 %11, -1
%13 = xor i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int M_PI;
int double_to_d22(int /*<<< orphan*/);
int /*<<< orphan*/ remainder(double, int);
int rot_key(double a) { return double_to_d22(remainder(a, 2 * M_PI)); }


x86 assembly (clang, -O0):
<rot_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
shl    $0x1,%edi
call   1040 <remainder@plt>
mov    %eax,%edi
call   1030 <double_to_d22@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot_key>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
add    %edi,%edi
call   1040 <remainder@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <double_to_d22@plt>

LLVM IR (-O0):
@M_PI = global i32 0
define i32 @rot_key(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = mul nsw i32 2, %4
%6 = call i32 @remainder(double %3, i32 %5)
%7 = call i32 @double_to_d22(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define i32 @rot_key(double %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = tail call i32 @remainder(double %0, i32 %3)
%5 = tail call i32 @double_to_d22(i32 %4)
ret i32 %5
}
/* Variables and functions */
int html_string(char *, char *);
int html_return() { return html_string("%s", "\n"); }


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

x86 assembly (clang, -O2):
<html_return>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <html_string@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @html_return() {
%1 = call i32 @html_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @html_return() {
%1 = tail call i32 @html_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
double screen_y(double py, int height) { return (py + 0.5) * height; }


x86 assembly (clang, -O0):
<screen_y>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_y>:
addsd  0xef8(%rip),%xmm0
cvtsi2sd %edi,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @screen_y(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = fadd double %5, 5.000000e-01
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fmul double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @screen_y(double %0, i32 %1) {
%3 = fadd double %0, 5.000000e-01
%4 = sitofp i32 %1 to double
%5 = fmul double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
print_read_send_error() {
  printf("Unable to send read request\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"Unable to send read request\0A\00"
define i32 @print_read_send_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"Unable to send read request\00"
define i32 @print_read_send_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ lox_output_char_provider(char);
void putc(char c) { lox_output_char_provider(c); }


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <lox_output_char_provider@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
jmp    1030 <lox_output_char_provider@plt>

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

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = tail call i32 @lox_output_char_provider(i8 signext %0)
ret void
}
int run_program() {}


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

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

LLVM IR (-O0):
define i32 @run_program() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @run_program() {
ret i32 undef
}
void gtk_editable_delete_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_editable_delete_text() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cck_add_mac_entry(char *, int);
int /*<<< orphan*/ cck_init_mac_hash_table();
int /*<<< orphan*/ cck_show_mac_hash_table();
int main(int argc, char *argv[]) {
  cck_init_mac_hash_table();
  cck_add_mac_entry("11:22:33:44:aa:bb", 17);
  cck_add_mac_entry("11:22:33:44:aa:bb", 17);
  cck_show_mac_hash_table();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <cck_init_mac_hash_table@plt>
lea    0xeac(%rip),%rdi
mov    $0x11,%esi
call   1050 <cck_add_mac_entry@plt>
lea    0xe9b(%rip),%rdi
mov    $0x11,%esi
call   1050 <cck_add_mac_entry@plt>
mov    $0x0,%al
call   1040 <cck_show_mac_hash_table@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <cck_init_mac_hash_table@plt>
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
mov    $0x11,%esi
call   1050 <cck_add_mac_entry@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1050 <cck_add_mac_entry@plt>
xor    %eax,%eax
call   1040 <cck_show_mac_hash_table@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"11:22:33:44:aa:bb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @cck_init_mac_hash_table()
%7 = call i32 @cck_add_mac_entry(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
%8 = call i32 @cck_add_mac_entry(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
%9 = call i32 (...) @cck_show_mac_hash_table()
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"11:22:33:44:aa:bb\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @cck_init_mac_hash_table()
%4 = tail call i32 @cck_add_mac_entry(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
%5 = tail call i32 @cck_add_mac_entry(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
%6 = tail call i32 (...) @cck_show_mac_hash_table()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void output_label(char *label) {
  printf(".globl %s\n", label);
  printf("\tALGN\n");
  printf("%s:\n", label);
}


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

x86 assembly (clang, -O2):
<output_label>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c".globl %s\0A\00"
@.str.1 = [7 x i8] c"\09ALGN\0A\00"
@.str.2 = [5 x i8] c"%s:\0A\00"
define void @output_label(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c".globl %s\0A\00"
@.str.2 = [5 x i8] c"%s:\0A\00"
@str = [6 x i8] c"\09ALGN\00"
define void @output_label(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct netent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int errno;
struct netent *getnetent();
int main(int argc, char const *argv[]) {
  struct netent *entry;
  entry = getnetent();
  assert(entry == NULL);
  entry = getnetent();
  assert(entry == NULL);
  return errno;
}


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    $0x0,%al
call   1030 <getnetent@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <getnetent@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getnetent@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <getnetent@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.netent = type { i32 }
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.netent*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call %struct.netent* (...) @getnetent()
store %struct.netent* %7, %struct.netent** %6
%8 = load %struct.netent*, %struct.netent** %6
%9 = icmp eq %struct.netent* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call %struct.netent* (...) @getnetent()
store %struct.netent* %12, %struct.netent** %6
%13 = load %struct.netent*, %struct.netent** %6
%14 = icmp eq %struct.netent* %13, null
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* @errno
ret i32 %17
}

LLVM IR (-O2):
%struct.netent = type { i32 }
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.netent* (...) @getnetent()
%4 = icmp eq %struct.netent* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call %struct.netent* (...) @getnetent()
%8 = icmp eq %struct.netent* %7, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = load i32, i32* @errno
ret i32 %11
}
void hg_leave_powersave(void) { ; }


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

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

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

LLVM IR (-O2):
define void @hg_leave_powersave() {
ret void
}
/* Type definitions */
struct t_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_length(struct t_list *);
int isempty(struct t_list *plist) { return get_length(plist) == 0; }


x86 assembly (clang, -O0):
<isempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_length@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.t_list = type { i32 }
define i32 @isempty(%struct.t_list* %0) {
%2 = alloca %struct.t_list*
store %struct.t_list* %0, %struct.t_list** %2
%3 = load %struct.t_list*, %struct.t_list** %2
%4 = call i64 @get_length(%struct.t_list* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.t_list = type { i32 }
define i32 @isempty(%struct.t_list* %0) {
%2 = tail call i64 @get_length(%struct.t_list* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}