xunge/DecIR huggingface dataset:
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *BuildOneTwoThree();
int GetNth(struct node *, int);
int /*<<< orphan*/ assert(int);
void GetNthTest() {
  struct node *myList = BuildOneTwoThree();
  int lastNode = GetNth(myList, 2);
  assert(lastNode == 3);
}


x86 assembly (clang, -O0):
<GetNthTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <BuildOneTwoThree@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1050 <GetNth@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNthTest>:
push   %rax
xor    %eax,%eax
call   1030 <BuildOneTwoThree@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   1050 <GetNth@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define void @GetNthTest() {
%1 = alloca %struct.node*
%2 = alloca i32
%3 = call %struct.node* (...) @BuildOneTwoThree()
store %struct.node* %3, %struct.node** %1
%4 = load %struct.node*, %struct.node** %1
%5 = call i32 @GetNth(%struct.node* %4, i32 2)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 3
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @GetNthTest() {
%1 = tail call %struct.node* (...) @BuildOneTwoThree()
%2 = tail call i32 @GetNth(%struct.node* %1, i32 2)
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
void slip_arch_writeb() {}


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

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

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

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

/* Variables and functions */
int wcscmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int __wcscoll_l(const wchar_t *l, const wchar_t *r, locale_t locale) {
  return wcscmp(l, r);
}


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

x86 assembly (clang, -O2):
<__wcscoll_l>:
jmp    1030 <wcscmp@plt>

LLVM IR (-O0):
define i32 @__wcscoll_l(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 = load i32*, i32** %5
%9 = call i32 @wcscmp(i32* %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @__wcscoll_l(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @wcscmp(i32* %0, i32* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x7b() {
  Assert_real((isspace(123) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              620, ("isspace should be 0 for {"));
}


x86 assembly (clang, -O0):
<t_isspace_0x7b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x26c,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x7b>:
push   %rax
mov    $0x7b,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x26c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for {\00"
define void @t_isspace_0x7b() {
%1 = call i64 @isspace(i32 123)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for {\00"
define void @t_isspace_0x7b() {
%1 = tail call i64 @isspace(i32 123)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Enter N: ");
  scanf("%d", &num);
  int sum = num * (num + 1) / 2;
  printf("The sum of first %d natural numbers is : %d", num, sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0x1(%rsi),%eax
imul   %esi,%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Enter N: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [44 x i8] c"The sum of first %d natural numbers is : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
%8 = mul nsw i32 %5, %7
%9 = sdiv i32 %8, 2
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Enter N: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [44 x i8] c"The sum of first %d natural numbers is : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
%7 = mul nsw i32 %6, %5
%8 = sdiv i32 %7, 2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %8)
ret i32 0
}
void f1(void) {
  int i = 69;
  i = i;
  return;
}


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

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

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

LLVM IR (-O2):
define void @f1() {
ret void
}
/* Variables and functions */
scalar_t__ is_walkable(char);
int is_pushable(char ch) { return is_walkable(ch) && ch != 'x'; }


x86 assembly (clang, -O0):
<is_pushable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_walkable@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     1146 <is_pushable+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x78,%eax
setne  %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_pushable>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_walkable@plt>
test   %rax,%rax
setne  %al
cmp    $0x78,%bl
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_pushable(i8 signext %0) {
%2 = tail call i64 @is_walkable(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp ne i8 %0, 120
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ASN1_item_i2d_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CRL_it;
int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl) {
  return ASN1_item_i2d_fp(&X509_CRL_it, fp, crl);
}


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

x86 assembly (clang, -O2):
<i2d_X509_CRL_fp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_i2d_fp@plt>

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

LLVM IR (-O2):
@X509_CRL_it = global i32 0
define i32 @i2d_X509_CRL_fp(i32* %0, i32* %1) {
%3 = tail call i32 @ASN1_item_i2d_fp(i32* @X509_CRL_it, i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int intkeycmp(const void *v1, const void *v2) {
  intptr_t i1 = (intptr_t)v1;
  intptr_t i2 = (intptr_t)v2;
  if (i1 < i2)
    return 1;
  else if (i1 > i2)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<intkeycmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1136 <intkeycmp+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1157 <intkeycmp+0x57>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1150 <intkeycmp+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <intkeycmp+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intkeycmp>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setg   %cl
neg    %ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @intkeycmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp slt i8* %0, %1
%4 = icmp sgt i8* %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_palindrome(char const *, int, int);
void test2(void) {
  const char a[] = {'a', 'b'};
  test_palindrome(a, sizeof(a), 1);
  test_palindrome(a, sizeof(a), 2);
  printf("\n");
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
lea    -0x2(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1040 <test_palindrome@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rbx
sub    $0x10,%rsp
movw   $0x6261,0xe(%rsp)
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test2.a = [2 x i8] c"ab"
@.str = [2 x i8] c"\0A\00"
define void @test2() {
%1 = alloca [2 x i8]
%2 = bitcast [2 x i8]* %1 to i8*
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_palindrome(i8* %3, i32 2, i32 1)
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%6 = call i32 @test_palindrome(i8* %5, i32 2, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @test2() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 25185, i16* %1
%3 = call i32 @test_palindrome(i8* %2, i32 2, i32 1)
%4 = call i32 @test_palindrome(i8* %2, i32 2, i32 2)
%5 = call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
int /*<<< orphan*/ putchar(char);
int strlen(char const *);
void dumpStr(const char *buf) {
  int i;
  for (i = 0; i < strlen(buf); i++) {
    printf("%hhu.", buf[i]);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<dumpStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1185 <dumpStr+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xe92(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <dumpStr+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpStr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1170 <dumpStr+0x40>
xor    %ebx,%ebx
lea    0xeb6(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1150 <dumpStr+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%hhu.\00"
define void @dumpStr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
%20 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%hhu.\00"
define void @dumpStr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}
void setgraphmode(int vgamed) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ MAG3110_ReadRawData(int, int, int);
int16_t MAG3110_ReadRawData_x() {
  return MAG3110_ReadRawData(0x01, 0x02, (0x01 << 0));
}


x86 assembly (clang, -O0):
<MAG3110_ReadRawData_x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    $0x2,%esi
mov    %edx,%edi
call   1030 <MAG3110_ReadRawData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAG3110_ReadRawData_x>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <MAG3110_ReadRawData@plt>

LLVM IR (-O0):
define i32 @MAG3110_ReadRawData_x() {
%1 = call i32 @MAG3110_ReadRawData(i32 1, i32 2, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @MAG3110_ReadRawData_x() {
%1 = tail call i32 @MAG3110_ReadRawData(i32 1, i32 2, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ leaf();
__attribute__((optimize("no-omit-frame-pointer"))) void non_leaf_1(void) {
  leaf();
}


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

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

LLVM IR (-O0):
define void @non_leaf_1() {
%1 = call i32 (...) @leaf()
ret void
}

LLVM IR (-O2):
define void @non_leaf_1() {
%1 = tail call i32 (...) @leaf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_routine(char const *, char const *);
int jupiter_print(const char *salutation, const char *name) {
  print_routine(salutation, name);
}


x86 assembly (clang, -O0):
<jupiter_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <print_routine@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jupiter_print>:
jmp    1030 <print_routine@plt>

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

LLVM IR (-O2):
define i32 @jupiter_print(i8* %0, i8* %1) {
%3 = tail call i32 @print_routine(i8* %0, i8* %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xea() {
  Assert_real((isupper(234) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1175, ("isupper should be 0 for 0xea"));
}


x86 assembly (clang, -O0):
<t_isupper_0xea>:
push   %rbp
mov    %rsp,%rbp
mov    $0xea,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x497,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xea>:
push   %rax
mov    $0xea,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x497,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xea\00"
define void @t_isupper_0xea() {
%1 = call i64 @isupper(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xea\00"
define void @t_isupper_0xea() {
%1 = tail call i64 @isupper(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *returnSignedArray();
int signed_array() {
  int *a = returnSignedArray();
  if (a[0] < 0) {
    int y = 1 / 0;
  }
}


x86 assembly (clang, -O0):
<signed_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <returnSignedArray@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1133 <signed_array+0x23>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @signed_array() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = call i32* (...) @returnSignedArray()
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 poison, i32* %3
br label %10
10: ; preds = %9, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @signed_array() {
%1 = tail call i32* (...) @returnSignedArray()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ pause();
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/);
int main(void) {
  sigset_t s;
  sigfillset(&s);
  sigprocmask(SIG_SETMASK, &s, 0);
  pause();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    $0x0,%al
call   1050 <pause@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
xor    %eax,%eax
call   1050 <pause@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sigfillset(i32* %2)
%4 = load i32, i32* @SIG_SETMASK
%5 = call i32 @sigprocmask(i32 %4, i32* %2, i32 0)
%6 = call i32 (...) @pause()
ret i32 0
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_SETMASK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32 0)
%6 = call i32 (...) @pause()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void printUsage(FILE *file) {
  fprintf(file, "usage: bm_widget bm_hostname bm_port bot_command\n");
  fprintf(file, "  bot_command: agent executable, passed \"hostname port\"\n");
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x31,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xefe(%rip),%rdi
mov    $0x38,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"usage: bm_widget bm_hostname bm_port bot_command\0A\00"
@.str.1 = [57 x i8] c" bot_command: agent executable, passed \22hostname port\22\0A\00"
define void @printUsage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"usage: bm_widget bm_hostname bm_port bot_command\0A\00"
@.str.1 = [57 x i8] c" bot_command: agent executable, passed \22hostname port\22\0A\00"
define void @printUsage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i64 49, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i64 56, i64 1, i32* %0)
ret void
}
int dolabel() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @dolabel() {
ret i32 0
}
/* Variables and functions */
int __builtin_ptx_read_tid_w();
int __builtin_ptx_read_tid_x();
int __builtin_ptx_read_tid_y();
int __builtin_ptx_read_tid_z();
__attribute__((device)) int read_tid() {
  int x = __builtin_ptx_read_tid_x();
  int y = __builtin_ptx_read_tid_y();
  int z = __builtin_ptx_read_tid_z();
  int w = __builtin_ptx_read_tid_w();
  return x + y + z + w;
}


x86 assembly (clang, -O0):
<read_tid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <__builtin_ptx_read_tid_x@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__builtin_ptx_read_tid_y@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <__builtin_ptx_read_tid_z@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <__builtin_ptx_read_tid_w@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_tid>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1060 <__builtin_ptx_read_tid_x@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <__builtin_ptx_read_tid_y@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <__builtin_ptx_read_tid_z@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__builtin_ptx_read_tid_w@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_tid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @__builtin_ptx_read_tid_x()
store i32 %5, i32* %1
%6 = call i32 (...) @__builtin_ptx_read_tid_y()
store i32 %6, i32* %2
%7 = call i32 (...) @__builtin_ptx_read_tid_z()
store i32 %7, i32* %3
%8 = call i32 (...) @__builtin_ptx_read_tid_w()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_tid() {
%1 = tail call i32 (...) @__builtin_ptx_read_tid_x()
%2 = tail call i32 (...) @__builtin_ptx_read_tid_y()
%3 = tail call i32 (...) @__builtin_ptx_read_tid_z()
%4 = tail call i32 (...) @__builtin_ptx_read_tid_w()
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ PN5180_transceiveCommand(int *, int, int *, int);
bool PN5180A_readRegister(uint8_t reg, uint32_t *value) {
  uint8_t cmd[2];
  cmd[0] = (0x04);
  cmd[1] = reg;
  PN5180_transceiveCommand(cmd, 2, (uint8_t *)value, 4);
  return true;
}


x86 assembly (clang, -O0):
<PN5180A_readRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2,%esi
mov    $0x4,%ecx
call   1030 <PN5180_transceiveCommand@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PN5180A_readRegister>:
push   %rax
mov    %rsi,%rdx
movl   $0x4,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x4,%ecx
call   1030 <PN5180_transceiveCommand@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PN5180A_readRegister(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 4, i32* %6
%7 = load i32, i32* %3
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %7, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%10 = load i32*, i32** %4
%11 = call i32 @PN5180_transceiveCommand(i32* %9, i32 2, i32* %10, i32 4)
ret i32 1
}

LLVM IR (-O2):
define i32 @PN5180A_readRegister(i32 %0, i32* %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 4, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %0, i32* %6
%7 = call i32 @PN5180_transceiveCommand(i32* %5, i32 2, i32* %1, i32 4)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  char *str = (char *)malloc(25);
  strcpy(str, "wow, such a nice string!");
  free(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x19,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x19,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"wow, such a nice string!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i64 @malloc(i32 25)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %5
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"wow, such a nice string!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 25)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @free(i8* %4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int testBit_fun_int32_t(int32_t x, uint32_t i) { return (x & 1 << i) != 0; }


x86 assembly (clang, -O0):
<testBit_fun_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit_fun_int32_t>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @testBit_fun_int32_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @testBit_fun_int32_t(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int isdigit(int);
bool invalidFunctionArgBool_isdigit(bool b, int c) {
  (void)isdigit(b);
  return isdigit(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <isdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_isdigit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @isdigit(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @isdigit(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_isdigit(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int close(int);
int lib_efi_runtime_close(int fd) { return close(fd); }


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

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

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

LLVM IR (-O2):
define i32 @lib_efi_runtime_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int test_imm_DEuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xDE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DEuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xde,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_DEuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 222
%7 = icmp ne i64 %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_DEuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14548992
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned long *, int, int, int /*<<< orphan*/ *);
void putdw(unsigned long x, FILE *f) { fwrite(&x, 4, 1, f); }


x86 assembly (clang, -O0):
<putdw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putdw>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putdw(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @fwrite(i64* %3, i32 4, i32 1, i32* %5)
ret void
}

LLVM IR (-O2):
define void @putdw(i64 %0, i32* nocapture %1) {
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i32 @fwrite(i64* %3, i32 4, i32 1, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int counter;
  for (counter = 1; counter < 7; counter++) {
    if (counter == 3) {
      printf("We call break and you won't see counter = 3 or higher\n");
      break;
    }
    printf("Number of counter: %d\n", counter);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    116c <main+0x5c>
cmpl   $0x3,-0x8(%rbp)
jne    114d <main+0x3d>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116c <main+0x5c>
mov    -0x8(%rbp),%esi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"We call break and you won't see counter = 3 or higher\0A\00"
@.str.1 = [23 x i8] c"Number of counter: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 7
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 3
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %17
11: ; preds = %6
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %3
17: ; preds = %9, %3
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Number of counter: %d\0A\00"
@str = [54 x i8] c"We call break and you won't see counter = 3 or higher\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
struct ifreq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SIOCGIFNETMASK;
struct sockaddr *if_addr_value(char const *, struct ifreq *,
                               int /*<<< orphan*/);
struct sockaddr *if_mask(const char *iface, struct ifreq *r) {
  return if_addr_value(iface, r, SIOCGIFNETMASK);
}


x86 assembly (clang, -O0):
<if_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
call   1030 <if_addr_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_mask>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <if_addr_value@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.ifreq = type { i32 }
@SIOCGIFNETMASK = global i32 0
define %struct.sockaddr* @if_mask(i8* %0, %struct.ifreq* %1) {
%3 = alloca i8*
%4 = alloca %struct.ifreq*
store i8* %0, i8** %3
store %struct.ifreq* %1, %struct.ifreq** %4
%5 = load i8*, i8** %3
%6 = load %struct.ifreq*, %struct.ifreq** %4
%7 = load i32, i32* @SIOCGIFNETMASK
%8 = call %struct.sockaddr* @if_addr_value(i8* %5, %struct.ifreq* %6, i32 %7)
ret %struct.sockaddr* %8
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
%struct.ifreq = type { i32 }
@SIOCGIFNETMASK = global i32 0
define %struct.sockaddr* @if_mask(i8* %0, %struct.ifreq* %1) {
%3 = load i32, i32* @SIOCGIFNETMASK
%4 = tail call %struct.sockaddr* @if_addr_value(i8* %0, %struct.ifreq* %1, i32 %3)
ret %struct.sockaddr* %4
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ leftViewUtil(struct node *, int, int *);
void leftView(struct node *root) {
  int max_level = 0;
  leftViewUtil(root, 1, &max_level);
}


x86 assembly (clang, -O0):
<leftView>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    -0xc(%rbp),%rdx
call   1030 <leftViewUtil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftView>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x1,%esi
call   1030 <leftViewUtil@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @leftView(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca i32
store %struct.node* %0, %struct.node** %2
store i32 0, i32* %3
%4 = load %struct.node*, %struct.node** %2
%5 = call i32 @leftViewUtil(%struct.node* %4, i32 1, i32* %3)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @leftView(%struct.node* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @leftViewUtil(%struct.node* %0, i32 1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_free_data() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_free_data"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_tagstruct_free_data\0A\00"
define i32 @pa_tagstruct_free_data() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_tagstruct_free_data\00"
define i32 @pa_tagstruct_free_data() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned rightrot(unsigned x, int n) {
  n = n % (sizeof(x) * 8);
  return ((x & ~(~0 << n + 1)) << (sizeof(x) * 8 - n)) | (x >> n);
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
and    $0x1f,%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movslq -0x8(%rbp),%rdx
mov    $0x20,%ecx
sub    %rdx,%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
mov    %esi,%ecx
and    $0x1f,%ecx
mov    $0xfffffffe,%edx
shl    %cl,%edx
mov    %edi,%eax
not    %edx
and    %edi,%edx
shrd   %cl,%edx,%eax
ret

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

LLVM IR (-O2):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl i32 -2, %3
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
%7 = tail call i32 @llvm.fshr.i32(i32 %6, i32 %0, i32 %3)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *time_stamp(void) {
  time_t cal_time;
  cal_time = time(NULL);
  return (ctime(&cal_time));
}


x86 assembly (clang, -O0):
<time_stamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_stamp>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @time_stamp() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i8* @ctime(i32* %1)
ret i8* %3
}

LLVM IR (-O2):
define i8* @time_stamp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
ret i8* %4
}
void av_find_program_from_stream() {}


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

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

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

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