xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int LCDVersionGet();
int RasterIntRawStatus(unsigned int baseAddr, unsigned int flag) {
  int status;
  unsigned int version;
  version = LCDVersionGet();
  if (2u == version) {
    status = (*((volatile unsigned int *)(baseAddr + (0x58)))) & flag;
  } else {
    status = -1;
  }
  return status;
}


x86 assembly (clang, -O0):
<RasterIntRawStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <LCDVersionGet@plt>
mov    %eax,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x10(%rbp),%eax
jne    114b <RasterIntRawStatus+0x3b>
mov    -0x4(%rbp),%eax
add    $0x58,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <RasterIntRawStatus+0x42>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterIntRawStatus>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <LCDVersionGet@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x2,%ecx
jne    1131 <RasterIntRawStatus+0x21>
add    $0x58,%ebx
and    (%rbx),%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RasterIntRawStatus(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 = call i32 (...) @LCDVersionGet()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 2, %8
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i32, i32* %3
%12 = add i32 %11, 88
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = load i32, i32* %4
%17 = and i32 %15, %16
store i32 %17, i32* %5
br label %19
18: ; preds = %2
store i32 -1, i32* %5
br label %19
19: ; preds = %18, %10
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @RasterIntRawStatus(i32 %0, i32 %1) {
%3 = tail call i32 (...) @LCDVersionGet()
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = add i32 %0, 88
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, %1
br label %11
11: ; preds = %2, %5
%12 = phi i32 [ %10, %5 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int sum(int, int);
void main() {
  int a = 2;
  int b = 3;
  int result = sum(a, b);
  if (result == a + b) {
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <sum@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jne    115c <main+0x3c>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <sum@plt>
cmp    $0x5,%eax
jne    113d <main+0x1d>
xor    %eax,%eax
pop    %rcx
jmp    1040 <__VERIFIER_error@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @sum(i32 2, i32 3)
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
char *GetConfigVar(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int my_CheckActiveService(char *service) {
  char *retval, sname[100];
  strcpy(sname, "activate-");
  strcat(sname, service);
  retval = GetConfigVar(sname);
  if (*retval == 'y')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<my_CheckActiveService>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x80(%rbp),%rdi
call   1040 <GetConfigVar@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x79,%eax
jne    1185 <my_CheckActiveService+0x55>
movl   $0x1,-0x4(%rbp)
jmp    118c <my_CheckActiveService+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_CheckActiveService>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
mov    %r14,%rdi
call   1040 <GetConfigVar@plt>
xor    %ecx,%ecx
cmpb   $0x79,(%rax)
sete   %cl
mov    %ecx,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"activate-\00"
define i32 @my_CheckActiveService(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [100 x i8]
store i8* %0, i8** %3
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%12 = call i8* @GetConfigVar(i8* %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 121
br i1 %16, label %17, label %18
17: ; preds = %1
store i32 1, i32* %2
br label %19
18: ; preds = %1
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [10 x i8] c"activate-\00"
define i32 @my_CheckActiveService(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strcat(i8* %3, i8* %0)
%6 = call i8* @GetConfigVar(i8* %3)
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 121
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ resolveEq2Grau();
int main() {
  resolveEq2Grau();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @resolveEq2Grau()
ret i32 0
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ insertln();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_insertln(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(insertln());
}


x86 assembly (clang, -O0):
<cmd_insertln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_insertln+0x27>
jmp    117f <cmd_insertln+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <insertln@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_insertln>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_insertln+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <insertln@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_insertln(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @insertln()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_insertln(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @insertln()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char const);
int is_name_char(const char ch) { return (isalnum(ch) || (ch == '_')); }


x86 assembly (clang, -O0):
<is_name_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <is_name_char+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_name_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_name_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_name_char(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
float math_degree_to_radian(const float degree) {
  return degree * 0.0174532925f;
}


x86 assembly (clang, -O0):
<math_degree_to_radian>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @math_degree_to_radian(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3F91DF46A0000000
ret float %4
}

LLVM IR (-O2):
define float @math_degree_to_radian(float %0) {
%2 = fmul float %0, 0x3F91DF46A0000000
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ test_date(size_t const);
int main(int argc __attribute__((unused)),
         char *argv[] __attribute__((unused))) {
  const size_t nruns = 10000000;
  test_date(nruns);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x989680,-0x18(%rbp)
mov    $0x989680,%edi
call   1030 <test_date@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 10000000, i64* %6
%7 = call i32 @test_date(i64 10000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_date(i64 10000000)
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(char);
int is_hex_digit(char c) {
  return isdigit(c) || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F');
}


x86 assembly (clang, -O0):
<is_hex_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1185 <is_hex_digit+0x75>
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     115c <is_hex_digit+0x4c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    1185 <is_hex_digit+0x75>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     117f <is_hex_digit+0x6f>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_digit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xdf,%bl
add    $0xbf,%bl
cmp    $0x6,%bl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_hex_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %24, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 97, %8
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 102
br i1 %13, label %24, label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 65, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 70
br label %22
22: ; preds = %18, %14
%23 = phi i1 [ false, %14 ], [ %21, %18 ]
br label %24
24: ; preds = %22, %10, %1
%25 = phi i1 [ true, %10 ], [ true, %1 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_hex_digit(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
int f(int n) { return 2 * n; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int upcase1(int);
int /*<<< orphan*/ uppercasep(int);
int lowercasep(int c) { return !uppercasep(c) && upcase1(c) != c; }


x86 assembly (clang, -O0):
<lowercasep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <uppercasep@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1154 <lowercasep+0x34>
mov    -0x4(%rbp),%edi
call   1040 <upcase1@plt>
cmp    -0x4(%rbp),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercasep>:
push   %rbx
mov    %edi,%ebx
call   1030 <uppercasep@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1132 <lowercasep+0x12>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <upcase1@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @lowercasep(i32 %0) {
%2 = tail call i32 @uppercasep(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @upcase1(i32 %0)
%6 = icmp ne i32 %5, %0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
main() { _Static_assert(__builtin_constant_p(strlen("hi")), "no builtin"); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void start_track(struct context *ctx) { printf("world dominated.\n"); }


x86 assembly (clang, -O0):
<start_track>:
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):
<start_track>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.context = type { i32 }
@.str = [18 x i8] c"world dominated.\0A\00"
define void @start_track(%struct.context* %0) {
%2 = alloca %struct.context*
store %struct.context* %0, %struct.context** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.context = type { i32 }
@str = [17 x i8] c"world dominated.\00"
define void @start_track(%struct.context* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ recover_qs();
void *thread_qs(void *args) { recover_qs(); }


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

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

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

LLVM IR (-O2):
define noalias i8* @thread_qs(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @recover_qs()
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ fig06_23();
int main(void) {
  fig06_23();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fig06_23()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void *thread_exit(void *arg) {
  pthread_exit(arg);
  return arg;
}


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

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

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

LLVM IR (-O2):
define i8* @thread_exit(i8* returned %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret i8* %0
}
void vmi_bringup(void) {}


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

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

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

LLVM IR (-O2):
define void @vmi_bringup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
size_t strlen(char *);
void pointer_arith5_Bad() {
  char buf[1024];
  fgets(buf, 1024, stdin);
  size_t len = strlen(buf);
  if (len < sizeof(buf) - 3) {
    (buf + len)[sizeof(buf) - len] = '\0';
  }
}


x86 assembly (clang, -O0):
<pointer_arith5_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1040 <fgets@plt>
lea    -0x400(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x408(%rbp)
cmpq   $0x3fd,-0x408(%rbp)
jae    1187 <pointer_arith5_Bad+0x67>
lea    -0x400(%rbp),%rax
add    -0x408(%rbp),%rax
mov    $0x400,%ecx
sub    -0x408(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointer_arith5_Bad>:
sub    $0x408,%rsp
mov    0x2eca(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x400,%esi
call   1030 <fgets@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @pointer_arith5_Bad() {
%1 = alloca [1024 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 1024, i32 %4)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = icmp ult i64 %8, 1021
br i1 %9, label %10, label %17
10: ; preds = %0
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%12 = load i64, i64* %2
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i64, i64* %2
%15 = sub i64 1024, %14
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
br label %17
17: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @pointer_arith5_Bad() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 1024, i32 %3)
ret void
}
/* Variables and functions */
double acos(float);
float deg_acos(float deg) { return acos(deg) / 0.01745329251; }


x86 assembly (clang, -O0):
<deg_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <acos@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_acos>:
push   %rax
call   1030 <acos@plt>
divsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @deg_acos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @acos(float %3)
%5 = fdiv double %4, 0x3F91DF46A226E211
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @deg_acos(float %0) {
%2 = tail call double @acos(float %0)
%3 = fdiv double %2, 0x3F91DF46A226E211
%4 = fptrunc double %3 to float
ret float %4
}
void POLICY_CONSTRAINTS_free(void) {}


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

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

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

LLVM IR (-O2):
define void @POLICY_CONSTRAINTS_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sC() {
  dash();
  dot();
  dash();
  dot();
  cBreak();
}


x86 assembly (clang, -O0):
<sC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sC>:
push   %rax
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sC() {
%1 = call i32 (...) @dash()
%2 = call i32 (...) @dot()
%3 = call i32 (...) @dash()
%4 = call i32 (...) @dot()
%5 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sC() {
%1 = tail call i32 (...) @dash()
%2 = tail call i32 (...) @dot()
%3 = tail call i32 (...) @dash()
%4 = tail call i32 (...) @dot()
%5 = tail call i32 (...) @cBreak()
ret void
}
int test_imm_E3uint16_mem(unsigned short *val) {
  return ((*val) & (0xE3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E3uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 227
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ttrim(char *c) {
  while ((*c++ != '\0')) {
    ;
  }
  for (--c; *--c == '\n'; *c = '\0') {
    ;
  }
}


x86 assembly (clang, -O0):
<ttrim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1128 <ttrim+0x28>
jmp    1108 <ttrim+0x8>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0xa,%eax
jne    1161 <ttrim+0x61>
jmp    1155 <ttrim+0x55>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1134 <ttrim+0x34>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttrim>:
add    $0xfffffffffffffffe,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x2(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ttrim+0x10>
cmpb   $0xa,(%rdi)
jne    112d <ttrim+0x2d>
nop
movb   $0x0,(%rdi)
cmpb   $0xa,-0x1(%rdi)
lea    -0x1(%rdi),%rdi
je     1120 <ttrim+0x20>
ret

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

LLVM IR (-O2):
define void @ttrim(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 -1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %7, %11
%12 = phi i8* [ %13, %11 ], [ %8, %7 ]
store i8 0, i8* %12
%13 = getelementptr inbounds i8, i8* %12, i64 -1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 10
br i1 %15, label %11, label %16
16: ; preds = %11, %7
ret void
}
char const *pubnub_version(void) { return "3.1.0"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"3.1.0\00"
define i8* @pubnub_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int is_in_bound(int *arr, int size, int *ptr) {
  if (arr > ptr - 49) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
add    $0xffffffffffffff3c,%rcx
cmp    %rcx,%rax
jbe    1133 <is_in_bound+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <is_in_bound+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
add    $0xffffffffffffff3c,%rdx
xor    %eax,%eax
cmp    %rdi,%rdx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = getelementptr inbounds i32, i32* %2, i64 -49
%5 = icmp ult i32* %4, %0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ print();
int main() {
  print();
  char line[BUFSIZ];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <print@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@BUFSIZ = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (...) @print()
%5 = load i32, i32* @BUFSIZ
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i8, i64 %6
store i64 %6, i64* %3
store i32 0, i32* %1
%9 = load i8*, i8** %2
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @print()
ret i32 0
}
char pfio_get_pin_bit_mask(char pin_number) { return 1 << (pin_number - 1); }


x86 assembly (clang, -O0):
<pfio_get_pin_bit_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfio_get_pin_bit_mask>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define signext i8 @pfio_get_pin_bit_mask(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 1
%6 = shl i32 1, %5
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @pfio_get_pin_bit_mask(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -1
%4 = shl nuw i32 1, %3
%5 = trunc i32 %4 to i8
ret i8 %5
}
/* Variables and functions */
scalar_t__ num(int);
int skipnops() {
  register int opcode;
  while ((opcode = (int)num(1)) == 138)
    ;
  return opcode;
}


x86 assembly (clang, -O0):
<skipnops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <num@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x8a,%eax
jne    1135 <skipnops+0x25>
jmp    1118 <skipnops+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipnops>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <num@plt>
cmp    $0x8a,%eax
je     1120 <skipnops+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @skipnops() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call i64 @num(i32 1)
%4 = trunc i64 %3 to i32
store i32 %4, i32* %1
%5 = icmp eq i32 %4, 138
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @skipnops() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @num(i32 1)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 138
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = trunc i64 %2 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int myputs(char *s) {
  puts(s);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @myputs(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i32 0
}
/* Variables and functions */
void *memcpy(void *restrict dest, const void *restrict src, size_t n) {
  return dest;
}


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

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

LLVM IR (-O0):
define i8* @memcpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
ret i8* %7
}

LLVM IR (-O2):
define i8* @memcpy(i8* noalias readnone returned %0, i8* noalias nocapture readnone %1, i64 %2) {
ret i8* %0
}
int main(void) { return (10 > 20) + (10 > 20) + (20 > 10); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
char **fun2() {
  static char *p = "Windows";
  return &p;
}


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

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

LLVM IR (-O0):
@fun2.p = internal global i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0)
@.str = [8 x i8] c"Windows\00"
define i8** @fun2() {
ret i8** @fun2.p
}

LLVM IR (-O2):
@fun2.p = internal global i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
@.str = [8 x i8] c"Windows\00"
define i8** @fun2() {
ret i8** @fun2.p
}
void beServer() {}


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

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

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

LLVM IR (-O2):
define void @beServer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ first(int);
int main(void) { first(42); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <first@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @first(i32 42)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @first(i32 42)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ output;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char const *, char *);
int execute(const char *cmd) {
  char output[1024];
  FILE *fp = popen(cmd, "r");
  fgets(output, sizeof(output) - 1, fp);
  return atoi(output);
}


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <popen@plt>
mov    %rax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    $0x3ff,%esi
call   1030 <fgets@plt>
lea    -0x410(%rbp),%rdi
call   1050 <atoi@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
push   %rbx
sub    $0x400,%rsp
lea    0xec1(%rip),%rsi
call   1040 <popen@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3ff,%esi
mov    %rax,%rdx
call   1030 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atoi@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @execute(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @popen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = load i32*, i32** %4
%9 = call i32 @fgets(i8* %7, i32 1023, i32* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%11 = call i32 @atoi(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @execute(i8* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i32* @popen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @fgets(i8* %3, i32 1023, i32* %4)
%6 = call i32 @atoi(i8* %3)
ret i32 %6
}
/* Variables and functions */
size_t enrange(size_t x) { return x & 0x00ffffff; }


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

x86 assembly (clang, -O2):
<enrange>:
mov    %rdi,%rax
and    $0xffffff,%eax
ret

LLVM IR (-O0):
define i64 @enrange(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 16777215
ret i64 %4
}

LLVM IR (-O2):
define i64 @enrange(i64 %0) {
%2 = and i64 %0, 16777215
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ F_ULOCK;
int /*<<< orphan*/ lockf(int, int /*<<< orphan*/, int /*<<< orphan*/);
void unlock_file(int fd) { lockf(fd, F_ULOCK, 0); }


x86 assembly (clang, -O0):
<unlock_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <lockf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_file>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <lockf@plt>

LLVM IR (-O0):
@F_ULOCK = global i32 0
define void @unlock_file(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_ULOCK
%5 = call i32 @lockf(i32 %3, i32 %4, i32 0)
ret void
}

LLVM IR (-O2):
@F_ULOCK = global i32 0
define void @unlock_file(i32 %0) {
%2 = load i32, i32* @F_ULOCK
%3 = tail call i32 @lockf(i32 %0, i32 %2, i32 0)
ret void
}
void XGrabKey() {}


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

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

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

LLVM IR (-O2):
define void @XGrabKey() {
ret void
}
void dropbox_register_trigger_callback(const char *name,
                                       void (*callback)(void *), void *data) {}


x86 assembly (clang, -O0):
<dropbox_register_trigger_callback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dropbox_register_trigger_callback(i8* %0, void (i8*)* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca void (i8*)*
%6 = alloca i8*
store i8* %0, i8** %4
store void (i8*)* %1, void (i8*)** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @dropbox_register_trigger_callback(i8* nocapture %0, void (i8*)* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void yy_flex_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<yy_flex_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yy_flex_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int exe$enter(struct _fab *fab, void *err, void *suc) {
  printk("not implemented\n");
}


x86 assembly (clang, -O0):
<exe$enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe$enter>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$enter"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct._fab*
%6 = alloca i8*
%7 = alloca i8*
store %struct._fab* %0, %struct._fab** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$enter"(%struct._fab* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strtod(char *, char **);
void discard_line_values(char **const line, int n_discard) {
  char *endptr = NULL;
  for (int n = 0; n < n_discard; n++) {
    strtod(*line, &endptr);
    *line = endptr;
  }
}


x86 assembly (clang, -O0):
<discard_line_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1163 <discard_line_values+0x53>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <discard_line_values+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discard_line_values>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
test   %esi,%esi
jle    1155 <discard_line_values+0x45>
mov    %esi,%ebx
mov    %rdi,%r14
mov    (%rdi),%rdi
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rsi
call   1030 <strtod@plt>
mov    0x8(%rsp),%rdi
mov    %rdi,(%r14)
add    $0xffffffff,%ebx
jne    1140 <discard_line_values+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @discard_line_values(i8** nocapture %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load i8*, i8** %0
br label %9
8: ; preds = %9, %2
ret void
9: ; preds = %6, %9
%10 = phi i8* [ %13, %9 ], [ %7, %6 ]
%11 = phi i32 [ %14, %9 ], [ 0, %6 ]
%12 = call i32 @strtod(i8* %10, i8** %3)
%13 = load i8*, i8** %3
store i8* %13, i8** %0
%14 = add nuw nsw i32 %11, 1
%15 = icmp eq i32 %14, %1
br i1 %15, label %8, label %9
}
void bfqg_stats_update_idle_time(struct bfq_group *bfqg) {}


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

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

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

LLVM IR (-O2):
%struct.bfq_group = type opaque
define void @bfqg_stats_update_idle_time(%struct.bfq_group* nocapture %0) {
ret void
}
unsigned int explicit_signed_char_to_unsigned_int(signed char src) {
  return (unsigned int)src;
}


x86 assembly (clang, -O0):
<explicit_signed_char_to_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @explicit_signed_char_to_unsigned_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @explicit_signed_char_to_unsigned_int(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
int recursive(int iter) {
  if (iter < 1)
    return 1;
  return recursive(iter - 1) + 1;
}


x86 assembly (clang, -O0):
<recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1131 <recursive+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1142 <recursive+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <recursive@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive>:
lea    0x1(%rdi),%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @recursive(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = add nuw i32 %0, 1
%4 = select i1 %2, i32 1, i32 %3
ret i32 %4
}