xunge/DecIR huggingface dataset:
int ft_isprint(int c) {
  if (c >= 32 && c <= 126) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1127 <ft_isprint+0x27>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <ft_isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool is_unicode_valid(uint32_t ch) {
  if (ch >= 0x110000)
    return false;
  if ((ch & 0xFFFFF800) == 0xD800)
    return false;
  if ((ch >= 0xFDD0) && (ch <= 0xFDEF))
    return false;
  if ((ch & 0xFFFE) == 0xFFFE)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<is_unicode_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x110000,-0x8(%rbp)
jl     1120 <is_unicode_valid+0x20>
movl   $0x0,-0x4(%rbp)
jmp    118b <is_unicode_valid+0x8b>
mov    -0x8(%rbp),%eax
and    $0xfffff800,%eax
cmp    $0xd800,%eax
jne    113f <is_unicode_valid+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    118b <is_unicode_valid+0x8b>
cmpl   $0xfdd0,-0x8(%rbp)
jl     1165 <is_unicode_valid+0x65>
cmpl   $0xfdef,-0x8(%rbp)
jg     1165 <is_unicode_valid+0x65>
movl   $0x0,-0x4(%rbp)
jmp    118b <is_unicode_valid+0x8b>
mov    -0x8(%rbp),%eax
and    $0xfffe,%eax
cmp    $0xfffe,%eax
jne    1184 <is_unicode_valid+0x84>
movl   $0x0,-0x4(%rbp)
jmp    118b <is_unicode_valid+0x8b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unicode_valid>:
cmp    $0x110000,%edi
setl   %al
mov    %edi,%ecx
and    $0xfffff800,%ecx
cmp    $0xd800,%ecx
setne  %cl
and    %al,%cl
lea    -0xfdd0(%rdi),%eax
cmp    $0x20,%eax
setae  %al
not    %edi
test   $0xfffe,%edi
setne  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @is_unicode_valid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 1114112
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %25
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, -2048
%10 = icmp eq i32 %9, 55296
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %25
12: ; preds = %7
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 64976
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 65007
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 0, i32* %2
br label %25
19: ; preds = %15, %12
%20 = load i32, i32* %3
%21 = and i32 %20, 65534
%22 = icmp eq i32 %21, 65534
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 0, i32* %2
br label %25
24: ; preds = %19
store i32 1, i32* %2
br label %25
25: ; preds = %24, %23, %18, %11, %6
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_unicode_valid(i32 %0) {
%2 = icmp sgt i32 %0, 1114111
%3 = and i32 %0, -2048
%4 = icmp eq i32 %3, 55296
%5 = or i1 %2, %4
%6 = add i32 %0, -64976
%7 = icmp ult i32 %6, 32
%8 = or i1 %7, %5
%9 = and i32 %0, 65534
%10 = icmp ne i32 %9, 65534
%11 = xor i1 %8, true
%12 = and i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ prefsize(int, int);
void glutInitWindowSize(int w, int h) { prefsize(w, h); }


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

x86 assembly (clang, -O2):
<glutInitWindowSize>:
jmp    1030 <prefsize@plt>

LLVM IR (-O0):
define void @glutInitWindowSize(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 @prefsize(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @glutInitWindowSize(i32 %0, i32 %1) {
%3 = tail call i32 @prefsize(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int strlen(char *);
int fix_name(char *string) {
  int n = strlen(string);
  if (n > 3)
    return 0;
  memmove(string - n, string, n);
  *string = 0;
  return 1;
}


x86 assembly (clang, -O0):
<fix_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jle    114e <fix_name+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1178 <fix_name+0x58>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memmove@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
jg     114b <fix_name+0x2b>
movslq %eax,%rcx
mov    %rbx,%rdi
sub    %rcx,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memmove@plt>
movb   $0x0,(%rbx)
mov    $0x1,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fix_name(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 3
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = sub nsw i64 0, %5
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @memmove(i8* %7, i8* %0, i32 %2)
store i8 0, i8* %0
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %10
}
int altos_init(void) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ LCDPort_ClearCE();
int /*<<< orphan*/ LCDPort_In8();
int /*<<< orphan*/ LCDPort_SetCE();
int /*<<< orphan*/ LCDPort_SetRS();
int /*<<< orphan*/ LCDPort_SetRW();
int32_t readData_8BitIntf(void) {
  int32_t rs;
  LCDPort_SetRS();
  LCDPort_SetRW();
  LCDPort_SetCE();
  rs = LCDPort_In8();
  LCDPort_ClearCE();
  return rs;
}


x86 assembly (clang, -O0):
<readData_8BitIntf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <LCDPort_SetRS@plt>
mov    $0x0,%al
call   1070 <LCDPort_SetRW@plt>
mov    $0x0,%al
call   1050 <LCDPort_SetCE@plt>
mov    $0x0,%al
call   1040 <LCDPort_In8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <LCDPort_ClearCE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readData_8BitIntf>:
push   %rbx
xor    %eax,%eax
call   1060 <LCDPort_SetRS@plt>
xor    %eax,%eax
call   1070 <LCDPort_SetRW@plt>
xor    %eax,%eax
call   1050 <LCDPort_SetCE@plt>
xor    %eax,%eax
call   1040 <LCDPort_In8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <LCDPort_ClearCE@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readData_8BitIntf() {
%1 = alloca i32
%2 = call i32 (...) @LCDPort_SetRS()
%3 = call i32 (...) @LCDPort_SetRW()
%4 = call i32 (...) @LCDPort_SetCE()
%5 = call i32 (...) @LCDPort_In8()
store i32 %5, i32* %1
%6 = call i32 (...) @LCDPort_ClearCE()
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @readData_8BitIntf() {
%1 = tail call i32 (...) @LCDPort_SetRS()
%2 = tail call i32 (...) @LCDPort_SetRW()
%3 = tail call i32 (...) @LCDPort_SetCE()
%4 = tail call i32 (...) @LCDPort_In8()
%5 = tail call i32 (...) @LCDPort_ClearCE()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void b(int x) {
  static int c;
  if (c) {
    abort();
  }
  c = 1;
  ;
  if (x != sizeof(int) * 3)
    abort();
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,0x2f0a(%rip)
je     112f <b+0x1f>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x1,0x2ef3(%rip)
movslq -0x4(%rbp),%rax
cmp    $0xc,%rax
je     114e <b+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rax
cmpb   $0x1,0x2f14(%rip)
je     1128 <b+0x18>
movb   $0x1,0x2f0b(%rip)
cmp    $0xc,%edi
jne    1128 <b+0x18>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@b.c = internal global i32 0
define void @b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @b.c
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
store i32 1, i32* @b.c
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 12
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
ret void
}

LLVM IR (-O2):
@b.c = internal unnamed_addr global i1 false
define void @b(i32 %0) {
%2 = load i1, i1* @b.c
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
store i1 true, i1* @b.c
%6 = icmp eq i32 %0, 12
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %5
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t RFCGetPaGain(void) {
  return ((*((volatile unsigned long *)(0x2100034C))) & 0x003FFFFF);
}


x86 assembly (clang, -O0):
<RFCGetPaGain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2100034c,%eax
mov    (%rax),%rax
and    $0x3fffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RFCGetPaGain>:
mov    0x2100034c,%rax
21
and    $0x3fffff,%eax
ret

LLVM IR (-O0):
define i64 @RFCGetPaGain() {
%1 = load volatile i64, i64* inttoptr (i64 553648972 to i64*)
%2 = and i64 %1, 4194303
ret i64 %2
}

LLVM IR (-O2):
define i64 @RFCGetPaGain() {
%1 = load volatile i64, i64* inttoptr (i64 553648972 to i64*)
%2 = and i64 %1, 4194303
ret i64 %2
}
void test_two(int x, int y) {
#pragma omp parallel for simd
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_two(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
store i32 0, i32* %5
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
store i32 0, i32* %6
br label %12
12: ; preds = %17, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %12
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *str) {
  size_t len = strlen(str) + 1;
  char *dup = (char *)malloc(len);
  memcpy(dup, str, len);
  return dup;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %2
%14 = load i64, i64* %3
%15 = call i32 @memcpy(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
ret i8* %6
}
/* Variables and functions */
int f155(int *);
int f156(int *p) { return f155(p); }


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

x86 assembly (clang, -O2):
<f156>:
jmp    1030 <f155@plt>

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

LLVM IR (-O2):
define i32 @f156(i32* %0) {
%2 = tail call i32 @f155(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ enumerate(int);
void operation_enumerate(void) {
  enumerate(0x4);
  delay(1000);
}


x86 assembly (clang, -O0):
<operation_enumerate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1040 <enumerate@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_enumerate>:
push   %rax
mov    $0x4,%edi
call   1040 <enumerate@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @operation_enumerate() {
%1 = call i32 @enumerate(i32 4)
%2 = call i32 @delay(i32 1000)
ret void
}

LLVM IR (-O2):
define void @operation_enumerate() {
%1 = tail call i32 @enumerate(i32 4)
%2 = tail call i32 @delay(i32 1000)
ret void
}
void mdp4_dsi_video_blt_start(struct msm_fb_data_type *mfd) {}


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
define void @mdp4_dsi_video_blt_start(%struct.msm_fb_data_type* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XChar2b;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XChar2b(void *_p) {
  if (_p == NULL)
    abort();
  free((XChar2b *)_p);
}


x86 assembly (clang, -O0):
<free_XChar2b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XChar2b+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XChar2b>:
test   %rdi,%rdi
je     112a <free_XChar2b+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XChar2b(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XChar2b(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove_me();
int main(void) {
  int a;
  int b = 22;
  for (a = 22; a < 50; a++) {
    if (a > b)
      remove_me();
    b = b + 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x16,-0xc(%rbp)
movl   $0x16,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1161 <main+0x51>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114a <main+0x3a>
mov    $0x0,%al
call   1030 <remove_me@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x16,%ebx
mov    $0x16,%ebp
jmp    112b <main+0x1b>
nop
add    $0x2,%ebx
add    $0x1,%ebp
cmp    $0x4e,%ebx
je     1138 <main+0x28>
cmp    %ebx,%ebp
jbe    1120 <main+0x10>
xor    %eax,%eax
call   1030 <remove_me@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 22, %0 ], [ %8, %7 ]
%3 = phi i32 [ 22, %0 ], [ %9, %7 ]
%4 = icmp ugt i32 %3, %2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @remove_me()
br label %7
7: ; preds = %5, %1
%8 = add nuw nsw i32 %2, 2
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 50
br i1 %10, label %11, label %1
11: ; preds = %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ done(int);
void onintr(int dummy) { done(1); }


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

x86 assembly (clang, -O2):
<onintr>:
mov    $0x1,%edi
jmp    1030 <done@plt>

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

LLVM IR (-O2):
define void @onintr(i32 %0) {
%2 = tail call i32 @done(i32 1)
ret void
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf16(int f, int n) { return (cbuf(f, n, 16)); }


x86 assembly (clang, -O0):
<cbuf16>:
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    $0x10,%edx
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cbuf16(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 16)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf16(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 16)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
void init_random_generator() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  srandom(tv.tv_usec);
}


x86 assembly (clang, -O0):
<init_random_generator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
call   1030 <srandom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_random_generator>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <srandom@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @init_random_generator() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 @srandom(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @init_random_generator() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @srandom(i32 %5)
ret void
}
double PSItoINHG(double PSI) {
  double INHG = 2.03602 * PSI;
  return INHG;
}


x86 assembly (clang, -O0):
<PSItoINHG>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PSItoINHG>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @PSItoINHG(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 2.036020e+00, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @PSItoINHG(double %0) {
%2 = fmul double %0, 2.036020e+00
ret double %2
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void timer_start(double *t) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  *t = (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<timer_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x10(%rbp),%xmm1
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xec3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_start>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x8(%rsp),%xmm0
cvtsi2sdq (%rsp),%xmm1
mulsd  0xec9(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @timer_start(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
store double* %0, double** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
%12 = load double*, double** %2
store double %11, double* %12
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @timer_start(double* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
store double %11, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fz_traceendgroup(void *user) { printf("</group>\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"</group>\0A\00"
define void @fz_traceendgroup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"</group>\00"
define void @fz_traceendgroup(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
int main() {
  a(5);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a(i32 5)
ret i32 0
}
void spi_init_defaults(void) {}


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

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

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

LLVM IR (-O2):
define void @spi_init_defaults() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, char const *);
void usage(const char *prog, const char *msg, int status) {
  printf("%s"
         "%s [OPTIONS]\n"
         "\n"
         "-h\tThis help\n"
         "-s pre|post|off|on\tpre sleep and post sleep operation\n"
         "-d\tSwitch to discrete card\n"
         "-i\tSwitch to integrated card\n"
         "-w\tWakeup lvds\n"
         "-q default\tQuery current state of switching\n",
         msg, prog);
  exit(status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edx,%ebx
mov    %rdi,%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [199 x i8] c"%s%s [OPTIONS]\0A\0A-h\09This help\0A-s pre|post|off|on\09pre sleep and post sleep operation\0A-d\09Switch to discrete card\0A-i\09Switch to integrated card\0A-w\09Wakeup lvds\0A-q default\09Query current state of switching\0A\00"
define void @usage(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i32, i32* %6
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [199 x i8] c"%s%s [OPTIONS]\0A\0A-h\09This help\0A-s pre|post|off|on\09pre sleep and post sleep operation\0A-d\09Switch to discrete card\0A-i\09Switch to integrated card\0A-w\09Wakeup lvds\0A-q default\09Query current state of switching\0A\00"
define void @usage(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%5 = tail call i32 @exit(i32 %2)
unreachable
}
/* Type definitions */
typedef void external;

/* Variables and functions */
struct external *leaf(uintptr_t p) {
  return (void *)p;
}


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

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

LLVM IR (-O0):
%struct.external = type opaque
define %struct.external* @leaf(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
%5 = bitcast i8* %4 to %struct.external*
ret %struct.external* %5
}

LLVM IR (-O2):
%struct.external = type opaque
define %struct.external* @leaf(i64 %0) {
%2 = inttoptr i64 %0 to %struct.external*
ret %struct.external* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int chown(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int fu_Chown(const char *path, int uid, int gid) {
  return chown(path, (uid_t)uid, (gid_t)gid);
}


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

x86 assembly (clang, -O2):
<fu_Chown>:
jmp    1030 <chown@plt>

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

LLVM IR (-O2):
define i32 @fu_Chown(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @chown(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
_Noreturn void h() {
  while (1)
    switch (1) {
      for (;;)
        break;
      break;
    }
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <h+0x9>
jmp    1109 <h+0x9>

x86 assembly (clang, -O2):
<h>:
jmp    1100 <h>

LLVM IR (-O0):
define void @h() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @h() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
scalar_t__ trunc(double);
float truncf(float s) { return (float)trunc((double)s); }


x86 assembly (clang, -O0):
<truncf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <trunc@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <trunc@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @truncf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @trunc(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @truncf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @trunc(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
int test21(int a, int b, int c, int d) {
  int x = a == b;
  int y = c == 0;
  return x + y;
}


x86 assembly (clang, -O0):
<test21>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test21>:
xor    %ecx,%ecx
cmp    %esi,%edi
sete   %cl
xor    %eax,%eax
test   %edx,%edx
sete   %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test21(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test21(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = zext i1 %5 to i32
%7 = icmp eq i32 %2, 0
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %8, %6
ret i32 %9
}
int test_imm_74uint32_mem(unsigned int *val) {
  return ((*val) & (0x74 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_74uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 116
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_tb(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<close_tb>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_tb(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
void *calloc(int, int);
void *fa_calloc(int num, int size) {
  void *ptr = NULL;
  ptr = calloc(num, size);
  return ptr;
}


x86 assembly (clang, -O0):
<fa_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_calloc>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @fa_calloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
ret i8* %3
}
int hammingDistance(int x, int y) {
  int diff = 0;
  for (int i = 0; i < 32; i++) {
    diff += ((x & 1) ^ (y & 1));
    x >>= 1;
    y >>= 1;
  }
  return diff;
}


x86 assembly (clang, -O0):
<hammingDistance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jge    1156 <hammingDistance+0x56>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
xor    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <hammingDistance+0x18>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingDistance>:
xor    %eax,%eax
mov    $0x20,%r8d
nopl   0x0(%rax,%rax,1)
mov    %esi,%edx
xor    %edi,%edx
mov    %edx,%ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edx,%eax
shr    %eax
and    $0x1,%eax
add    %ecx,%eax
mov    %edx,%ecx
shr    $0x2,%ecx
and    $0x1,%ecx
add    %eax,%ecx
shr    $0x3,%edx
and    $0x1,%edx
mov    %edx,%eax
add    %ecx,%eax
sar    $0x4,%edi
sar    $0x4,%esi
add    $0xfffffffc,%r8d
jne    1110 <hammingDistance+0x10>
ret

LLVM IR (-O0):
define i32 @hammingDistance(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
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %22, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 32
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i32, i32* %3
%12 = and i32 %11, 1
%13 = load i32, i32* %4
%14 = and i32 %13, 1
%15 = xor i32 %12, %14
%16 = load i32, i32* %5
%17 = add nsw i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = ashr i32 %18, 1
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = ashr i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %10
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %7
25: ; preds = %7
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @hammingDistance(i32 %0, i32 %1) {
br label %4
3: ; preds = %4
ret i32 %23
4: ; preds = %4, %2
%5 = phi i32 [ 0, %2 ], [ %26, %4 ]
%6 = phi i32 [ 0, %2 ], [ %23, %4 ]
%7 = phi i32 [ %1, %2 ], [ %25, %4 ]
%8 = phi i32 [ %0, %2 ], [ %24, %4 ]
%9 = xor i32 %7, %8
%10 = and i32 %9, 1
%11 = add nuw nsw i32 %10, %6
%12 = xor i32 %7, %8
%13 = lshr i32 %12, 1
%14 = and i32 %13, 1
%15 = add nuw nsw i32 %14, %11
%16 = xor i32 %7, %8
%17 = lshr i32 %16, 2
%18 = and i32 %17, 1
%19 = add nuw nsw i32 %18, %15
%20 = xor i32 %7, %8
%21 = lshr i32 %20, 3
%22 = and i32 %21, 1
%23 = add nuw nsw i32 %22, %19
%24 = ashr i32 %8, 4
%25 = ashr i32 %7, 4
%26 = add nuw nsw i32 %5, 4
%27 = icmp eq i32 %26, 32
br i1 %27, label %3, label %4
}
/* Variables and functions */
int O_NDELAY;
int O_WRONLY;
int open(char const *, int);
int open_write(const char *fn) { return open(fn, O_WRONLY | O_NDELAY); }


x86 assembly (clang, -O0):
<open_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_write>:
mov    0x2eb9(%rip),%rax
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_NDELAY = global i32 0
define i32 @open_write(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = call i32 @open(i8* %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_NDELAY = global i32 0
define i32 @open_write(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_NDELAY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ *memset(int /*<<< orphan*/ *, int, int);
uint8_t *mac_clean(uint8_t mac[6]) { return memset(mac, 0x00, 6); }


x86 assembly (clang, -O0):
<mac_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_clean>:
xor    %esi,%esi
mov    $0x6,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i32* @mac_clean(i32* %0) {
%2 = tail call i32* @memset(i32* %0, i32 0, i32 6)
ret i32* %2
}
void return_uint_by_address(unsigned int *out) { *out = 42; }


x86 assembly (clang, -O0):
<return_uint_by_address>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_uint_by_address>:
movl   $0x2a,(%rdi)
ret

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

LLVM IR (-O2):
define void @return_uint_by_address(i32* nocapture writeonly %0) {
store i32 42, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_barrier_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_barrier_wait(int /*<<< orphan*/ *);
void *thread(void *param) {
  pthread_barrier_t *barrier = (pthread_barrier_t *)param;
  pthread_barrier_wait(barrier);
  return param;
}


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

x86 assembly (clang, -O2):
<thread>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pthread_barrier_wait@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @pthread_barrier_wait(i32* %6)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define i8* @thread(i8* returned %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_barrier_wait(i32* %2)
ret i8* %0
}
void f(char *s) {
  for (;;) {
    int t = 6;
    switch (t) {
    case 2:
      *s = '2';
    case 6:
    case 4:
    case 3:
    case 1:
      break;
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1160 <f+0x60>
jmp    1123 <f+0x23>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1159 <f+0x59>
jmp    1134 <f+0x34>
mov    -0x10(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x2,%eax
jb     1160 <f+0x60>
jmp    1148 <f+0x48>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
je     1160 <f+0x60>
jmp    1165 <f+0x65>
mov    -0x8(%rbp),%rax
movb   $0x32,(%rax)
jmp    1165 <f+0x65>
jmp    1108 <f+0x8>

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

LLVM IR (-O0):
define void @f(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %9, %1
store i32 6, i32* %3
%5 = load i32, i32* %3
switch i32 %5, label %9 [
i32 2, label %6
i32 6, label %8
i32 4, label %8
i32 3, label %8
i32 1, label %8
]
6: ; preds = %4
%7 = load i8*, i8** %2
store i8 50, i8* %7
br label %8
8: ; preds = %4, %4, %4, %4, %6
br label %9
9: ; preds = %4, %8
br label %4
}

LLVM IR (-O2):
define void @f(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int _XMP_gcd(int a, int b) {
  int r = a % b;
  if (r == 0) {
    return b;
  } else {
    return _XMP_gcd(b, r);
  }
}


x86 assembly (clang, -O0):
<_XMP_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    113d <_XMP_gcd+0x2d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <_XMP_gcd+0x3b>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_XMP_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_XMP_gcd>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <_XMP_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_XMP_gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %6, %3 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %5
}