xunge/DecIR huggingface dataset:
/* Variables and functions */
int digitalRead(int);
int /*<<< orphan*/ exit(int);
int init();
int /*<<< orphan*/ pi_sleep(int);
int /*<<< orphan*/ pinMode(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int dval;
  if (init() == -1)
    exit(1);
  pinMode(4, 0);
  while (1) {
    dval = digitalRead(2);
    printf("Digital read %d\n", dval);
    pi_sleep(50);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
cmp    $0xffffffff,%eax
jne    1189 <main+0x29>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <pinMode@plt>
mov    $0x2,%edi
call   1030 <digitalRead@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe54(%rip),%rdi
call   1040 <printf@plt>
mov    $0x32,%edi
call   1050 <pi_sleep@plt>
jmp    1195 <main+0x35>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <init@plt>
cmp    $0xffffffff,%eax
je     11a0 <main+0x40>
mov    $0x4,%edi
xor    %esi,%esi
call   1070 <pinMode@plt>
lea    0xe80(%rip),%rbx
mov    $0x2,%edi
call   1030 <digitalRead@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x32,%edi
call   1050 <pi_sleep@plt>
jmp    1180 <main+0x20>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Digital read %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @init()
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = call i32 @pinMode(i32 4, i32 0)
br label %9
9: ; preds = %7, %9
%10 = call i32 @digitalRead(i32 2)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @pi_sleep(i32 50)
br label %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"Digital read %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %0
%6 = tail call i32 @pinMode(i32 4, i32 0)
br label %7
7: ; preds = %7, %5
%8 = tail call i32 @digitalRead(i32 2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i32 @pi_sleep(i32 50)
br label %7
}
void not_annotated_main1() {}


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

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

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

LLVM IR (-O2):
define void @not_annotated_main1() {
ret void
}
void gu1_delay_microseconds(unsigned long microseconds) {
  unsigned long loop_count = microseconds * 150;
  while (loop_count-- > 0) {
    ;
  }
}


x86 assembly (clang, -O0):
<gu1_delay_microseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x96,-0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    1132 <gu1_delay_microseconds+0x32>
jmp    1114 <gu1_delay_microseconds+0x14>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gu1_delay_microseconds(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 150
store i64 %5, i64* %3
br label %6
6: ; preds = %10, %1
%7 = load i64, i64* %3
%8 = add i64 %7, -1
store i64 %8, i64* %3
%9 = icmp ugt i64 %7, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

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

/* Variables and functions */
int pthread_mutex_destroy(pthread_mutex_t *mutex) {}


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_destroy(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
char *clean_word(char *);
char *strcatrealloc(char *, char *, int);
char *set_word(char *word, char *str, int size) {
  if ((word = strcatrealloc(word, str, size)) == NULL)
    return (NULL);
  if ((word = clean_word(word)) == NULL)
    return (NULL);
  return (word);
}


x86 assembly (clang, -O0):
<set_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strcatrealloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115e <set_word+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    118a <set_word+0x6a>
mov    -0x10(%rbp),%rdi
call   1040 <clean_word@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1182 <set_word+0x62>
movq   $0x0,-0x8(%rbp)
jmp    118a <set_word+0x6a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_word>:
push   %rax
call   1030 <strcatrealloc@plt>
test   %rax,%rax
je     1134 <set_word+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <clean_word@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @set_word(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = call i8* @strcatrealloc(i8* %8, i8* %9, i32 %10)
store i8* %11, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
store i8* null, i8** %4
br label %21
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = call i8* @clean_word(i8* %15)
store i8* %16, i8** %5
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %19
18: ; preds = %14
store i8* null, i8** %4
br label %21
19: ; preds = %14
%20 = load i8*, i8** %5
store i8* %20, i8** %4
br label %21
21: ; preds = %19, %18, %13
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @set_word(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @strcatrealloc(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @clean_word(i8* %4)
br label %8
8: ; preds = %6, %3
%9 = phi i8* [ null, %3 ], [ %7, %6 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sw_volume_multiply() {
  printf("NOT IMPLEMENTED:"
         "pa_sw_volume_multiply"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_sw_volume_multiply\00"
define i32 @pa_sw_volume_multiply() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_byte(int);
int /*<<< orphan*/ output_modrm(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ output_sib(int /*<<< orphan*/, int, int);
void emit_fnstcw_stack(void) {
  assem_debug("fnstcw (%%esp)");
  output_byte(0xd9);
  output_modrm(0, 4, 7);
  output_sib(0, 4, 4);
}


x86 assembly (clang, -O0):
<emit_fnstcw_stack>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x7,%edx
call   1050 <output_modrm@plt>
xor    %edi,%edi
mov    $0x4,%edx
mov    %edx,%esi
call   1060 <output_sib@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fnstcw_stack>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x7,%edx
call   1050 <output_modrm@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x4,%edx
pop    %rax
jmp    1060 <output_sib@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fnstcw (%%esp)\00"
define void @emit_fnstcw_stack() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 217)
%3 = call i32 @output_modrm(i32 0, i32 4, i32 7)
%4 = call i32 @output_sib(i32 0, i32 4, i32 4)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fnstcw (%%esp)\00"
define void @emit_fnstcw_stack() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 217)
%3 = tail call i32 @output_modrm(i32 0, i32 4, i32 7)
%4 = tail call i32 @output_sib(i32 0, i32 4, i32 4)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int offtin(unsigned char *);
int /*<<< orphan*/ valid_header(unsigned char *);
ssize_t bspatch_newsize(unsigned char *patch) {
  if (!valid_header(patch))
    return -1;
  return offtin(patch + 24);
}


x86 assembly (clang, -O0):
<bspatch_newsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <valid_header@plt>
cmp    $0x0,%eax
jne    114a <bspatch_newsize+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <bspatch_newsize+0x3a>
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
call   1040 <offtin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bspatch_newsize>:
push   %rbx
mov    %rdi,%rbx
call   1030 <valid_header@plt>
test   %eax,%eax
je     113a <bspatch_newsize+0x1a>
add    $0x18,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <offtin@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bspatch_newsize(i8* %0) {
%2 = tail call i32 @valid_header(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 24
%6 = tail call i32 @offtin(i8* %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badformat() {
  fprintf(stderr, "pummel.bad.format\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badformat>:
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):
<badformat>:
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 = [19 x i8] c"pummel.bad.format\0A\00"
define void @badformat() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"pummel.bad.format\0A\00"
define void @badformat() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int speczero(struct timespec *ts) {
  return (ts->tv_sec == 0 && ts->tv_nsec == 0);
}


x86 assembly (clang, -O0):
<speczero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
jne    112a <speczero+0x2a>
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<speczero>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
je     1109 <speczero+0x9>
ret
xor    %eax,%eax
cmpq   $0x0,0x8(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @speczero(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @speczero(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ resetHardA7GPSModule(int);
void startRecoveryForA7ReceiveDataFailed(int n) { resetHardA7GPSModule(n); }


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

x86 assembly (clang, -O2):
<startRecoveryForA7ReceiveDataFailed>:
jmp    1030 <resetHardA7GPSModule@plt>

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

LLVM IR (-O2):
define void @startRecoveryForA7ReceiveDataFailed(i32 %0) {
%2 = tail call i32 @resetHardA7GPSModule(i32 %0)
ret void
}
float schlick_phase_func(float mu) {
  return (1. - (1.55 * (.2) - 0.55 * ((.2) * (.2) * (.2))) *
                   (1.55 * (.2) - 0.55 * ((.2) * (.2) * (.2)))) /
         (4. * 3.14159265359 *
          (1. + (1.55 * (.2) - 0.55 * ((.2) * (.2) * (.2))) * mu) *
          (1. + (1.55 * (.2) - 0.55 * ((.2) * (.2) * (.2))) * mu));
}


x86 assembly (clang, -O0):
<schlick_phase_func>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec1(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xebd(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<schlick_phase_func>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeec(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @schlick_phase_func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double 0x3FD38EF34D6A161F, double %4, double 1.000000e+00)
%6 = fmul double 0x402921FB54442EEA, %5
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = call double @llvm.fmuladd.f64(double 0x3FD38EF34D6A161F, double %8, double 1.000000e+00)
%10 = fmul double %6, %9
%11 = fdiv double 0x3FED02F01F6245F0, %10
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @schlick_phase_func(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FD38EF34D6A161F, double 1.000000e+00)
%4 = fmul double %3, 0x402921FB54442EEA
%5 = fmul double %3, %4
%6 = fdiv double 0x3FED02F01F6245F0, %5
%7 = fptrunc double %6 to float
ret float %7
}
int func3_in_obj() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func3_in_obj() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x2f() {
  Assert_real((isodigit(47) == 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_isodigit.c",
              240, ("isodigit should be 0 for /"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for /\00"
define void @t_isodigit_0x2f() {
%1 = tail call i64 @isodigit(i32 47)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 240, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void f2() {
  int *p = malloc(12);
  free(p);
  free(p);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f2() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @free(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_command(int, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ send_command();
int wait_for_ack(int, int);
int camera_snapshot(int type, int skip) {
  create_command(0x05, type, skip & 0xff, (skip >> 8), 0);
  send_command();
  int result = wait_for_ack(100000, 0x05);
  printf("camera_snapshot %d result=%d\n", 502, result);
  return result;
}


x86 assembly (clang, -O0):
<camera_snapshot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
and    $0xff,%edx
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
mov    $0x5,%edi
xor    %r8d,%r8d
call   1060 <create_command@plt>
mov    $0x0,%al
call   1050 <send_command@plt>
mov    $0x186a0,%edi
mov    $0x5,%esi
call   1040 <wait_for_ack@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    0xe70(%rip),%rdi
mov    $0x1f6,%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<camera_snapshot>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%esi
movzbl %cl,%edx
sar    $0x8,%ecx
mov    $0x5,%edi
xor    %r8d,%r8d
call   1060 <create_command@plt>
xor    %eax,%eax
call   1050 <send_command@plt>
mov    $0x186a0,%edi
mov    $0x5,%esi
call   1040 <wait_for_ack@plt>
mov    %eax,%ebx
lea    0xe89(%rip),%rdi
mov    $0x1f6,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"camera_snapshot %d result=%d\0A\00"
define i32 @camera_snapshot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = call i32 @create_command(i32 5, i32 %6, i32 %8, i32 %10, i32 0)
%12 = call i32 (...) @send_command()
%13 = call i32 @wait_for_ack(i32 100000, i32 5)
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 502, i32 %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [30 x i8] c"camera_snapshot %d result=%d\0A\00"
define i32 @camera_snapshot(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = ashr i32 %1, 8
%5 = tail call i32 @create_command(i32 5, i32 %0, i32 %3, i32 %4, i32 0)
%6 = tail call i32 (...) @send_command()
%7 = tail call i32 @wait_for_ack(i32 100000, i32 5)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 502, i32 %7)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
char fPeekChar(FILE *f) {
  char out = fgetc(f);
  ungetc(out, f);
  return out;
}


x86 assembly (clang, -O0):
<fPeekChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fPeekChar>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
movsbl %al,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @fPeekChar(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i8 @fgetc(i32* %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = load i32*, i32** %2
%8 = call i32 @ungetc(i8 signext %6, i32* %7)
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @fPeekChar(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = tail call i32 @ungetc(i8 signext %2, i32* %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
struct pane {
  int dummy;
};
struct mark {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __doc_step(struct pane *, struct mark *, int,
                              int /*<<< orphan*/);
wint_t doc_following(struct pane *p, struct mark *m) {
  return __doc_step(p, m, 1, 0);
}


x86 assembly (clang, -O0):
<doc_following>:
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
xor    %ecx,%ecx
call   1030 <__doc_step@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doc_following>:
mov    $0x1,%edx
xor    %ecx,%ecx
jmp    1030 <__doc_step@plt>

LLVM IR (-O0):
%struct.pane = type { i32 }
%struct.mark = type { i32 }
define i32 @doc_following(%struct.pane* %0, %struct.mark* %1) {
%3 = alloca %struct.pane*
%4 = alloca %struct.mark*
store %struct.pane* %0, %struct.pane** %3
store %struct.mark* %1, %struct.mark** %4
%5 = load %struct.pane*, %struct.pane** %3
%6 = load %struct.mark*, %struct.mark** %4
%7 = call i32 @__doc_step(%struct.pane* %5, %struct.mark* %6, i32 1, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.pane = type { i32 }
%struct.mark = type { i32 }
define i32 @doc_following(%struct.pane* %0, %struct.mark* %1) {
%3 = tail call i32 @__doc_step(%struct.pane* %0, %struct.mark* %1, i32 1, i32 0)
ret i32 %3
}
void stripChar(char *s, char c) {
  char *in = s, *out = s;
  char b;
  for (;;) {
    b = *out = *in++;
    if (b == 0)
      break;
    if (b != c)
      ++out;
  }
}


x86 assembly (clang, -O0):
<stripChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %al,(%rcx)
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x0,%eax
jne    114a <stripChar+0x4a>
jmp    116b <stripChar+0x6b>
movsbl -0x21(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     1166 <stripChar+0x66>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <stripChar+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripChar>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <stripChar+0x29>
lea    0x1(%rdi),%rax
nopw   0x0(%rax,%rax,1)
xor    %edx,%edx
cmp    %sil,%cl
setne  %dl
movzbl (%rax),%ecx
mov    %cl,(%rdi,%rdx,1)
add    %rdx,%rdi
add    $0x1,%rax
test   %cl,%cl
jne    1110 <stripChar+0x10>
ret

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

LLVM IR (-O2):
define void @stripChar(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = icmp ne i8 %6, %1
%11 = zext i1 %10 to i64
%12 = getelementptr i8, i8* %8, i64 %11
%13 = load i8, i8* %9
store i8 %13, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret void
}
int test_imm_4Auint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x4A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Auint64_lowword_reg>:
test   $0x4a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Auint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 74
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
void fileclose(FILE *filep) {
  if (filep && filep != stdout && filep != stdin)
    fclose(filep);
}


x86 assembly (clang, -O0):
<fileclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <fileclose+0x48>
mov    -0x8(%rbp),%rax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <fileclose+0x48>
mov    -0x8(%rbp),%rax
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <fileclose+0x48>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileclose>:
test   %rdi,%rdi
je     1132 <fileclose+0x22>
mov    0x2ebc(%rip),%rax
cmp    %rdi,(%rax)
je     1132 <fileclose+0x22>
mov    0x2ec0(%rip),%rax
cmp    %rdi,(%rax)
je     1132 <fileclose+0x22>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
@stdout = global i32* null
@stdin = global i32* null
define void @fileclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = load i32*, i32** @stdout
%8 = icmp ne i32* %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32*, i32** %2
%11 = load i32*, i32** @stdin
%12 = icmp ne i32* %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32*, i32** %2
%15 = call i32 @fclose(i32* %14)
br label %16
16: ; preds = %13, %9, %5, %1
ret void
}

LLVM IR (-O2):
@stdout = global i32* null
@stdin = global i32* null
define void @fileclose(i32* %0) {
%2 = icmp eq i32* %0, null
%3 = load i32*, i32** @stdout
%4 = icmp eq i32* %3, %0
%5 = select i1 %2, i1 true, i1 %4
%6 = load i32*, i32** @stdin
%7 = icmp eq i32* %6, %0
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @fclose(i32* %0)
br label %11
11: ; preds = %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intToRoman(int);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main() {
  puts(intToRoman(2));
  puts(intToRoman(4));
  puts(intToRoman(9));
  puts(intToRoman(1954));
  puts(intToRoman(1990));
  puts(intToRoman(2014));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x4,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x9,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x7a2,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x7c6,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x7de,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x4,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x9,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x7a2,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x7c6,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
mov    $0x7de,%edi
call   1030 <intToRoman@plt>
mov    %eax,%edi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @intToRoman(i32 2)
%3 = call i32 @puts(i32 %2)
%4 = call i32 @intToRoman(i32 4)
%5 = call i32 @puts(i32 %4)
%6 = call i32 @intToRoman(i32 9)
%7 = call i32 @puts(i32 %6)
%8 = call i32 @intToRoman(i32 1954)
%9 = call i32 @puts(i32 %8)
%10 = call i32 @intToRoman(i32 1990)
%11 = call i32 @puts(i32 %10)
%12 = call i32 @intToRoman(i32 2014)
%13 = call i32 @puts(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @intToRoman(i32 2)
%2 = tail call i32 @puts(i32 %1)
%3 = tail call i32 @intToRoman(i32 4)
%4 = tail call i32 @puts(i32 %3)
%5 = tail call i32 @intToRoman(i32 9)
%6 = tail call i32 @puts(i32 %5)
%7 = tail call i32 @intToRoman(i32 1954)
%8 = tail call i32 @puts(i32 %7)
%9 = tail call i32 @intToRoman(i32 1990)
%10 = tail call i32 @puts(i32 %9)
%11 = tail call i32 @intToRoman(i32 2014)
%12 = tail call i32 @puts(i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long a = 1, b = 1, i = 0, temp = 0;
  for (i = 0; i < 10000000; i++) {
    temp = a;
    a = b;
    b += temp;
  }
  printf("%lu\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x989680,-0x20(%rbp)
jae    1182 <main+0x72>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1147 <main+0x37>
mov    -0x10(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
mov    $0x989680,%ecx
mov    $0x1,%esi
nop
add    %rax,%rsi
add    %rsi,%rax
add    %rax,%rsi
add    %rsi,%rax
add    %rax,%rsi
add    %rsi,%rax
add    %rax,%rsi
add    %rsi,%rax
add    %rax,%rsi
add    %rsi,%rax
add    $0xfffffffffffffff6,%rcx
jne    1120 <main+0x10>
push   %rax
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %15, %1 ]
%3 = phi i64 [ 1, %0 ], [ %14, %1 ]
%4 = phi i64 [ 1, %0 ], [ %13, %1 ]
%5 = add i64 %3, %4
%6 = add i64 %5, %3
%7 = add i64 %6, %5
%8 = add i64 %7, %6
%9 = add i64 %8, %7
%10 = add i64 %9, %8
%11 = add i64 %10, %9
%12 = add i64 %11, %10
%13 = add i64 %12, %11
%14 = add i64 %13, %12
%15 = add nuw nsw i64 %2, 10
%16 = icmp eq i64 %15, 10000000
br i1 %16, label %17, label %1
17: ; preds = %1
%18 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %13)
ret i32 0
}
unsigned long long f(unsigned long long i) { return (i & 0x1ffff) << 34; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1ffff,%rax
shl    $0x22,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
and    $0x1ffff,%eax
shl    $0x22,%rax
ret

LLVM IR (-O0):
define i64 @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 131071
%5 = shl i64 %4, 34
ret i64 %5
}

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = shl i64 %0, 34
%3 = and i64 %2, 2251782633816064
ret i64 %3
}
void swap_array_elements(int *arr, int index1, int index2) {
  int temp = arr[index1];
  arr[index1] = arr[index2];
  arr[index2] = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap_array_elements(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum(int c) {
  if (isdigit(c) != 0)
    return 1;
  if (isalpha(c) != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1149 <isalnum+0x29>
movl   $0x1,-0x4(%rbp)
jmp    116e <isalnum+0x4e>
mov    -0x8(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     1167 <isalnum+0x47>
movl   $0x1,-0x4(%rbp)
jmp    116e <isalnum+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isalpha(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void slam_cleanup(void *arg) { remove((char *)arg); }


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

x86 assembly (clang, -O2):
<slam_cleanup>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define void @slam_cleanup(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_print(char *);
void simple_init() {
  uart_print("Welcome to Simple bare-metal program\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<simple_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <uart_print@plt>
jmp    1120 <simple_init+0x10>

x86 assembly (clang, -O2):
<simple_init>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <uart_print@plt>
nopl   (%rax)
jmp    1120 <simple_init+0x10>

LLVM IR (-O0):
@.str = [38 x i8] c"Welcome to Simple bare-metal program\0A\00"
define void @simple_init() {
%1 = call i32 @uart_print(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [38 x i8] c"Welcome to Simple bare-metal program\0A\00"
define void @simple_init() {
%1 = tail call i32 @uart_print(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
int startMonitoringLeds(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @startMonitoringLeds() {
ret i32 0
}
int fun1393() { return 1393; }


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

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

LLVM IR (-O0):
define i32 @fun1393() {
ret i32 1393
}

LLVM IR (-O2):
define i32 @fun1393() {
ret i32 1393
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int diff(struct timespec *, struct timespec *);
int /*<<< orphan*/ printf(char *, int);
void print_timestamp(struct timespec *start, struct timespec *end) {
  printf("%dms", diff(start, end));
}


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

x86 assembly (clang, -O2):
<print_timestamp>:
push   %rax
call   1040 <diff@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [5 x i8] c"%dms\00"
define void @print_timestamp(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @diff(%struct.timespec* %5, %struct.timespec* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@.str = [5 x i8] c"%dms\00"
define void @print_timestamp(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i32 @diff(%struct.timespec* %0, %struct.timespec* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int get_current_bitrate(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_current_bitrate() {
ret i32 0
}
int __syscall4(int call, unsigned long arg0, unsigned long arg1,
               unsigned long arg2, unsigned long arg3) {
  int rc;
  asm volatile("movl %[call], %%eax	\n"
               "movl %[arg0], %%ebx	\n"
               "movl %[arg1], %%ecx	\n"
               "movl %[arg2], %%edx	\n"
               "movl %[arg3], %%edi	\n"
               "int  %[xnum]		\n"
               "movl %%eax, %[rc]	\n"
               : [rc] "=g"(rc)
               : [call] "g"(call), [arg0] "g"(arg0), [arg1] "g"(arg1),
                 [arg2] "g"(arg2), [arg3] "g"(arg3), [xnum] "i"(0x80)
               : "%eax", "%ebx", "%ecx", "%edx", "%edi", "memory");
  return rc;
}


x86 assembly (clang, -O0):
<__syscall4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %edi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
mov    %rcx,-0x50(%rbp)
mov    %rax,-0x58(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x40(%rbp),%ebx
mov    -0x48(%rbp),%ecx
mov    -0x50(%rbp),%edx
mov    -0x58(%rbp),%edi
int    $0x80
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__syscall4(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
store i32 %0, i32* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%12 = load i32, i32* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = load i64, i64* %10
%17 = load i32, i32* %11
ret i32 %17
}

LLVM IR (-O2):