xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ strlcat(char *, char *, int);
int main() {
  char s1[32];
  char s2[32];
  sprintf(s1, "AB");
  sprintf(s2, "DEF");
  strlcat(s1, s2, 6);
  printf("'%s'\r\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x50(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x6,%edx
call   1030 <strlcat@plt>
lea    -0x30(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movw   $0x4241,(%rsp)
movb   $0x0,0x2(%rsp)
movl   $0x464544,0x20(%rsp)
mov    %rsp,%rbx
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strlcat@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"AB\00"
@.str.1 = [4 x i8] c"DEF\00"
@.str.2 = [7 x i8] c"'%s'\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%10 = call i32 @strlcat(i8* %8, i8* %9, i32 6)
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"AB\00"
@.str.2 = [7 x i8] c"'%s'\0D\0A\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = bitcast [32 x i8]* %2 to i32*
store i32 4605252, i32* %5
%6 = call i32 @strlcat(i8* %3, i8* %4, i32 6)
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ _gtty(int, char *);
int _isatty(int d) {
  char buf[128];
  return _gtty(d, buf) >= 0;
}


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
call   1030 <_gtty@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isatty>:
sub    $0x88,%rsp
mov    %rsp,%rsi
call   1030 <_gtty@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @_isatty(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = call i64 @_gtty(i32 %4, i8* %5)
%7 = icmp sge i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i64 @_gtty(i32 %0, i8* %3)
%5 = lshr i64 %4, 63
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, 1
ret i32 %7
}
/* Variables and functions */
unsigned int disablePin(unsigned int const, unsigned int const);
unsigned int disableADCPin(const unsigned int port, const unsigned int pin) {
  if (port != 2) {
    return 1;
  }
  return disablePin(port, pin);
}


x86 assembly (clang, -O0):
<disableADCPin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1134 <disableADCPin+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1142 <disableADCPin+0x32>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <disablePin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disableADCPin>:
cmp    $0x2,%edi
jne    111f <disableADCPin+0xf>
mov    $0x2,%edi
jmp    1030 <disablePin@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @disableADCPin(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @disablePin(i32 2, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 1, %2 ]
ret i32 %7
}
int fun288() { return 288; }


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

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

LLVM IR (-O0):
define i32 @fun288() {
ret i32 288
}

LLVM IR (-O2):
define i32 @fun288() {
ret i32 288
}
/* Variables and functions */
char *malloc(int);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *parser_strip_quotes(const char *string) {
  size_t new_length = strlen(string) - 2;
  char *new_string = malloc(sizeof(char) * (new_length + 1));
  strncpy(new_string, string + 1, new_length);
  new_string[new_length] = 0;
  return new_string;
}


x86 assembly (clang, -O0):
<parser_strip_quotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x2,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_strip_quotes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
call   1040 <strlen@plt>
movslq %eax,%r12
lea    -0x2(%r12),%r14
lea    -0x1(%r12),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
add    $0x1,%r15
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x2(%rbx,%r12,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @parser_strip_quotes(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 = sub nsw i32 %6, 2
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = add i64 %9, 1
%11 = mul i64 1, %10
%12 = trunc i64 %11 to i32
%13 = call i8* @malloc(i32 %12)
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i64, i64* %3
%18 = call i32 @strncpy(i8* %14, i8* %16, i64 %17)
%19 = load i8*, i8** %4
%20 = load i64, i64* %3
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8 0, i8* %21
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @parser_strip_quotes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -2
%4 = sext i32 %3 to i64
%5 = add i32 %2, -1
%6 = tail call i8* @malloc(i32 %5)
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i32 @strncpy(i8* %6, i8* %7, i64 %4)
%9 = getelementptr inbounds i8, i8* %6, i64 %4
store i8 0, i8* %9
ret i8* %6
}
void OS_Sigusr1Handler(int signal) {
  printf("%s : signal = %d\n", __func__, signal);
  sleep(10);
  printf("%s %d\n", __func__, 29);
}


x86 assembly (clang, -O0):
<OS_Sigusr1Handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xecb(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x1d,%edx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_Sigusr1Handler>:
push   %rbx
mov    %edi,%edx
lea    0xed6(%rip),%rdi
lea    0xee1(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xa,%edi
xor    %eax,%eax
call   1040 <sleep@plt>
lea    0xed6(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1d,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s : signal = %d\0A\00"
@__func__.OS_Sigusr1Handler = [18 x i8] c"OS_Sigusr1Handler\00"
@.str.1 = [7 x i8] c"%s %d\0A\00"
define void @OS_Sigusr1Handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.OS_Sigusr1Handler, i64 0, i64 0), i32 %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 10)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.OS_Sigusr1Handler, i64 0, i64 0), i32 29)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s : signal = %d\0A\00"
@__func__.OS_Sigusr1Handler = [18 x i8] c"OS_Sigusr1Handler\00"
@.str.1 = [7 x i8] c"%s %d\0A\00"
define void @OS_Sigusr1Handler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.OS_Sigusr1Handler, i64 0, i64 0), i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.OS_Sigusr1Handler, i64 0, i64 0), i32 29)
ret void
}
/* Variables and functions */
size_t zero_or_ten(int);
void l3_concrete_no_overrun_Good_FP() {
  int a[zero_or_ten(1) + 5];
  a[zero_or_ten(1)] = 0;
}


x86 assembly (clang, -O0):
<l3_concrete_no_overrun_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
call   1030 <zero_or_ten@plt>
mov    %rax,%rcx
mov    %rcx,%rax
add    $0x5,%rax
mov    %rsp,%rdx
mov    %rdx,-0x8(%rbp)
lea    0x23(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <zero_or_ten@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l3_concrete_no_overrun_Good_FP>:
push   %rax
mov    $0x1,%edi
call   1030 <zero_or_ten@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <zero_or_ten@plt>

LLVM IR (-O0):
define void @l3_concrete_no_overrun_Good_FP() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 @zero_or_ten(i32 1)
%4 = add i64 %3, 5
%5 = call i8* @llvm.stacksave()
store i8* %5, i8** %1
%6 = alloca i32, i64 %4
store i64 %4, i64* %2
%7 = call i64 @zero_or_ten(i32 1)
%8 = getelementptr inbounds i32, i32* %6, i64 %7
store i32 0, i32* %8
%9 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
define void @l3_concrete_no_overrun_Good_FP() {
%1 = tail call i64 @zero_or_ten(i32 1)
%2 = tail call i64 @zero_or_ten(i32 1)
ret void
}
int check_args(int argc) {
  if (argc < 4 || argc > 4)
    return 0;
  return 1;
}


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

x86 assembly (clang, -O2):
<check_args>:
xor    %eax,%eax
cmp    $0x4,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_args(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int n = 5, d = 3;
  assert(n % -d == 2);
  assert(-n % d == -2);
  assert(5 % -3 == 2);
  assert(-5 % 3 == -2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0xfffffffe,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 10;
  do {
    if (i % 3 == 0)
      continue;
    if (i == 2)
      break;
    printf("%d\n", i);
  } while (i--);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113f <main+0x2f>
jmp    115d <main+0x4d>
cmpl   $0x2,-0x8(%rbp)
jne    114e <main+0x3e>
jmp    1171 <main+0x61>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jne    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %2
%5 = srem i32 %4, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %15
8: ; preds = %3
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %8
br label %19
12: ; preds = %8
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %7
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -1
store i32 %17, i32* %2
%18 = icmp ne i32 %16, 0
br i1 %18, label %3, label %19
19: ; preds = %15, %11
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sstdevwd(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sstdevwd(N, 1.0f, x, stride);
  printf("sample standard deviation: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1040 <stdlib_strided_sstdevwd@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_sstdevwd@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [31 x i8] c"sample standard deviation: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sstdevwd(i32 %6, float 1.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [31 x i8] c"sample standard deviation: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sstdevwd(i32 4, float 1.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
void pcp_print_net_sock6_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_net_sock6_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_sock6_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int border_width;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
void set_XCreateWindowEvent_border_width(void *_p, int _v) {
  ((XCreateWindowEvent *)_p)->border_width = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XCreateWindowEvent_border_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void udelay(unsigned long usec) {}


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

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

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

LLVM IR (-O2):
define void @udelay(i64 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void printFn(FILE **fp, const char *str) {
  if (1 == 1) {
    fprintf(*fp, "func:%s ", str);
  } else {
  }
}


x86 assembly (clang, -O0):
<printFn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFn>:
mov    %rsi,%rdx
mov    (%rdi),%rdi
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"func:%s \00"
define void @printFn(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 = load i32*, i32** %5
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"func:%s \00"
define void @printFn(i32** nocapture %0, i8* %1) {
%3 = load i32*, i32** %0
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void termop_vt52(struct ansiseq *s) {
  tnc_log_log(
      7, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c",
      222, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_vt52>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0xde,%r8d
lea    0xf37(%rip),%r9
lea    0xf3c(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_vt52>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf63(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0xde,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_vt52 = [12 x i8] c"termop_vt52\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_vt52(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 222, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.termop_vt52, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_vt52 = [12 x i8] c"termop_vt52\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_vt52(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 222, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.termop_vt52, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
int abs(int n) { return ((n < 0) ? -n : n); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void area_sq(int *len) { *len = (*len) * (*len); }


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

x86 assembly (clang, -O2):
<area_sq>:
mov    (%rdi),%eax
imul   %eax,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @area_sq(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = mul nsw i32 %4, %6
%8 = load i32*, i32** %2
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @area_sq(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, %2
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long long __attribute__((regparm(3))) audit1_test(int i, int j, int k) {
  if (i != 1 || j != 2 || k != 3)
    abort();
  return 30;
}


x86 assembly (clang, -O0):
<audit1_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113f <audit1_test+0x2f>
cmpl   $0x2,-0x8(%rbp)
jne    113f <audit1_test+0x2f>
cmpl   $0x3,-0xc(%rbp)
je     1146 <audit1_test+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1e,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audit1_test>:
cmp    $0x1,%edi
jne    1125 <audit1_test+0x15>
cmp    $0x2,%esi
jne    1125 <audit1_test+0x15>
cmp    $0x3,%edx
jne    1125 <audit1_test+0x15>
mov    $0x1e,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i64 @audit1_test(i32 %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %0, 1
%5 = icmp ne i32 %1, 2
%6 = or i1 %4, %5
%7 = icmp ne i32 %2, 3
%8 = or i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %3
ret i64 30
}
/* Variables and functions */
int abs(float number) {
  if (number > 0)
    return number;
  else
    return -(number);
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1127 <abs+0x27>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <abs+0x40>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
movaps 0xef9(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm0,%xmm2
cvttss2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @abs(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fptosi float %7 to i32
store i32 %8, i32* %2
br label %13
9: ; preds = %1
%10 = load float, float* %3
%11 = fneg float %10
%12 = fptosi float %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @abs(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %0, float %3
%5 = fptosi float %4 to i32
ret i32 %5
}
int abs(const int j) { return (j < 0) ? -j : j; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
__attribute__((no)) int test1(int a, int b) {
  int res = a + b;
  return res;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
void test_c() {
  int i = 512;
  while (1) {
    milli_delay(10);
  }
}


x86 assembly (clang, -O0):
<test_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x200,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <milli_delay@plt>
jmp    111f <test_c+0xf>

x86 assembly (clang, -O2):
<test_c>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <milli_delay@plt>
jmp    1120 <test_c+0x10>

LLVM IR (-O0):
define void @test_c() {
%1 = alloca i32
store i32 512, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @milli_delay(i32 10)
br label %2
}

LLVM IR (-O2):
define void @test_c() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @milli_delay(i32 10)
br label %1
}
int compareInt(void *p1, void *p2) {
  int *n1 = (int *)p1;
  int *n2 = (int *)p2;
  return (*n1 - *n2);
}


x86 assembly (clang, -O0):
<compareInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareInt>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compareInt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compareInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
void onForeground_BaseScreen(void) {}


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

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

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

LLVM IR (-O2):
define void @onForeground_BaseScreen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xlCurOutput();
int /*<<< orphan*/ xlPutStr(int /*<<< orphan*/, char *);
void xlStdPutStr(char *str) { xlPutStr(xlCurOutput(), str); }


x86 assembly (clang, -O0):
<xlStdPutStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <xlCurOutput@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <xlPutStr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlStdPutStr>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <xlCurOutput@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <xlPutStr@plt>

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

LLVM IR (-O2):
define void @xlStdPutStr(i8* %0) {
%2 = tail call i32 (...) @xlCurOutput()
%3 = tail call i32 @xlPutStr(i32 %2, i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ readsplit(char **, int /*<<< orphan*/ *, char *);
void load_acpi(char **a) {
  FILE *acpi = popen("acpi | awk '{ print $3$4$5 }'", "r");
  readsplit(a, acpi, ",");
  pclose(acpi);
}


x86 assembly (clang, -O0):
<load_acpi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xebe(%rip),%rdx
call   1030 <readsplit@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_acpi>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
lea    0xecc(%rip),%rdx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <readsplit@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pclose@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"acpi | awk '{ print $3$4$5 }'\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c",\00"
define void @load_acpi(i8** %0) {
%2 = alloca i8**
%3 = alloca i32*
store i8** %0, i8*** %2
%4 = call i32* @popen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i8**, i8*** %2
%6 = load i32*, i32** %3
%7 = call i32 @readsplit(i8** %5, i32* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = call i32 @pclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"acpi | awk '{ print $3$4$5 }'\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c",\00"
define void @load_acpi(i8** %0) {
%2 = tail call i32* @popen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @readsplit(i8** %0, i32* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @pclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void loop_body_is_widened() {
  int i = 0;
  while (i < 100) {
    if (i > 10) {
      clang_analyzer_warnIfReached();
    }
    ++i;
  }
  clang_analyzer_warnIfReached();
}


x86 assembly (clang, -O0):
<loop_body_is_widened>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1148 <loop_body_is_widened+0x38>
cmpl   $0xa,-0x4(%rbp)
jle    113a <loop_body_is_widened+0x2a>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <loop_body_is_widened+0xf>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_body_is_widened>:
push   %rbx
xor    %ebx,%ebx
jmp    1128 <loop_body_is_widened+0x18>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1136 <loop_body_is_widened+0x26>
cmp    $0xb,%ebx
jb     1120 <loop_body_is_widened+0x10>
xor    %eax,%eax
call   1030 <clang_analyzer_warnIfReached@plt>
jmp    1120 <loop_body_is_widened+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1030 <clang_analyzer_warnIfReached@plt>

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

LLVM IR (-O2):
define void @loop_body_is_widened() {
br label %1
1: ; preds = %0, %6
%2 = phi i32 [ 0, %0 ], [ %7, %6 ]
%3 = icmp ugt i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @clang_analyzer_warnIfReached()
br label %6
6: ; preds = %4, %1
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 100
br i1 %8, label %9, label %1
9: ; preds = %6
%10 = tail call i32 (...) @clang_analyzer_warnIfReached()
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll21(struct __test_metadata *);
void wrapper_epoll21(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll21(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll21>:
jmp    1030 <epoll21@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll21(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll21(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll21(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll21(%struct.__test_metadata* %0)
ret void
}
void gtk_sort_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_sort_type_get_type() {
ret void
}
int main() { *((unsigned int *)4) = 1; }


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

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

LLVM IR (-O0):
define i32 @main() {
store i32 1, i32* inttoptr (i64 4 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store i32 1, i32* inttoptr (i64 4 to i32*)
ret i32 0
}
void _assert(const char *file, long line, const char *exp) {
  __asm__("int $3");
}


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

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

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

LLVM IR (-O2):
define void @_assert(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
tail call void asm sideeffect "int $$3", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
space(x0, y0, x1, y1) { printf("space(%d,%d,%d,%d)\n", x0, y0, x1, y1); }


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"space(%d,%d,%d,%d)\0A\00"
define i32 @space(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [20 x i8] c"space(%d,%d,%d,%d)\0A\00"
define i32 @space(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 undef
}
/* Variables and functions */
int getpid();
int com_getpid() { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @com_getpid() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @com_getpid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
int f10(int x, int y) {
  if (x != -0x7fffffff - 1)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x80000000,-0x8(%rbp)
je     112a <f10+0x2a>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1131 <f10+0x31>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
mov    $0x22,%eax
cmp    $0x80000000,%edi
je     1116 <f10+0x16>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f10(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -2147483648
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 34, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("hello %s\n", "world");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"hello %s\0A\00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void initPowerManagementTest(void) {}


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

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

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

LLVM IR (-O2):
define void @initPowerManagementTest() {
ret void
}