xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int hash_function(const char *str, size_t htable_size) {
  size_t h = 0;
  unsigned char *p;
  for (p = (unsigned char *)str; *p != '\0'; p++)
    h = 31 * h + *p;
  return h % htable_size;
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <hash_function+0x50>
imul   $0x1f,-0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <hash_function+0x1c>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_function>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash_function+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_function+0x10>
jmp    112f <hash_function+0x2f>
xor    %eax,%eax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1144 <hash_function+0x44>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash_function(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
%7 = load i8*, i8** %3
store i8* %7, i8** %6
br label %8
8: ; preds = %20, %2
%9 = load i8*, i8** %6
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = load i64, i64* %5
%15 = mul i64 31, %14
%16 = load i8*, i8** %6
%17 = load i8, i8* %16
%18 = zext i8 %17 to i64
%19 = add i64 %15, %18
store i64 %19, i64* %5
br label %20
20: ; preds = %13
%21 = load i8*, i8** %6
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %6
br label %8
23: ; preds = %8
%24 = load i64, i64* %5
%25 = load i64, i64* %4
%26 = urem i64 %24, %25
%27 = trunc i64 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @hash_function(i8* nocapture %0, i64 %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 i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i64 [ %11, %5 ], [ 0, %2 ]
%9 = mul i64 %8, 31
%10 = zext i8 %6 to i64
%11 = add i64 %9, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %11, %5 ]
%17 = urem i64 %16, %1
%18 = trunc i64 %17 to i32
ret i32 %18
}
int __attribute__((no)) f1(int i) {
  char a[i + 1];
  a[0] = 5;
  return a[0];
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movb   $0x5,(%rax)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 5, i8* %10
%11 = getelementptr inbounds i8, i8* %9, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
ret i32 5
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ TIME_UTC;
int /*<<< orphan*/ timespec_get(struct timespec *, int /*<<< orphan*/);
unsigned int get_timer_ms(void) {
  struct timespec tv;
  timespec_get(&tv, TIME_UTC);
  return tv.tv_sec * 1000 + tv.tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<get_timer_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdi
call   1030 <timespec_get@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timer_ms>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
call   1030 <timespec_get@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@TIME_UTC = global i32 0
define i32 @get_timer_ms() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @TIME_UTC
%3 = call i32 @timespec_get(%struct.timespec* %1, i32 %2)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@TIME_UTC = global i32 0
define i32 @get_timer_ms() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @TIME_UTC
%4 = call i32 @timespec_get(%struct.timespec* %1, i32 %3)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %10, %7
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((destructor)) libtest1_dtor(void) {
  printf("libtest1: destructor!\n");
}


x86 assembly (clang, -O0):
<libtest1_dtor>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"libtest1: destructor!\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libtest1_dtor, i8* null }]
define void @libtest1_dtor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libtest1_dtor, i8* null }]
@str = [22 x i8] c"libtest1: destructor!\00"
define void @libtest1_dtor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
int isascii(int ch) { return ((unsigned int)ch < 128u); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 128
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ printf(char *);
main() {
  int i = 4;
  if (i > 5)
    printf("Hi");
  else
    f(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
jmp    1159 <main+0x39>
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"Hi\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 5
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @f(i32 %8)
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int scanf(char *, int *);
int /*<<< orphan*/ stderr;
void checkInput(int *N) {
  if ((scanf("%d", N)) != 1) {
    fprintf(stderr, "Wrong input values!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1178 <checkInput+0x48>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInput>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1147 <checkInput+0x17>
pop    %rax
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
int llmnr_init(struct endpoint *ep) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.endpoint = type opaque
define i32 @llmnr_init(%struct.endpoint* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
size_t hash(char *key, size_t size) {
  size_t hash = 0xbabe;
  size_t ch;
  while (0 != (ch = (size_t)*key++))
    hash = hash * 131 + ch;
  return hash % size;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xbabe,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq (%rax),%rcx
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     114b <hash+0x4b>
imul   $0x83,-0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <hash+0x14>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <hash+0x2b>
add    $0x1,%rdi
mov    $0xbabe,%eax
nop
movsbq %cl,%rcx
imul   $0x83,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
jmp    1130 <hash+0x30>
mov    $0xbabe,%eax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1145 <hash+0x45>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0, i64 %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 i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i64 [ %12, %5 ], [ 47806, %2 ]
%9 = sext i8 %6 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = mul i64 %8, 131
%12 = add i64 %11, %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 47806, %2 ], [ %12, %5 ]
%17 = urem i64 %16, %1
ret i64 %17
}
cu(char *q) { return *q ? cu(q + 1) & 1 ? q[0]++ : q[0]-- : 1; }


x86 assembly (clang, -O0):
<cu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117b <cu+0x6b>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <cu@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     115d <cu+0x4d>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%al
mov    %al,%dl
add    $0x1,%dl
mov    %dl,(%rcx)
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1170 <cu+0x60>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%al
mov    %al,%dl
add    $0xff,%dl
mov    %dl,(%rcx)
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1188 <cu+0x78>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1188 <cu+0x78>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cu>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1136 <cu+0x26>
mov    %rdi,%rbx
add    $0x1,%rdi
call   1030 <cu@plt>
and    $0x1,%eax
cmp    $0x1,%eax
sbb    %ecx,%ecx
movsbl (%rbx),%eax
or     $0x1,%cl
add    %al,%cl
mov    %cl,(%rbx)
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cu(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %27
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = call i32 @cu(i8* %9)
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %7
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = add i8 %16, 1
store i8 %17, i8* %15
%18 = sext i8 %16 to i32
br label %25
19: ; preds = %7
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = add i8 %22, -1
store i8 %23, i8* %21
%24 = sext i8 %22 to i32
br label %25
25: ; preds = %19, %13
%26 = phi i32 [ %18, %13 ], [ %24, %19 ]
br label %28
27: ; preds = %1
br label %28
28: ; preds = %27, %25
%29 = phi i32 [ %26, %25 ], [ 1, %27 ]
ret i32 %29
}

LLVM IR (-O2):
define i32 @cu(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @cu(i8* %5)
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = load i8, i8* %0
%10 = select i1 %8, i8 -1, i8 1
%11 = add i8 %9, %10
store i8 %11, i8* %0
%12 = sext i8 %9 to i32
br label %13
13: ; preds = %4, %1
%14 = phi i32 [ 1, %1 ], [ %12, %4 ]
ret i32 %14
}
unsigned int o(unsigned int a, unsigned int b) { return b >> 15; }


x86 assembly (clang, -O0):
<o>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<o>:
mov    %esi,%eax
shr    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @o(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 = lshr i32 %5, 15
ret i32 %6
}

LLVM IR (-O2):
define i32 @o(i32 %0, i32 %1) {
%3 = lshr i32 %1, 15
ret i32 %3
}
void ns2_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ns2_init() {
ret void
}
/* Variables and functions */
long atol(char *);
char *getenv(char const *);
int getenv_long(const char *v, long *y) {
  char *x = getenv(v);
  if (!x)
    return 0;
  *y = atol(x);
  return 1;
}


x86 assembly (clang, -O0):
<getenv_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <getenv_long+0x34>
movl   $0x0,-0x4(%rbp)
jmp    116e <getenv_long+0x4e>
mov    -0x20(%rbp),%rdi
call   1040 <atol@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_long>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1140 <getenv_long+0x20>
mov    %rax,%rdi
call   1040 <atol@plt>
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getenv_long(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i64 @atol(i8* %3)
store i64 %6, i64* %1
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteChar(char);
int /*<<< orphan*/ print_word(unsigned short);
void print_address(unsigned short int high, unsigned short int low) {
  print_word(high);
  print_word(low);
  LCD_WriteChar(' ');
}


x86 assembly (clang, -O0):
<print_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <print_word@plt>
movzwl -0x4(%rbp),%edi
call   1030 <print_word@plt>
mov    $0x20,%edi
call   1040 <LCD_WriteChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_address>:
push   %rbx
mov    %esi,%ebx
call   1030 <print_word@plt>
mov    %ebx,%edi
call   1030 <print_word@plt>
mov    $0x20,%edi
pop    %rbx
jmp    1040 <LCD_WriteChar@plt>

LLVM IR (-O0):
define void @print_address(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = call i32 @print_word(i16 zeroext %5)
%7 = load i16, i16* %4
%8 = call i32 @print_word(i16 zeroext %7)
%9 = call i32 @LCD_WriteChar(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @print_address(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @print_word(i16 zeroext %0)
%4 = tail call i32 @print_word(i16 zeroext %1)
%5 = tail call i32 @LCD_WriteChar(i8 signext 32)
ret void
}
int do_581() { return 581; }


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

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

LLVM IR (-O0):
define i32 @do_581() {
ret i32 581
}

LLVM IR (-O2):
define i32 @do_581() {
ret i32 581
}
/* Variables and functions */
scalar_t__ isalpha(char);
int netcsv_is_header(char *s) {
  if (isalpha(s[0]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<netcsv_is_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     113e <netcsv_is_header+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <netcsv_is_header+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netcsv_is_header>:
push   %rax
movsbl (%rdi),%edi
call   1030 <isalpha@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @netcsv_is_header(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = call i64 @isalpha(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @netcsv_is_header(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isalpha(i8 signext %2)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
struct TreeLinkNode *str2TreeLink(char *line, char *sep) {}


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

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

LLVM IR (-O0):
%struct.TreeLinkNode = type opaque
define %struct.TreeLinkNode* @str2TreeLink(i8* %0, i8* %1) {
%3 = alloca %struct.TreeLinkNode*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load %struct.TreeLinkNode*, %struct.TreeLinkNode** %3
ret %struct.TreeLinkNode* %6
}

LLVM IR (-O2):
%struct.TreeLinkNode = type opaque
define noalias %struct.TreeLinkNode* @str2TreeLink(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret %struct.TreeLinkNode* undef
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, int);
int /*<<< orphan*/ VIM_USER_DelayMs(int);
void VIM_LCDIF_ResetPanel(void) {
  VIM_HIF_SetReg8((0x0400 + 0x010), 0x0);
  VIM_USER_DelayMs(100);
  VIM_HIF_SetReg8((0x0400 + 0x010), 1);
  VIM_USER_DelayMs(20);
}


x86 assembly (clang, -O0):
<VIM_LCDIF_ResetPanel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x410,%edi
xor    %esi,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    $0x64,%edi
call   1040 <VIM_USER_DelayMs@plt>
mov    $0x410,%edi
mov    $0x1,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    $0x14,%edi
call   1040 <VIM_USER_DelayMs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_LCDIF_ResetPanel>:
push   %rax
mov    $0x410,%edi
xor    %esi,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    $0x64,%edi
call   1040 <VIM_USER_DelayMs@plt>
mov    $0x410,%edi
mov    $0x1,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    $0x14,%edi
pop    %rax
jmp    1040 <VIM_USER_DelayMs@plt>

LLVM IR (-O0):
define void @VIM_LCDIF_ResetPanel() {
%1 = call i32 @VIM_HIF_SetReg8(i32 1040, i32 0)
%2 = call i32 @VIM_USER_DelayMs(i32 100)
%3 = call i32 @VIM_HIF_SetReg8(i32 1040, i32 1)
%4 = call i32 @VIM_USER_DelayMs(i32 20)
ret void
}

LLVM IR (-O2):
define void @VIM_LCDIF_ResetPanel() {
%1 = tail call i32 @VIM_HIF_SetReg8(i32 1040, i32 0)
%2 = tail call i32 @VIM_USER_DelayMs(i32 100)
%3 = tail call i32 @VIM_HIF_SetReg8(i32 1040, i32 1)
%4 = tail call i32 @VIM_USER_DelayMs(i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(scalar_t__);
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) { return strcpy(malloc(strlen(s) + 1), s); }


x86 assembly (clang, -O0):
<strdup>:
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   1050 <malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @malloc(i64 %5)
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @malloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: cal [-jy] [[month] year]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"usage: cal [-jy] [[month] year]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage: cal [-jy] [[month] year]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ glutSpaceballMotionFunc(void (*)(int, int, int));
void s2winSpaceballMotionFunc(void (*func)(int x, int y, int z)) {
  glutSpaceballMotionFunc(func);
}


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

x86 assembly (clang, -O2):
<s2winSpaceballMotionFunc>:
jmp    1030 <glutSpaceballMotionFunc@plt>

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

LLVM IR (-O2):
define void @s2winSpaceballMotionFunc(void (i32, i32, i32)* %0) {
%2 = tail call i32 @glutSpaceballMotionFunc(void (i32, i32, i32)* %0)
ret void
}
void execute_command(const char *command) {}


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

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

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

LLVM IR (-O2):
define void @execute_command(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef float GLfloat;

/* Variables and functions */
scalar_t__ sqrt(float);
void Normalize2f(GLfloat *x, GLfloat *y) {
  GLfloat len;
  len = *x * *x + *y * *y;
  len = (float)sqrt((len));
  *x /= len;
  *y /= len;
}


x86 assembly (clang, -O0):
<Normalize2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Normalize2f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  (%rbx),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%rbx)
movss  (%r14),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @Normalize2f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = load float, float* %8
%10 = load float*, float** %4
%11 = load float, float* %10
%12 = load float*, float** %4
%13 = load float, float* %12
%14 = fmul float %11, %13
%15 = call float @llvm.fmuladd.f32(float %7, float %9, float %14)
store float %15, float* %5
%16 = load float, float* %5
%17 = call i64 @sqrt(float %16)
%18 = sitofp i64 %17 to float
store float %18, float* %5
%19 = load float, float* %5
%20 = load float*, float** %3
%21 = load float, float* %20
%22 = fdiv float %21, %19
store float %22, float* %20
%23 = load float, float* %5
%24 = load float*, float** %4
%25 = load float, float* %24
%26 = fdiv float %25, %23
store float %26, float* %24
ret void
}

LLVM IR (-O2):
define void @Normalize2f(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %3, float %3, float %5)
%7 = tail call i64 @sqrt(float %6)
%8 = sitofp i64 %7 to float
%9 = load float, float* %0
%10 = fdiv float %9, %8
store float %10, float* %0
%11 = load float, float* %1
%12 = fdiv float %11, %8
store float %12, float* %1
ret void
}
int main() { return sizeof(long int); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
int ModifyData() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ModifyData() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
void on_error(int err_code, const char *err_desc) {
  printf("bridge: %d-%s", err_code, err_desc);
}


x86 assembly (clang, -O0):
<on_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_error>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"bridge: %d-%s\00"
define void @on_error(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int syscall(int, int, int);
int inotify_rm_watch(int fd, int wd) { return syscall(318, fd, wd); }


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

x86 assembly (clang, -O2):
<inotify_rm_watch>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x13e,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @inotify_rm_watch(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 @syscall(i32 318, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @inotify_rm_watch(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 318, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gcall(char *);
gbool() { gcall("^bool"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"^bool\00"
define i32 @gbool() {
%1 = alloca i32
%2 = call i32 @gcall(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"^bool\00"
define i32 @gbool() {
%1 = tail call i32 @gcall(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int getc_unlocked(FILE *stream) { return getc(stream); }


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

x86 assembly (clang, -O2):
<getc_unlocked>:
jmp    1030 <getc@plt>

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

LLVM IR (-O2):
define i32 @getc_unlocked(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
ret i32 %2
}
unsigned long blong(const unsigned char *p) {
  unsigned long n;
  n = p[0];
  n = (n << 8) + p[1];
  n = (n << 8) + p[2];
  n = (n << 8) + p[3];
  return n;
}


x86 assembly (clang, -O0):
<blong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blong>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @blong(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = shl i64 %8, 8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = add i64 %9, %13
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = shl i64 %15, 8
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = zext i8 %19 to i64
%21 = add i64 %16, %20
store i64 %21, i64* %3
%22 = load i64, i64* %3
%23 = shl i64 %22, 8
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i64
%28 = add i64 %23, %27
store i64 %28, i64* %3
%29 = load i64, i64* %3
ret i64 %29
}

LLVM IR (-O2):
define i64 @blong(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %3, 16
%8 = shl nuw nsw i64 %6, 8
%9 = or i64 %8, %7
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = or i64 %9, %12
%14 = shl nuw nsw i64 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  long flags;
};
typedef TYPE_1__ XWMHints;

/* Variables and functions */
void set_XWMHints_flags(void *_p, long _v) {
  ((XWMHints *)_p)->flags = (long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XWMHints_flags(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void foo(const char *msg) { printf("%s\n", msg); }


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

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @foo(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void parameters_assert(int assertion, const char *error_message,
                       void (*print_usage)(void)) {
  if (!assertion) {
    fprintf(stderr, "%s\n", error_message);
    print_usage();
    exit(1);
  }
}


x86 assembly (clang, -O0):
<parameters_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1163 <parameters_assert+0x43>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
call   *-0x18(%rbp)
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parameters_assert>:
test   %edi,%edi
je     1125 <parameters_assert+0x5>
ret
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
call   *%rbx
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @parameters_assert(i32 %0, i8* %1, void ()* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca void ()*
store i32 %0, i32* %4
store i8* %1, i8** %5
store void ()* %2, void ()** %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %5
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load void ()*, void ()** %6
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @parameters_assert(i32 %0, i8* %1, void ()* nocapture %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
tail call void %2()
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int strcmp(char *const, char *const);
int cmpstrp(const void *a, const void *b) {
  return strcmp(*(char *const *)a, *(char *const *)b);
}


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

x86 assembly (clang, -O2):
<cmpstrp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmpstrp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmpstrp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int LZ4_compress_HC(char const *, char *, int, int, int /*<<< orphan*/);
int LZ4_compressHC_limitedOutput(const char *src, char *dst, int srcSize,
                                 int maxDstSize) {
  return LZ4_compress_HC(src, dst, srcSize, maxDstSize, 0);
}


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

x86 assembly (clang, -O2):
<LZ4_compressHC_limitedOutput>:
xor    %r8d,%r8d
jmp    1030 <LZ4_compress_HC@plt>

LLVM IR (-O0):
define i32 @LZ4_compressHC_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @LZ4_compress_HC(i8* %9, i8* %10, i32 %11, i32 %12, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @LZ4_compressHC_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @LZ4_compress_HC(i8* %0, i8* %1, i32 %2, i32 %3, i32 0)
ret i32 %5
}
/* Variables and functions */
long random();
long randValLong(long min, long max) {
  long val = random() % (max - min + 1) + min;
  return val;
}


x86 assembly (clang, -O0):
<randValLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    $0x1,%rcx
cqto
idiv   %rcx
add    -0x8(%rbp),%rdx
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randValLong>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <random@plt>
sub    %r14,%rbx
add    $0x1,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113e <randValLong+0x2e>
cqto
idiv   %rbx
mov    %rdx,%rax
jmp    1144 <randValLong+0x34>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @randValLong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = call i64 (...) @random()
%7 = load i64, i64* %4
%8 = load i64, i64* %3
%9 = sub nsw i64 %7, %8
%10 = add nsw i64 %9, 1
%11 = srem i64 %6, %10
%12 = load i64, i64* %3
%13 = add nsw i64 %11, %12
store i64 %13, i64* %5
%14 = load i64, i64* %5
ret i64 %14
}

LLVM IR (-O2):
define i64 @randValLong(i64 %0, i64 %1) {
%3 = tail call i64 (...) @random()
%4 = sub i64 1, %0
%5 = add i64 %4, %1
%6 = srem i64 %3, %5
%7 = add nsw i64 %6, %0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xc2() {
  Assert_real((isupper(194) == 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",
              975, ("isupper should be 0 for 0xc2"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xc2>:
push   %rax
mov    $0xc2,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3cf,%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 0xc2\00"
define void @t_isupper_0xc2() {
%1 = call i64 @isupper(i32 194)
%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 975, 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 0xc2\00"
define void @t_isupper_0xc2() {
%1 = tail call i64 @isupper(i32 194)
%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 975, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}