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

/* Variables and functions */
int applyclues(struct solver *, int *);
int search2(struct solver *, int);
int solve(struct solver *self, int *puzzle) {
  int nsol;
  int clues = applyclues(self, puzzle);
  if (clues == -1)
    return 0;
  nsol = search2(self, clues);
  return nsol;
}


x86 assembly (clang, -O0):
<solve>:
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 <applyclues@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    1156 <solve+0x36>
movl   $0x0,-0x4(%rbp)
jmp    116b <solve+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1040 <search2@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %rbx
mov    %rdi,%rbx
call   1030 <applyclues@plt>
cmp    $0xffffffff,%eax
je     1139 <solve+0x19>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <search2@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.solver = type { i32 }
define i32 @solve(%struct.solver* %0, i32* %1) {
%3 = tail call i32 @applyclues(%struct.solver* %0, i32* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @search2(%struct.solver* %0, i32 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
int test_imm_30uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x30 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_30uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 48
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int countChars(char *s, char c) {
  char a;
  int count = 0;
  while ((a = *s++) != 0)
    if (a == c)
      ++count;
  return count;
}


x86 assembly (clang, -O0):
<countChars>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xa(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1153 <countChars+0x53>
movsbl -0xa(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <countChars+0x4e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <countChars+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countChars>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <countChars+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <countChars+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @countChars(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = icmp eq i8 %6, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
char *reverse(char *);
int main() {
  char str[] = "reverse this";
  char *reversed = reverse(str);
  printf("%s\n%s\n", str, reversed);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <reverse@plt>
mov    %rax,-0x18(%rbp)
lea    -0xd(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x73696874206573,%rax
mov    %rax,0x5(%rsp)
movabs $0x2065737265766572,%rax
73 65 20
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [13 x i8] c"reverse this\00"
@.str = [7 x i8] c"%s\0A%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca i8*
%3 = bitcast [13 x i8]* %1 to i8*
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%5 = call i8* @reverse(i8* %4)
store i8* %5, i8** %2
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [13 x i8] c"reverse this\00"
@.str = [7 x i8] c"%s\0A%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i8* @reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xf1() {
  Assert_real((isbdigit(241) == 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_isbdigit.c",
              1210, ("isbdigit should be 0 for 0xf1"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xf1>:
push   %rax
mov    $0xf1,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4ba,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xf1\00"
define void @t_isbdigit_0xf1() {
%1 = call i64 @isbdigit(i32 241)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1210, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xf1\00"
define void @t_isbdigit_0xf1() {
%1 = tail call i64 @isbdigit(i32 241)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1210, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a();
int main(void) {
  a();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a()
ret i32 0
}
void swap(int *arr, int first, int second) {
  int tmp = arr[first];
  arr[first] = arr[second];
  arr[second] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void *scgc_max(void *a, void *b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<scgc_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <scgc_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <scgc_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scgc_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @scgc_max(i8* readnone %0, i8* readnone %1) {
%3 = icmp ugt i8* %0, %1
%4 = select i1 %3, i8* %0, i8* %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ __gmpn_sqr_basecase(unsigned long *, unsigned long *, long);
void __gmpn_sqr(unsigned long *d, unsigned long *a, long e) {
  __gmpn_sqr_basecase(d, a, e);
}


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

x86 assembly (clang, -O2):
<__gmpn_sqr>:
jmp    1030 <__gmpn_sqr_basecase@plt>

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

LLVM IR (-O2):
define void @__gmpn_sqr(i64* %0, i64* %1, i64 %2) {
%4 = tail call i32 @__gmpn_sqr_basecase(i64* %0, i64* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t S(uint8_t x, uint8_t y, uint8_t a) {
  uint8_t t = x + y + a;
  return (t << 2) | (t >> 6);
}


x86 assembly (clang, -O0):
<S>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    -0x10(%rbp),%ecx
sar    $0x6,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<S>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
lea    0x0(,%rax,4),%ecx
sar    $0x6,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @S(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = add nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = shl i32 %13, 2
%15 = load i32, i32* %7
%16 = ashr i32 %15, 6
%17 = or i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @S(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = shl i32 %5, 2
%7 = ashr i32 %5, 6
%8 = or i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int rand();
int randomNumber(int min, int max) {
  max -= min;
  return (rand() % max + min);
}


x86 assembly (clang, -O0):
<randomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sub    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randomNumber(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 = sub nsw i32 %6, %5
store i32 %7, i32* %4
%8 = call i32 (...) @rand()
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randomNumber(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %3
%6 = add nsw i32 %5, %0
ret i32 %6
}
int min(int a, int b) {
  if (a > b)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <min+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void gtk_accel_map_get() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @SNDDMA_UnlockBuffer() {
ret void
}
/* Variables and functions */
unsigned long readl(unsigned long);
int /*<<< orphan*/ writel(unsigned long, unsigned long);
void mdp4_read_clear_write(unsigned long reg, unsigned long mask) {
  unsigned long bits;
  bits = readl(reg);
  bits &= ~mask;
  writel(mask, reg);
}


x86 assembly (clang, -O0):
<mdp4_read_clear_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <readl@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <writel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdp4_read_clear_write>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <readl@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <writel@plt>

LLVM IR (-O0):
define void @mdp4_read_clear_write(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = call i64 @readl(i64 %6)
store i64 %7, i64* %5
%8 = load i64, i64* %4
%9 = xor i64 %8, -1
%10 = load i64, i64* %5
%11 = and i64 %10, %9
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = load i64, i64* %3
%14 = call i32 @writel(i64 %12, i64 %13)
ret void
}

LLVM IR (-O2):
define void @mdp4_read_clear_write(i64 %0, i64 %1) {
%3 = tail call i64 @readl(i64 %0)
%4 = tail call i32 @writel(i64 %1, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int f(int /*<<< orphan*/);
int main(void) {
  int y = f(0);
  __CRAB_assert(y == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @f(i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @__CRAB_assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__CRAB_assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ sig_block(int /*<<< orphan*/);
extern void sig_pipe_block(void) { sig_block(SIGPIPE); }


x86 assembly (clang, -O0):
<sig_pipe_block>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_pipe_block>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_block@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
define void @sig_pipe_block() {
%1 = load i32, i32* @SIGPIPE
%2 = call i32 @sig_block(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
define void @sig_pipe_block() {
%1 = load i32, i32* @SIGPIPE
%2 = tail call i32 @sig_block(i32 %1)
ret void
}
void ff_hevc_put_hevc_uni_qpel_v16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v16_8_sse4() {
ret void
}
void foo1(int a, char *b, int c) { c = a + c + 234; }


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
add    $0xea,%eax
mov    %eax,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo1(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = add nsw i32 %7, %8
%10 = add nsw i32 %9, 234
store i32 %10, i32* %6
ret void
}

LLVM IR (-O2):
define void @foo1(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int *CopyInt(const void *pInt) {
  int *i = (int *)malloc(sizeof(int));
  if (i == NULL) {
    fprintf(stderr, "error: not enought memory\n");
    exit(1);
  }
  *i = *(int *)pInt;
  return i;
}


x86 assembly (clang, -O0):
<CopyInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <CopyInt+0x44>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyInt>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1149 <CopyInt+0x19>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
pop    %rbx
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"error: not enought memory\0A\00"
define i32* @CopyInt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = load i32*, i32** %3
store i32 %15, i32* %16
%17 = load i32*, i32** %3
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"error: not enought memory\0A\00"
define i32* @CopyInt(i8* nocapture %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = bitcast i8* %0 to i32*
%11 = load i32, i32* %10
store i32 %11, i32* %3
ret i32* %3
}
/* Variables and functions */
int powersum(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, ps;
  scanf("%d", &n);
  ps = powersum(n);
  printf("%d", ps);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <powersum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @powersum(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @powersum(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_FREE(int /*<<< orphan*/ *);
cpu_set_t *cpu_set_mfree(cpu_set_t *p) {
  if (p)
    CPU_FREE(p);
  return NULL;
}


x86 assembly (clang, -O0):
<cpu_set_mfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <cpu_set_mfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <CPU_FREE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_set_mfree>:
test   %rdi,%rdi
je     111f <cpu_set_mfree+0xf>
push   %rax
call   1030 <CPU_FREE@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @cpu_set_mfree(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @CPU_FREE(i32* %6)
br label %8
8: ; preds = %5, %1
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @cpu_set_mfree(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @CPU_FREE(i32* %0)
br label %5
5: ; preds = %3, %1
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void bzero(void *s, size_t n) { memset(s, 0, n); }


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

x86 assembly (clang, -O2):
<bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
void __writeq(unsigned long val, void *addr) {
  *(volatile unsigned long *)addr = val;
}


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

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

LLVM IR (-O0):
define void @__writeq(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
store volatile i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @__writeq(i64 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
store volatile i64 %0, i64* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void lightsOff(void) { (*((volatile uint32_t *)0x4003100C)) = 0x00; }


x86 assembly (clang, -O0):
<lightsOff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4003100c,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lightsOff>:
movl   $0x0,0x4003100c
ret

LLVM IR (-O0):
define void @lightsOff() {
store volatile i32 0, i32* inttoptr (i64 1073942540 to i32*)
ret void
}

LLVM IR (-O2):
define void @lightsOff() {
store volatile i32 0, i32* inttoptr (i64 1073942540 to i32*)
ret void
}
/* Variables and functions */
scalar_t__ mce_ring_add(long);
void *thread(void *arg) {
  long i = 0;
  for (;;) {
    if (mce_ring_add(i) >= 0)
      i++;
  }
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mce_ring_add@plt>
cmp    $0x0,%rax
jl     1143 <thread+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <thread+0x14>

x86 assembly (clang, -O2):
<thread>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <mce_ring_add@plt>
not    %rax
shr    $0x3f,%rax
add    %rax,%rbx
jmp    1120 <thread+0x10>

LLVM IR (-O0):
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %11, %1
%5 = load i64, i64* %3
%6 = call i64 @mce_ring_add(i64 %5)
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i64, i64* %3
%10 = add nsw i64 %9, 1
store i64 %10, i64* %3
br label %11
11: ; preds = %8, %4
br label %4
}

LLVM IR (-O2):
define noalias i8* @thread(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = tail call i64 @mce_ring_add(i64 %3)
%5 = xor i64 %4, -1
%6 = lshr i64 %5, 63
%7 = add nuw nsw i64 %6, %3
br label %2
}
void update_free_space(void) {}


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

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

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

LLVM IR (-O2):
define void @update_free_space() {
ret void
}
/* Variables and functions */
float __nv_fast_sinf(float);
float __sinf(float __a) { return __nv_fast_sinf(__a); }


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

x86 assembly (clang, -O2):
<__sinf>:
jmp    1030 <__nv_fast_sinf@plt>

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

LLVM IR (-O2):
define float @__sinf(float %0) {
%2 = tail call float @__nv_fast_sinf(float %0)
ret float %2
}
/* Variables and functions */
int user_update(char const *, int /*<<< orphan*/);
int user_edit(const char *user) { return user_update(user, 0); }


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

x86 assembly (clang, -O2):
<user_edit>:
xor    %esi,%esi
jmp    1030 <user_update@plt>

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

LLVM IR (-O2):
define i32 @user_edit(i8* %0) {
%2 = tail call i32 @user_update(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
char *strchr(char const *, char);
int strlen(char const *);
char *after_first(const char str[], char c) {
  const char *result = strchr(str, c);
  result = (result == NULL) ? (str + strlen(str)) : (result + 1);
  return (char *)result;
}


x86 assembly (clang, -O0):
<after_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1174 <after_first+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1180 <after_first+0x60>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<after_first>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strchr@plt>
test   %rax,%rax
je     1134 <after_first+0x14>
add    $0x1,%rax
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @after_first(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %11
9: ; preds = %2
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %11
11: ; preds = %9, %5
%12 = phi i8* [ %8, %5 ], [ %10, %9 ]
ret i8* %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ root;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
unsigned long get_XLeaveWindowEvent_root(void *_p) {
  return (unsigned long)((XLeaveWindowEvent *)_p)->root;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XLeaveWindowEvent_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
void test1(char a1, char b, char c, char d, char e, char f, char g, char h) {
  char *p = &a1;
  p++;
  bar(p);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8d,-0x20(%rbp)
mov    %ecx,%eax
mov    -0x20(%rbp),%ecx
mov    %eax,-0x1c(%rbp)
mov    %edx,%eax
mov    -0x1c(%rbp),%edx
mov    %eax,-0x18(%rbp)
mov    %esi,%eax
mov    -0x18(%rbp),%esi
mov    %eax,-0x14(%rbp)
mov    %edi,%r8d
mov    -0x14(%rbp),%edi
mov    %r9b,%al
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %r8b,-0x1(%rbp)
mov    %dil,-0x2(%rbp)
mov    %sil,-0x3(%rbp)
mov    %dl,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <bar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <bar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test1(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
%17 = alloca i8*
store i8 %0, i8* %9
store i8 %1, i8* %10
store i8 %2, i8* %11
store i8 %3, i8* %12
store i8 %4, i8* %13
store i8 %5, i8* %14
store i8 %6, i8* %15
store i8 %7, i8* %16
store i8* %9, i8** %17
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %17
%20 = load i8*, i8** %17
%21 = call i32 @bar(i8* %20)
ret void
}

LLVM IR (-O2):
define void @test1(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i8
store i8 %0, i8* %9
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 @bar(i8* %10)
ret void
}
void limpa(char *v, int n) {
  for (int i = 0; i < n; ++i) {
    *(v + i) = 0;
  }
}


x86 assembly (clang, -O0):
<limpa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <limpa+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <limpa+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpa>:
test   %esi,%esi
jle    1122 <limpa+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @limpa(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ irq_clear_mask(int);
int /*<<< orphan*/ outb(int, int);
int /*<<< orphan*/ pic_start_interrupts();
void pic_enable_interrupts(void) {
  pic_start_interrupts();
  outb(0x64, 0x60);
  outb(0x60, 0x1);
  irq_clear_mask(1);
}


x86 assembly (clang, -O0):
<pic_enable_interrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pic_start_interrupts@plt>
mov    $0x64,%edi
mov    $0x60,%esi
call   1040 <outb@plt>
mov    $0x60,%edi
mov    $0x1,%esi
call   1040 <outb@plt>
mov    $0x1,%edi
call   1050 <irq_clear_mask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_enable_interrupts>:
push   %rax
xor    %eax,%eax
call   1030 <pic_start_interrupts@plt>
mov    $0x64,%edi
mov    $0x60,%esi
call   1040 <outb@plt>
mov    $0x60,%edi
mov    $0x1,%esi
call   1040 <outb@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <irq_clear_mask@plt>

LLVM IR (-O0):
define void @pic_enable_interrupts() {
%1 = call i32 (...) @pic_start_interrupts()
%2 = call i32 @outb(i32 100, i32 96)
%3 = call i32 @outb(i32 96, i32 1)
%4 = call i32 @irq_clear_mask(i32 1)
ret void
}

LLVM IR (-O2):
define void @pic_enable_interrupts() {
%1 = tail call i32 (...) @pic_start_interrupts()
%2 = tail call i32 @outb(i32 100, i32 96)
%3 = tail call i32 @outb(i32 96, i32 1)
%4 = tail call i32 @irq_clear_mask(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *malloc(scalar_t__);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *assign_string(char *s) {
  char *r = malloc(strlen(s) + 1);
  if (!r) {
    printf("Error: can't assign string %s\n", s);
    exit(12);
  }
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<assign_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    119a <assign_string+0x4a>
mov    -0x8(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
mov    $0xc,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
test   %rax,%rax
je     1183 <assign_string+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe76(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
mov    $0xc,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error: can't assign string %s\0A\00"
define i8* @assign_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error: can't assign string %s\0A\00"
define i8* @assign_string(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 12)
unreachable
9: ; preds = %1
%10 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t ident64(uint64_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @ident64(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int ipmi_tsol_command(void *, char *, int, int);
int ipmi_tsol_start(void *intf, char *recvip, int port) {
  return ipmi_tsol_command(intf, recvip, port, 0x06);
}


x86 assembly (clang, -O0):
<ipmi_tsol_start>:
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
mov    -0x14(%rbp),%edx
mov    $0x6,%ecx
call   1030 <ipmi_tsol_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipmi_tsol_start>:
mov    $0x6,%ecx
jmp    1030 <ipmi_tsol_command@plt>

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

LLVM IR (-O2):
define i32 @ipmi_tsol_start(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ipmi_tsol_command(i8* %0, i8* %1, i32 %2, i32 6)
ret i32 %4
}
void *_Locale_ctype_create(const char *__DUMMY_PAR,
                           struct _Locale_name_hint *hint) {
  return 0;
}


x86 assembly (clang, -O0):
<_Locale_ctype_create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._Locale_name_hint = type opaque
define i8* @_Locale_ctype_create(i8* %0, %struct._Locale_name_hint* %1) {
%3 = alloca i8*
%4 = alloca %struct._Locale_name_hint*
store i8* %0, i8** %3
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %4
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
define noalias i8* @_Locale_ctype_create(i8* nocapture readnone %0, %struct._Locale_name_hint* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
size_t varint_size(uint8_t const *const data) { return (data[0] >> 4) + 1; }


x86 assembly (clang, -O0):
<varint_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x4,%eax
add    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<varint_size>:
mov    (%rdi),%eax
sar    $0x4,%eax
add    $0x1,%eax
cltq
ret

LLVM IR (-O0):
define i64 @varint_size(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = ashr i32 %5, 4
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @varint_size(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 4
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void volatile_fetch_add_u16(uint16_t *dest, uint16_t val) {
  *((volatile uint16_t *)dest) += val;
}


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

x86 assembly (clang, -O2):
<volatile_fetch_add_u16>:
add    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @volatile_fetch_add_u16(i64* %0, i64 %1) {
%3 = load volatile i64, i64* %0
%4 = add nsw i64 %3, %1
store volatile i64 %4, i64* %0
ret void
}