xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ do_stuff();
int /*<<< orphan*/ printf(char *);
int main() {
  for (int i = 0; i < 4; ++i)
    do_stuff();
  printf("world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1155 <main+0x35>
mov    $0x0,%al
call   1040 <do_stuff@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <do_stuff@plt>
xor    %eax,%eax
call   1040 <do_stuff@plt>
xor    %eax,%eax
call   1040 <do_stuff@plt>
xor    %eax,%eax
call   1040 <do_stuff@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"world!\00"
define i32 @main() {
%1 = tail call i32 (...) @do_stuff()
%2 = tail call i32 (...) @do_stuff()
%3 = tail call i32 (...) @do_stuff()
%4 = tail call i32 (...) @do_stuff()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _dwt_aonarrayupload();
void dwt_entersleep(void) { _dwt_aonarrayupload(); }


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

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

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

LLVM IR (-O2):
define void @dwt_entersleep() {
%1 = tail call i32 (...) @_dwt_aonarrayupload()
ret void
}
void test_cleanup(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ dlock_lock(int /*<<< orphan*/ *, int);
int o_pthread_mutex_lock(int /*<<< orphan*/ *);
scalar_t__ pthread_self();
int ___pthread_mutex_lock(pthread_mutex_t *mutex, char *lname, char *fn,
                          int ln) {
  int ret;
  ;
  ret = o_pthread_mutex_lock(mutex);
  dlock_lock(mutex, (int)pthread_self());
  return ret;
}


x86 assembly (clang, -O0):
<___pthread_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <o_pthread_mutex_lock@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <dlock_lock@plt>
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___pthread_mutex_lock>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <o_pthread_mutex_lock@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <dlock_lock@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @___pthread_mutex_lock(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = call i32 @o_pthread_mutex_lock(i32* %10)
store i32 %11, i32* %9
%12 = load i32*, i32** %5
%13 = call i64 (...) @pthread_self()
%14 = trunc i64 %13 to i32
%15 = call i32 @dlock_lock(i32* %12, i32 %14)
%16 = load i32, i32* %9
ret i32 %16
}

LLVM IR (-O2):
define i32 @___pthread_mutex_lock(i32* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @o_pthread_mutex_lock(i32* %0)
%6 = tail call i64 (...) @pthread_self()
%7 = trunc i64 %6 to i32
%8 = tail call i32 @dlock_lock(i32* %0, i32 %7)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write_config_bits_PIC24(unsigned long, unsigned char *, char,
                                           int);
void write_config_bits_P24FJ(unsigned long address, unsigned char *data,
                             char blocksize, char lastblock) {
  write_config_bits_PIC24(address, data, blocksize, 0x4003);
}


x86 assembly (clang, -O0):
<write_config_bits_P24FJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4003,%ecx
movsbl -0x11(%rbp),%edx
call   1030 <write_config_bits_PIC24@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_config_bits_P24FJ>:
mov    $0x4003,%ecx
jmp    1030 <write_config_bits_PIC24@plt>

LLVM IR (-O0):
define void @write_config_bits_P24FJ(i64 %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
store i64 %0, i64* %5
store i8* %1, i8** %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = load i8, i8* %7
%12 = call i32 @write_config_bits_PIC24(i64 %9, i8* %10, i8 signext %11, i32 16387)
ret void
}

LLVM IR (-O2):
define void @write_config_bits_P24FJ(i64 %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = tail call i32 @write_config_bits_PIC24(i64 %0, i8* %1, i8 signext %2, i32 16387)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse_string(char *);
int /*<<< orphan*/ rot13_string(char *);
void workout_string(char *s) {
  int i;
  for (i = 0; i < 100; i++) {
    reverse_string(s);
    rot13_string(s);
  }
}


x86 assembly (clang, -O0):
<workout_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    115d <workout_string+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <reverse_string@plt>
mov    -0x8(%rbp),%rdi
call   1040 <rot13_string@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <workout_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workout_string>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x64,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <reverse_string@plt>
mov    %rbx,%rdi
call   1040 <rot13_string@plt>
add    $0xffffffff,%ebp
jne    1130 <workout_string+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @workout_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = call i32 @reverse_string(i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @rot13_string(i8* %10)
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @workout_string(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = tail call i32 @reverse_string(i8* %0)
%5 = tail call i32 @rot13_string(i8* %0)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 100
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_to_string(char *, char *);
int /*<<< orphan*/ initialize_string(char *);
void build_path(char *variable, char *base_path, char *filename) {
  initialize_string(variable);
  add_to_string(variable, base_path);
  add_to_string(variable, "/");
  add_to_string(variable, filename);
}


x86 assembly (clang, -O0):
<build_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <initialize_string@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <add_to_string@plt>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <add_to_string@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <add_to_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_path>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <initialize_string@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <add_to_string@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <add_to_string@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <add_to_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @build_path(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i32 @initialize_string(i8* %7)
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @add_to_string(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = call i32 @add_to_string(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
%15 = load i8*, i8** %6
%16 = call i32 @add_to_string(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @build_path(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @initialize_string(i8* %0)
%5 = tail call i32 @add_to_string(i8* %0, i8* %1)
%6 = tail call i32 @add_to_string(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @add_to_string(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int CString_strcasecmp(const char *a, const char *b) {
  return strcasecmp(a, b);
}


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

x86 assembly (clang, -O2):
<CString_strcasecmp>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @CString_strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
unsigned char calcrc_1byte(unsigned char);
unsigned char calcrc_bytes(unsigned char *p, unsigned int num_of_bytes) {
  unsigned char crc = 0;
  while (num_of_bytes--) {
    crc = calcrc_1byte(crc ^ *p++);
  }
  return crc;
}


x86 assembly (clang, -O0):
<calcrc_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     115f <calcrc_bytes+0x4f>
movzbl -0xd(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
xor    %ecx,%eax
movzbl %al,%edi
call   1030 <calcrc_1byte@plt>
mov    %al,-0xd(%rbp)
jmp    1123 <calcrc_bytes+0x13>
movzbl -0xd(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcrc_bytes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1147 <calcrc_bytes+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    (%r14,%rbx,1),%al
movzbl %al,%edi
call   1030 <calcrc_1byte@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <calcrc_bytes+0x20>
jmp    1149 <calcrc_bytes+0x39>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define zeroext i8 @calcrc_bytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8 0, i8* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add i32 %7, -1
store i32 %8, i32* %4
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
%16 = zext i8 %15 to i32
%17 = xor i32 %12, %16
%18 = trunc i32 %17 to i8
%19 = call zeroext i8 @calcrc_1byte(i8 zeroext %18)
store i8 %19, i8* %5
br label %6
20: ; preds = %6
%21 = load i8, i8* %5
ret i8 %21
}

LLVM IR (-O2):
define zeroext i8 @calcrc_bytes(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i8 [ %12, %4 ], [ 0, %2 ]
%6 = phi i32 [ %8, %4 ], [ %1, %2 ]
%7 = phi i8* [ %9, %4 ], [ %0, %2 ]
%8 = add i32 %6, -1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = xor i8 %10, %5
%12 = tail call zeroext i8 @calcrc_1byte(i8 zeroext %11)
%13 = icmp eq i32 %8, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i8 [ 0, %2 ], [ %12, %4 ]
ret i8 %15
}
/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(double *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(void) {
  double buf;
  while (!feof(stdin)) {
    scanf("%ld", &buf);
    fwrite(&buf, 1, sizeof(double), stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1162 <main+0x32>
jmp    1193 <main+0x63>
lea    0xe97(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%ecx
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
call   1050 <fwrite@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2ea9(%rip),%r15
mov    (%r15),%edi
call   1030 <feof@plt>
test   %eax,%eax
jne    118d <main+0x5d>
lea    0xeae(%rip),%r14
mov    %rsp,%rbx
mov    0x2e7c(%rip),%r12
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    (%r12),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
call   1050 <fwrite@plt>
mov    (%r15),%edi
call   1030 <feof@plt>
test   %eax,%eax
je     1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%ld\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* @stdin
%5 = call i32 @feof(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%10 = load i32, i32* @stdout
%11 = call i32 @fwrite(double* %2, i32 1, i32 8, i32 %10)
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%ld\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = load i32, i32* @stdin
%4 = call i32 @feof(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0, %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%8 = load i32, i32* @stdout
%9 = call i32 @fwrite(double* %1, i32 1, i32 8, i32 %8)
%10 = load i32, i32* @stdin
%11 = call i32 @feof(i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ factorial_func(int);
int main() {
  factorial_func(6);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @factorial_func(i32 6)
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(int);
char *trim(char *s) {
  while (*s && (isspace((int)*s))) {
    s++;
  }
  return (s);
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <trim+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <trim+0x47>
jmp    1168 <trim+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <trim+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <trim+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <trim+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <trim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_JPEG_SetTargetCompressRatio(unsigned char byRatio) {
  byRatio <<= 2;
  byRatio++;
  VIM_HIF_SetReg8((0x0000 + 0x004), byRatio);
}


x86 assembly (clang, -O0):
<VIM_JPEG_SetTargetCompressRatio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x2,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
mov    $0x4,%edi
movzbl -0x1(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_SetTargetCompressRatio>:
shl    $0x2,%dil
or     $0x1,%dil
movzbl %dil,%esi
mov    $0x4,%edi
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_JPEG_SetTargetCompressRatio(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 2
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = add i8 %7, 1
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = call i32 @VIM_HIF_SetReg8(i32 4, i8 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @VIM_JPEG_SetTargetCompressRatio(i8 zeroext %0) {
%2 = shl i8 %0, 2
%3 = or i8 %2, 1
%4 = tail call i32 @VIM_HIF_SetReg8(i32 4, i8 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void do_exit(const char *name) {
  perror(name);
  fputs("exiting...\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<do_exit>:
push   %rax
call   1040 <perror@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"exiting...\0A\00"
@stderr = global i32 0
define void @do_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"exiting...\0A\00"
@stderr = global i32 0
define void @do_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void gdk_display_flush() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_flush() {
ret void
}
/* Variables and functions */
int tcsendbreak(int, int);
int termios_tcsendbreak(int fd, int duration) {
  return tcsendbreak(fd, duration);
}


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

x86 assembly (clang, -O2):
<termios_tcsendbreak>:
jmp    1030 <tcsendbreak@plt>

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

LLVM IR (-O2):
define i32 @termios_tcsendbreak(i32 %0, i32 %1) {
%3 = tail call i32 @tcsendbreak(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int parse_args(int, char **);
int /*<<< orphan*/ print_args(int, char **);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int ret;
  print_args(argc, argv);
  ret = parse_args(argc, argv);
  printf("Parse function returned: %d\n", ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <print_args@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parse_args@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1050 <print_args@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <parse_args@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Parse function returned: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @print_args(i32 %6, i8** %7)
%9 = load i32, i32* %3
%10 = load i8**, i8*** %4
%11 = call i32 @parse_args(i32 %9, i8** %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Parse function returned: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @print_args(i32 %0, i8** %1)
%4 = tail call i32 @parse_args(i32 %0, i8** %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void platform_copy_string(char *destination, char *source, long max_length) {}


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

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

LLVM IR (-O0):
define void @platform_copy_string(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @platform_copy_string(i8* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructPPForm(void *, struct constructHeader *);
const char *EnvGetDefglobalPPForm(void *theEnv, void *theDefglobal) {
  return GetConstructPPForm(theEnv, (struct constructHeader *)theDefglobal);
}


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

x86 assembly (clang, -O2):
<EnvGetDefglobalPPForm>:
jmp    1030 <GetConstructPPForm@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefglobalPPForm(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.constructHeader*
%8 = call i8* @GetConstructPPForm(i8* %5, %struct.constructHeader* %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDefglobalPPForm(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructPPForm(i8* %0, %struct.constructHeader* %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
void glcReplacementCode(GLint code) {}


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

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

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

LLVM IR (-O2):
define void @glcReplacementCode(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testLogicalAnd() { printf("%d && %d = %d\n", 10, 4, 10 && 4); }


x86 assembly (clang, -O0):
<testLogicalAnd>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLogicalAnd>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d && %d = %d\0A\00"
define void @testLogicalAnd() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d && %d = %d\0A\00"
define void @testLogicalAnd() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
ret void
}
int check(int target, int array[], int dim_array) {
  int i = 0, trovato = 0;
  while (trovato == 0 && i < dim_array) {
    if (array[i] == target)
      trovato = 1;
    else
      i++;
  }
  return trovato;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jne    1137 <check+0x37>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
setl   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1147 <check+0x47>
jmp    1175 <check+0x75>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
jne    1167 <check+0x67>
movl   $0x1,-0x1c(%rbp)
jmp    1170 <check+0x70>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <check+0x1c>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
xor    %eax,%eax
test   %edx,%edx
jle    1132 <check+0x32>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
mov    (%rsi,%rcx,4),%r8d
xor    %ecx,%ecx
cmp    %edi,%r8d
setne  %r9b
je     112a <check+0x2a>
mov    %r9b,%cl
add    %ecx,%eax
cmp    %edx,%eax
jl     1110 <check+0x10>
xor    %eax,%eax
cmp    %edi,%r8d
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %18
5: ; preds = %3, %5
%6 = phi i32 [ %13, %5 ], [ 0, %3 ]
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, %0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %6, %12
%14 = icmp slt i32 %13, %2
%15 = select i1 %11, i1 %14, i1 false
br i1 %15, label %5, label %16
16: ; preds = %5
%17 = zext i1 %10 to i32
br label %18
18: ; preds = %16, %3
%19 = phi i32 [ 0, %3 ], [ %17, %16 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ abusing_trap(int, int, int, int, int, int, int, double,
                                double, double, double);
int fac(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ set_handler();
int main() {
  set_handler();
  int result = fac(5);
  printf("fac(5) = %d\n", result);
  abusing_trap(1, 2, 3, 4, 5, 6, 7, 8.0, 9.0, 10.0, 11.0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <set_handler@plt>
mov    $0x5,%edi
call   1040 <fac@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movsd  0xe6d(%rip),%xmm0
movsd  0xe6d(%rip),%xmm1
movsd  0xe6d(%rip),%xmm2
movsd  0xe6d(%rip),%xmm3
movl   $0x7,(%rsp)
call   1060 <abusing_trap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <set_handler@plt>
mov    $0x5,%edi
call   1040 <fac@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
movl   $0x7,(%rsp)
movsd  0xe91(%rip),%xmm0
movsd  0xe91(%rip),%xmm1
movsd  0xe91(%rip),%xmm2
movsd  0xe91(%rip),%xmm3
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1060 <abusing_trap@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"fac(5) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @set_handler()
%3 = call i32 @fac(i32 5)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @abusing_trap(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, double 8.000000e+00, double 9.000000e+00, double 1.000000e+01, double 1.100000e+01)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"fac(5) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @set_handler()
%2 = tail call i32 @fac(i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @abusing_trap(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, double 8.000000e+00, double 9.000000e+00, double 1.000000e+01, double 1.100000e+01)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void test_break_do_while() {
  printf("\n===== test_break_do_while\n");
  int result = 1;
  do {
    ++result;
    if (result == 5)
      break;
  } while (result < 10);
  assert(result == 5);
}


x86 assembly (clang, -O0):
<test_break_do_while>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    1153 <test_break_do_while+0x33>
jmp    1162 <test_break_do_while+0x42>
jmp    1158 <test_break_do_while+0x38>
cmpl   $0xa,-0x4(%rbp)
jl     113b <test_break_do_while+0x1b>
cmpl   $0x5,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_break_do_while>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

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

LLVM IR (-O2):
@str = [27 x i8] c"\0A===== test_break_do_while\00"
define void @test_break_do_while() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 1)
ret void
}
void test4_OtherInterrupts_enable__E() {}


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

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

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

LLVM IR (-O2):
define void @test4_OtherInterrupts_enable__E() {
ret void
}
int GCD(int i, int j) {
  int c;
  while (i != 0) {
    c = j % i;
    j = i;
    i = c;
  }
  return (j);
}


x86 assembly (clang, -O0):
<GCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <GCD+0x2f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <GCD+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCD>:
mov    %esi,%eax
test   %edi,%edi
je     111d <GCD+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <GCD+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @GCD(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
char *calloc(int, int);
int rand();
int /*<<< orphan*/ strcpy(char *, char *);
char *fn106() {
  char *result;
  result = calloc(5 + rand() % 5, 4);
  strcpy((char *)result, "fn106");
  return result;
}


x86 assembly (clang, -O0):
<fn106>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x5,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn106>:
push   %rbx
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x5,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0xe93(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"fn106\00"
define i8* @fn106() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 5
%4 = add nsw i32 5, %3
%5 = call i8* @calloc(i32 %4, i32 4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"fn106\00"
define i8* @fn106() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 5
%3 = add nsw i32 %2, 5
%4 = tail call i8* @calloc(i32 %3, i32 4)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ done(int /*<<< orphan*/);
void caseex(void) { done(0); }


x86 assembly (clang, -O0):
<caseex>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <done@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<caseex>:
xor    %edi,%edi
jmp    1030 <done@plt>

LLVM IR (-O0):
define void @caseex() {
%1 = call i32 @done(i32 0)
ret void
}

LLVM IR (-O2):
define void @caseex() {
%1 = tail call i32 @done(i32 0)
ret void
}
hexn(x) int x;
{
  x = x & 15;
  if (x < 10)
    putchar(x + '0');
  else
    putchar(x - 10 + 'A');
}


x86 assembly (clang, -O0):
<hexn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1140 <hexn+0x30>
mov    -0x8(%rbp),%edi
add    $0x30,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    1150 <hexn+0x40>
mov    -0x8(%rbp),%edi
sub    $0xa,%edi
add    $0x41,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexn>:
and    $0xf,%edi
lea    0x37(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovae %ecx,%eax
mov    %eax,%edi
xor    %eax,%eax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @hexn(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 15
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 48
%11 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %10)
br label %17
12: ; preds = %1
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 10
%15 = add nsw i32 %14, 65
%16 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %15)
br label %17
17: ; preds = %12, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @hexn(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp ult i32 %2, 10
%4 = add nuw nsw i32 %2, 55
%5 = or i32 %2, 48
%6 = select i1 %3, i32 %5, i32 %4
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %6)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mempool_get_shm_id() {
  printf("NOT IMPLEMENTED:"
         "pa_mempool_get_shm_id"
         "\n");
}


x86 assembly (clang, -O0):
<pa_mempool_get_shm_id>:
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_mempool_get_shm_id>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_mempool_get_shm_id\0A\00"
define i32 @pa_mempool_get_shm_id() {
%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_mempool_get_shm_id\00"
define i32 @pa_mempool_get_shm_id() {
%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 */
scalar_t__ digit(char);
int number(char **lc) {
  register int nn;
  nn = 0;
  while (digit(**lc))
    nn = nn * 10 + *(*lc)++ - '0';
  return (nn);
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <digit@plt>
cmp    $0x0,%rax
je     1161 <number+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <number+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rax
movsbl (%rax),%edi
call   1030 <digit@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1154 <number+0x44>
nopl   0x0(%rax)
lea    (%rbx,%rbx,4),%eax
mov    (%r14),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%r14)
movsbl (%rcx),%edx
lea    (%rdx,%rax,2),%ebx
add    $0xffffffd0,%ebx
movsbl 0x1(%rcx),%edi
call   1030 <digit@plt>
test   %rax,%rax
jne    1130 <number+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @number(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @digit(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %14, %6 ], [ 0, %1 ]
%8 = mul nsw i32 %7, 10
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = add i32 %8, -48
%14 = add i32 %13, %12
%15 = load i8, i8* %10
%16 = tail call i64 @digit(i8 signext %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %14, %6 ]
ret i32 %19
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double genasech(double num) {
  return (log(1.0 / num + sqrt(1.0 / (num * num) - 1.0)));
}


x86 assembly (clang, -O0):
<genasech>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xeaf(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genasech>:
push   %rax
movsd  0xed7(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
mulsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
addsd  0xec2(%rip),%xmm1
movapd %xmm1,%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @genasech(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = fdiv double 1.000000e+00, %7
%9 = fsub double %8, 1.000000e+00
%10 = call i64 @sqrt(double %9)
%11 = sitofp i64 %10 to double
%12 = fadd double %4, %11
%13 = fptosi double %12 to i64
%14 = call double @log(i64 %13)
ret double %14
}

LLVM IR (-O2):
define double @genasech(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fmul double %0, %0
%4 = fdiv double 1.000000e+00, %3
%5 = fadd double %4, -1.000000e+00
%6 = tail call i64 @sqrt(double %5)
%7 = sitofp i64 %6 to double
%8 = fadd double %2, %7
%9 = fptosi double %8 to i64
%10 = tail call double @log(i64 %9)
ret double %10
}
int __ltchar(char a, char b) { return a < b; }


x86 assembly (clang, -O0):
<__ltchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltchar>:
xor    %eax,%eax
cmp    %sil,%dil
setl   %al
ret

LLVM IR (-O0):
define i32 @__ltchar(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__ltchar(i8 signext %0, i8 signext %1) {
%3 = icmp slt i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}