xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void __attribute__((noreturn)) usage(void) {
  fprintf(stdout, "Usage: ./usage [0...9] 0x[XX] [0 ... 255] \n");
  fprintf(stdout, "       1  -> adapter 1 (/dev/i2c-1)       \n");
  fprintf(stdout, "       0x20 -> i2c address 0x20           \n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xefa(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeed(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [44 x i8] c"Usage: ./usage [0...9] 0x[XX] [0 ... 255] \0A\00"
@.str.1 = [44 x i8] c" 1 -> adapter 1 (/dev/i2c-1) \0A\00"
@.str.2 = [44 x i8] c" 0x20 -> i2c address 0x20 \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [44 x i8] c"Usage: ./usage [0...9] 0x[XX] [0 ... 255] \0A\00"
@.str.1 = [44 x i8] c" 1 -> adapter 1 (/dev/i2c-1) \0A\00"
@.str.2 = [44 x i8] c" 0x20 -> i2c address 0x20 \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Type definitions */
struct section {
  int dummy;
};
struct rela {
  int dummy;
};

/* Variables and functions */
struct rela *find_rela_by_dest_range(struct section *, unsigned long, int);
struct rela *find_rela_by_dest(struct section *sec, unsigned long offset) {
  return find_rela_by_dest_range(sec, offset, 1);
}


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

x86 assembly (clang, -O2):
<find_rela_by_dest>:
mov    $0x1,%edx
jmp    1030 <find_rela_by_dest_range@plt>

LLVM IR (-O0):
%struct.rela = type { i32 }
%struct.section = type { i32 }
define %struct.rela* @find_rela_by_dest(%struct.section* %0, i64 %1) {
%3 = alloca %struct.section*
%4 = alloca i64
store %struct.section* %0, %struct.section** %3
store i64 %1, i64* %4
%5 = load %struct.section*, %struct.section** %3
%6 = load i64, i64* %4
%7 = call %struct.rela* @find_rela_by_dest_range(%struct.section* %5, i64 %6, i32 1)
ret %struct.rela* %7
}

LLVM IR (-O2):
%struct.rela = type { i32 }
%struct.section = type { i32 }
define %struct.rela* @find_rela_by_dest(%struct.section* %0, i64 %1) {
%3 = tail call %struct.rela* @find_rela_by_dest_range(%struct.section* %0, i64 %1, i32 1)
ret %struct.rela* %3
}
char *os_rel2abs_path(const char *rel_path) { return (0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @os_rel2abs_path(i8* nocapture readnone %0) {
ret i8* null
}
int irda_cleanup(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @irda_cleanup() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @irda_cleanup() {
ret i32 -1
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("%d", factorial(num));
  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   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1040 <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   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <factorial@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <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
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @factorial(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
}

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 @factorial(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
}
/* Variables and functions */
int rand();
void getRandomArray(int N, int *a) {
  for (int i = 0; i < N; i++)
    a[i] = rand() % 200 - 100;
}


x86 assembly (clang, -O0):
<getRandomArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115d <getRandomArray+0x4d>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xc8,%ecx
cltd
idiv   %ecx
sub    $0x64,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <getRandomArray+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomArray>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1167 <getRandomArray+0x57>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0xc8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffff9c,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <getRandomArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @getRandomArray(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 200
%11 = add nsw i32 %10, -100
%12 = getelementptr inbounds i32, i32* %1, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Type definitions */
struct instrument {
  int dummy;
};
typedef int /*<<< orphan*/ model;

/* Variables and functions */
int /*<<< orphan*/ inst_rdstr(struct instrument *, char *, int);
int /*<<< orphan*/ inst_wrtstr(struct instrument *, char *);
int /*<<< orphan*/ printf(char *, char *);
void _get_idn(struct instrument *gd) {
  char model[64];
  inst_wrtstr(gd, "ID?\n");
  inst_rdstr(gd, model, sizeof(model));
  printf("%s\n", model);
}


x86 assembly (clang, -O0):
<_get_idn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <inst_wrtstr@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x40,%edx
call   1050 <inst_rdstr@plt>
lea    -0x50(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_idn>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
call   1040 <inst_wrtstr@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x40,%edx
call   1050 <inst_rdstr@plt>
lea    0xea5(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.instrument = type { i32 }
@.str = [5 x i8] c"ID?\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @_get_idn(%struct.instrument* %0) {
%2 = alloca %struct.instrument*
%3 = alloca [64 x i8]
store %struct.instrument* %0, %struct.instrument** %2
%4 = load %struct.instrument*, %struct.instrument** %2
%5 = call i32 @inst_wrtstr(%struct.instrument* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.instrument*, %struct.instrument** %2
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @inst_rdstr(%struct.instrument* %6, i8* %7, i32 64)
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
%struct.instrument = type { i32 }
@.str = [5 x i8] c"ID?\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @_get_idn(%struct.instrument* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @inst_wrtstr(%struct.instrument* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @inst_rdstr(%struct.instrument* %0, i8* %3, i32 64)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MQTTyield(unsigned long);
int tpSDKYield(unsigned long timeout_ms) {
  MQTTyield(timeout_ms);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @tpSDKYield(i64 %0) {
%2 = tail call i32 @MQTTyield(i64 %0)
ret i32 0
}
/* Variables and functions */
size_t ALIGN_TO(size_t l, size_t ali) { return ((l + ali - 1) & ~(ali - 1)); }


x86 assembly (clang, -O0):
<ALIGN_TO>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ALIGN_TO>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @ALIGN_TO(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @ALIGN_TO(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
int leapyear(int year) {
  return !(year % 400) || (!(year % 4) && (year % 100));
}


x86 assembly (clang, -O0):
<leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
je     1153 <leapyear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <leapyear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapyear>:
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     1121 <leapyear+0x21>
xor    %eax,%eax
test   $0x3,%dil
je     1127 <leapyear+0x27>
ret
mov    $0x1,%eax
ret
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setae  %al
ret

LLVM IR (-O0):
define i32 @leapyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 400
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 4
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 100
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @leapyear(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 100
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int get_i();
int /*<<< orphan*/ put_i(int);
int /*<<< orphan*/ put_s(char *);
void main() {
  int x;
  put_s("x=");
  x = get_i();
  put_i(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <put_s@plt>
mov    $0x0,%al
call   1050 <get_i@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <put_i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <put_s@plt>
xor    %eax,%eax
call   1050 <get_i@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <put_i@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"x=\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @put_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @get_i()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @put_i(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"x=\00"
define void @main() {
%1 = tail call i32 @put_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @get_i()
%3 = tail call i32 @put_i(i32 %2)
ret void
}
char *quad_to_string(value)
unsigned long value;
{
  char *fmtstr;
  static char buf[64];
  fmtstr = "%llu";
  sprintf(buf, fmtstr, value);
  return buf;
}


x86 assembly (clang, -O0):
<quad_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0x2f0a(%rip),%rdi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2efc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quad_to_string>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@quad_to_string.buf = internal global [64 x i8] zeroinitializer
@.str = [5 x i8] c"%llu\00"
define i8* @quad_to_string(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i64, i64* %2
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @quad_to_string.buf, i64 0, i64 0), i8* %4, i64 %5)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @quad_to_string.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@quad_to_string.buf = internal global [64 x i8] zeroinitializer
@.str = [5 x i8] c"%llu\00"
define i8* @quad_to_string(i64 %0) {
%2 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @quad_to_string.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @quad_to_string.buf, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glFogiv(int /*<<< orphan*/, int /*<<< orphan*/ *);
void Fogiv(GLenum pname, GLint *params) { glFogiv(pname, params); }


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

x86 assembly (clang, -O2):
<Fogiv>:
jmp    1030 <glFogiv@plt>

LLVM IR (-O0):
define void @Fogiv(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 @glFogiv(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @Fogiv(i32 %0, i32* %1) {
%3 = tail call i32 @glFogiv(i32 %0, i32* %1)
ret void
}
double builtin_fma(double b, double c, double d) {
  return __builtin_fma(b, c, d);
}


x86 assembly (clang, -O0):
<builtin_fma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <fma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_fma>:
jmp    1030 <fma@plt>

LLVM IR (-O0):
define double @builtin_fma(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fma.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @builtin_fma(double %0, double %1, double %2) {
%4 = tail call double @llvm.fma.f64(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void critical1(void) {
#pragma omp parallel
  {
    printf("All threads run this\n");
#pragma omp sections
    {
#pragma omp section
      { printf("This executes in parallel\n"); }
#pragma omp section
      {
        printf("Sequential statement 1\n");
        printf("This always executes after statement 1\n");
      }
#pragma omp section
      { printf("This also executes in parallel\n"); }
    }
  }
}


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

x86 assembly (clang, -O2):
<critical1>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf25(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"All threads run this\0A\00"
@.str.1 = [27 x i8] c"This executes in parallel\0A\00"
@.str.2 = [24 x i8] c"Sequential statement 1\0A\00"
@.str.3 = [40 x i8] c"This always executes after statement 1\0A\00"
@.str.4 = [32 x i8] c"This also executes in parallel\0A\00"
define void @critical1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"All threads run this\00"
@str.5 = [26 x i8] c"This executes in parallel\00"
@str.6 = [23 x i8] c"Sequential statement 1\00"
@str.7 = [39 x i8] c"This always executes after statement 1\00"
@str.8 = [31 x i8] c"This also executes in parallel\00"
define void @critical1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ read_line();
int main(void) {
  read_line();
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @read_line()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
void foo441() {}


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

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

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

LLVM IR (-O2):
define void @foo441() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addUser(char const *);
void do_register(const char *name) { addUser(name); }


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

x86 assembly (clang, -O2):
<do_register>:
jmp    1030 <addUser@plt>

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

LLVM IR (-O2):
define void @do_register(i8* %0) {
%2 = tail call i32 @addUser(i8* %0)
ret void
}
int check_passwd(unit, auser, userlen, apasswd, passwdlen, msg)
int unit;
char *auser;
int userlen;
char *apasswd;
int passwdlen;
char **msg;
{ return 3; }


x86 assembly (clang, -O0):
<check_passwd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @check_passwd(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8**
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8** %5, i8*** %12
ret i32 3
}

LLVM IR (-O2):
define i32 @check_passwd(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4, i8** nocapture readnone %5) {
ret i32 3
}
unsigned int ELMModuleResetStatusGet(unsigned int baseAddr) {
  unsigned int resetStat;
  resetStat =
      ((*((volatile unsigned int *)(baseAddr + (0x14)))) & (0x00000001u));
  return (resetStat);
}


x86 assembly (clang, -O0):
<ELMModuleResetStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ELMModuleResetStatusGet>:
add    $0x14,%edi
mov    (%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ELMModuleResetStatusGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 20
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @ELMModuleResetStatusGet(i32 %0) {
%2 = add i32 %0, 20
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 1
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void adv_delaym(uint32_t interval) { usleep(interval * 1000); }


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

x86 assembly (clang, -O2):
<adv_delaym>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @adv_delaym(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @adv_delaym(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mill_yield(char *);
void worker(long count) {
  long i;
  for (i = 0; i != count; ++i)
    mill_yield("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/8l/libmill/refs/heads/master/"
               "perf/ctxswitch.c"
               ":"
               "36");
}


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     114f <worker+0x3f>
lea    0xec7(%rip),%rdi
call   1030 <mill_yield@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <worker+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     113e <worker+0x2e>
mov    %rdi,%rbx
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <mill_yield@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <worker+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/libmill/refs/heads/master/perf/ctxswitch.c:36\00"
define void @worker(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @mill_yield(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i64, i64* %3
%12 = add nsw i64 %11, 1
store i64 %12, i64* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/libmill/refs/heads/master/perf/ctxswitch.c:36\00"
define void @worker(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @mill_yield(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
float __attribute((unit("a")))
explicit_cast_repr_1(int __attribute((unit("a"))) a) {
  return (float)a;
}


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

x86 assembly (clang, -O2):
<explicit_cast_repr_1>:
cvtsi2ss %edi,%xmm0
ret

LLVM IR (-O0):
define float @explicit_cast_repr_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
ret float %4
}

LLVM IR (-O2):
define float @explicit_cast_repr_1(i32 %0) {
%2 = sitofp i32 %0 to float
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
FILE *openFileToWrite(const char *name) {
  FILE *file = fopen(name, "w");
  if (!file)
    fprintf(stderr, "Problem with file '%s' during opening to write.\n", name);
  return file;
}


x86 assembly (clang, -O0):
<openFileToWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <openFileToWrite+0x44>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFileToWrite>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <openFileToWrite+0x33>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.1 = [49 x i8] c"Problem with file '%s' during opening to write.\0A\00"
define i32* @openFileToWrite(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %1
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.1 = [49 x i8] c"Problem with file '%s' during opening to write.\0A\00"
define noalias i32* @openFileToWrite(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %1
ret i32* %2
}
int main(void) {
  f(f, 3);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32 (...)*, i32, ...) bitcast (i32 (...)* @f to i32 (i32 (...)*, i32, ...)*)(i32 (...)* @f, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void _dbxfMemFail(char *dst) { (void)strcpy(dst, "Memory allocation failure"); }


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

x86 assembly (clang, -O2):
<_dbxfMemFail>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Memory allocation failure\00"
define void @_dbxfMemFail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Memory allocation failure\00"
define void @_dbxfMemFail(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
void OSTaskSwHook(void) {}


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

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

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

LLVM IR (-O2):
define void @OSTaskSwHook() {
ret void
}
long num_hex_digits(long n) {
  if (!n)
    return 1;
  long ret = 0;
  for (; n; n >>= 4) {
    ++ret;
  }
  return ret;
}


x86 assembly (clang, -O0):
<num_hex_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <num_hex_digits+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1158 <num_hex_digits+0x58>
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <num_hex_digits+0x50>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1128 <num_hex_digits+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_hex_digits>:
test   %rdi,%rdi
je     1122 <num_hex_digits+0x22>
xor    %eax,%eax
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
sar    $0x4,%rcx
cmp    $0xf,%rdi
mov    %rcx,%rdi
ja     1110 <num_hex_digits+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @num_hex_digits(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i64 1, i64* %2
br label %20
8: ; preds = %1
store i64 0, i64* %4
br label %9
9: ; preds = %15, %8
%10 = load i64, i64* %3
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i64, i64* %4
%14 = add nsw i64 %13, 1
store i64 %14, i64* %4
br label %15
15: ; preds = %12
%16 = load i64, i64* %3
%17 = ashr i64 %16, 4
store i64 %17, i64* %3
br label %9
18: ; preds = %9
%19 = load i64, i64* %4
store i64 %19, i64* %2
br label %20
20: ; preds = %18, %7
%21 = load i64, i64* %2
ret i64 %21
}

LLVM IR (-O2):
define i64 @num_hex_digits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i64 %4, 1
%7 = ashr i64 %5, 4
%8 = icmp ult i64 %5, 16
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %6, %3 ]
ret i64 %10
}
void foo806() {}


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

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

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

LLVM IR (-O2):
define void @foo806() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t HibernateRTCGet(void) {
  return ((*((volatile unsigned long *)(0x400FC000))));
}


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

x86 assembly (clang, -O2):
<HibernateRTCGet>:
mov    0x400fc000,%rax
40
ret

LLVM IR (-O0):
define i64 @HibernateRTCGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774016 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @HibernateRTCGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774016 to i64*)
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
pid_t wait(int *status) { return waitpid(-1, status, 0); }


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xffffffff,%edi
xor    %edx,%edx
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
mov    %rdi,%rsi
mov    $0xffffffff,%edi
xor    %edx,%edx
jmp    1030 <waitpid@plt>

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

LLVM IR (-O2):
define i32 @wait(i32* %0) {
%2 = tail call i32 @waitpid(i32 -1, i32* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(size_t);
void *twopence_malloc(size_t size) {
  void *p;
  if (size == 0)
    return NULL;
  p = malloc(size);
  do {
    assert(p);
    return p;
  } while (0);
}


x86 assembly (clang, -O0):
<twopence_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <twopence_malloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1162 <twopence_malloc+0x42>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twopence_malloc>:
push   %rbx
test   %rdi,%rdi
je     1138 <twopence_malloc+0x18>
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
jmp    113a <twopence_malloc+0x1a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @twopence_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = tail call i32 @assert(i8* %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
double slp_dtime();
double sl_dtime(void) { return slp_dtime(); }


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

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

LLVM IR (-O0):
define double @sl_dtime() {
%1 = call double (...) @slp_dtime()
ret double %1
}

LLVM IR (-O2):
define double @sl_dtime() {
%1 = tail call double (...) @slp_dtime()
ret double %1
}
/* Variables and functions */
__attribute__((visibility("default"))) const char *
sd_bus_track_contains(void *track, const char *name) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @sd_bus_track_contains(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sd_bus_track_contains(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
unsigned long long __blsr_u64(unsigned long long);
unsigned long long test__blsr_u64(unsigned long long __X) {
  return __blsr_u64(__X);
}


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

x86 assembly (clang, -O2):
<test__blsr_u64>:
jmp    1030 <__blsr_u64@plt>

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

LLVM IR (-O2):
define i64 @test__blsr_u64(i64 %0) {
%2 = tail call i64 @__blsr_u64(i64 %0)
ret i64 %2
}
int main() {
  int x = 1;
  while (1) {
    x = 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
jmp    1112 <main+0x12>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %0, %3
store i32 1, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
int DefMock_listen(int socket, int backlog) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DefMock_listen(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(int *);
void Free(void **item) {
  int *p = (int *)*item - 2;
  if (*item != NULL) {
    assert(p[0] == 0x42);
    p[0] = 0;
    ;
    free(p);
    ;
    *item = NULL;
  }
}


x86 assembly (clang, -O0):
<Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     117b <Free+0x5b>
mov    -0x10(%rbp),%rax
cmpl   $0x42,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Free>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
test   %rbx,%rbx
je     1156 <Free+0x36>
mov    %rdi,%r14
add    $0xfffffffffffffff8,%rbx
xor    %edi,%edi
cmpl   $0x42,(%rbx)
sete   %dil
call   1040 <assert@plt>
movl   $0x0,(%rbx)
mov    %rbx,%rdi
call   1030 <free@plt>
movq   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @Free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 -8
%4 = bitcast i8* %3 to i32*
%5 = icmp eq i8* %2, null
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 66
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
store i32 0, i32* %4
%11 = tail call i32 @free(i32* %4)
store i8* null, i8** %0
br label %12
12: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ quote_calc4_parse();
int /*<<< orphan*/ stdin;
int main(void) {
  while (!feof(stdin)) {
    quote_calc4_parse();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1152 <main+0x32>
jmp    115e <main+0x3e>
mov    $0x0,%al
call   1040 <quote_calc4_parse@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1030 <feof@plt>
test   %eax,%eax
jne    1144 <main+0x24>
xor    %eax,%eax
call   1040 <quote_calc4_parse@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* @stdin
%4 = call i32 @feof(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @quote_calc4_parse()
br label %2
9: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @feof(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = tail call i32 (...) @quote_calc4_parse()
%6 = load i32, i32* @stdin
%7 = tail call i32 @feof(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %0
ret i32 0
}
void zzz() {}


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

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

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

LLVM IR (-O2):
define void @zzz() {
ret void
}
void mwi_activate_encode_cb(void *data) { return; }


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

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

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

LLVM IR (-O2):
define void @mwi_activate_encode_cb(i8* nocapture %0) {
ret void
}