xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ prbs15_gen(int /*<<< orphan*/, unsigned short,
                              unsigned char *, unsigned int,
                              int /*<<< orphan*/);
unsigned int gen_prbs15_random_data_samsung(unsigned char *p_random_data_buffer,
                                            unsigned int random_data_length) {
  unsigned short seed = (0x576A);
  ;
  ;
  prbs15_gen((0), seed, p_random_data_buffer, random_data_length, (0));
  return random_data_length;
}


x86 assembly (clang, -O0):
<gen_prbs15_random_data_samsung>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movw   $0x576a,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
xor    %r8d,%r8d
mov    %r8d,%edi
movzwl %ax,%esi
call   1030 <prbs15_gen@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_prbs15_random_data_samsung>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0x576a,%esi
mov    %ebx,%ecx
xor    %r8d,%r8d
call   1030 <prbs15_gen@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_prbs15_random_data_samsung(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i16
store i8* %0, i8** %3
store i32 %1, i32* %4
store i16 22378, i16* %5
%6 = load i16, i16* %5
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @prbs15_gen(i32 0, i16 zeroext %6, i8* %7, i32 %8, i32 0)
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @gen_prbs15_random_data_samsung(i8* %0, i32 returned %1) {
%3 = tail call i32 @prbs15_gen(i32 0, i16 zeroext 22378, i8* %0, i32 %1, i32 0)
ret i32 %1
}
const char *__asan_default_options() { return "allocator_may_return_null=1"; }


x86 assembly (clang, -O0):
<__asan_default_options>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__asan_default_options>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"allocator_may_return_null=1\00"
define i8* @__asan_default_options() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [28 x i8] c"allocator_may_return_null=1\00"
define i8* @__asan_default_options() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, int);
int main(void) {
  char my_str[] = "Takxxxex xaxxx xxxwxxaxxxlxxk onxx xthxxe wxilxd sxxidxe!";
  int c = 'x';
  squeeze(my_str, c);
  printf("%s\n", my_str);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x3a,%edx
call   1050 <memcpy@plt>
movl   $0x78,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1030 <squeeze@plt>
lea    -0x40(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movups 0xefe(%rip),%xmm0
movups %xmm0,0x2a(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x78,%esi
call   1030 <squeeze@plt>
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.my_str = [58 x i8] c"Takxxxex xaxxx xxxwxxaxxxlxxk onxx xthxxe wxilxd sxxidxe!\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [58 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [58 x i8]* %2 to i8*
store i32 120, i32* %3
%5 = getelementptr inbounds [58 x i8], [58 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @squeeze(i8* %5, i32 %6)
%8 = getelementptr inbounds [58 x i8], [58 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@__const.main.my_str = [58 x i8] c"Takxxxex xaxxx xxxwxxaxxxlxxk onxx xthxxe wxilxd sxxidxe!\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [58 x i8]
%2 = getelementptr inbounds [58 x i8], [58 x i8]* %1, i64 0, i64 0
%3 = call i32 @squeeze(i8* %2, i32 120)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
void u8g_MicroDelay(void) {}


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

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

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

LLVM IR (-O2):
define void @u8g_MicroDelay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DisplayColourArea(int, int, int, int);
void CommonInterruptHandler(int handlerNum) {
  DisplayColourArea(0xF, 0xF, handlerNum, 1);
}


x86 assembly (clang, -O0):
<CommonInterruptHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xf,%esi
mov    $0x1,%ecx
mov    %esi,%edi
call   1030 <DisplayColourArea@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommonInterruptHandler>:
mov    %edi,%edx
mov    $0xf,%edi
mov    $0xf,%esi
mov    $0x1,%ecx
jmp    1030 <DisplayColourArea@plt>

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

LLVM IR (-O2):
define void @CommonInterruptHandler(i32 %0) {
%2 = tail call i32 @DisplayColourArea(i32 15, i32 15, i32 %0, i32 1)
ret void
}
unsigned long RoundUpToNextPowerOf2(unsigned long n) {
  long numBits = 0;
  if (((n - 1) & n) == 0)
    return n;
  while (n > 0) {
    n = n >> 1;
    numBits++;
  }
  return (1 << numBits);
}


x86 assembly (clang, -O0):
<RoundUpToNextPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
jne    1133 <RoundUpToNextPowerOf2+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <RoundUpToNextPowerOf2+0x73>
jmp    1138 <RoundUpToNextPowerOf2+0x38>
cmpq   $0x0,-0x10(%rbp)
jbe    1160 <RoundUpToNextPowerOf2+0x60>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <RoundUpToNextPowerOf2+0x38>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoundUpToNextPowerOf2>:
mov    %rdi,%rax
lea    -0x1(%rdi),%rcx
test   %rcx,%rdi
je     1138 <RoundUpToNextPowerOf2+0x38>
xor    %ecx,%ecx
test   %rax,%rax
je     112f <RoundUpToNextPowerOf2+0x2f>
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
shr    %rdx
add    $0x1,%ecx
cmp    $0x1,%rax
mov    %rdx,%rax
ja     1120 <RoundUpToNextPowerOf2+0x20>
mov    $0x1,%eax
shl    %cl,%eax
cltq
ret

LLVM IR (-O0):
define i64 @RoundUpToNextPowerOf2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 0, i64* %4
%5 = load i64, i64* %3
%6 = sub i64 %5, 1
%7 = load i64, i64* %3
%8 = and i64 %6, %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i64, i64* %3
store i64 %11, i64* %2
br label %26
12: ; preds = %1
br label %13
13: ; preds = %16, %12
%14 = load i64, i64* %3
%15 = icmp ugt i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i64, i64* %3
%18 = lshr i64 %17, 1
store i64 %18, i64* %3
%19 = load i64, i64* %4
%20 = add nsw i64 %19, 1
store i64 %20, i64* %4
br label %13
21: ; preds = %13
%22 = load i64, i64* %4
%23 = trunc i64 %22 to i32
%24 = shl i32 1, %23
%25 = sext i32 %24 to i64
store i64 %25, i64* %2
br label %26
26: ; preds = %21, %10
%27 = load i64, i64* %2
ret i64 %27
}

LLVM IR (-O2):
define i64 @RoundUpToNextPowerOf2(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = icmp ult i64 %2, 2
br i1 %3, label %18, label %4
4: ; preds = %1
%5 = icmp eq i64 %0, 0
br i1 %5, label %14, label %6
6: ; preds = %4, %6
%7 = phi i64 [ %10, %6 ], [ 0, %4 ]
%8 = phi i64 [ %9, %6 ], [ %0, %4 ]
%9 = lshr i64 %8, 1
%10 = add nuw nsw i64 %7, 1
%11 = icmp ult i64 %8, 2
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = trunc i64 %10 to i32
br label %14
14: ; preds = %12, %4
%15 = phi i32 [ 0, %4 ], [ %13, %12 ]
%16 = shl nuw i32 1, %15
%17 = sext i32 %16 to i64
br label %18
18: ; preds = %1, %14
%19 = phi i64 [ %17, %14 ], [ %0, %1 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ command();
int /*<<< orphan*/ display();
int /*<<< orphan*/ file();
int /*<<< orphan*/ insert();
int /*<<< orphan*/ kbd();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ search();
int /*<<< orphan*/ utils();
int main() {
  printf("this is main, below is called from main:\n");
  kbd();
  display();
  insert();
  search();
  file();
  utils();
  command();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe6a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <kbd@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0x0,%al
call   1080 <insert@plt>
mov    $0x0,%al
call   1060 <search@plt>
mov    $0x0,%al
call   10a0 <file@plt>
mov    $0x0,%al
call   1090 <utils@plt>
mov    $0x0,%al
call   1040 <command@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <kbd@plt>
xor    %eax,%eax
call   1040 <display@plt>
xor    %eax,%eax
call   1080 <insert@plt>
xor    %eax,%eax
call   1060 <search@plt>
xor    %eax,%eax
call   10a0 <file@plt>
xor    %eax,%eax
call   1090 <utils@plt>
xor    %eax,%eax
call   1050 <command@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"this is main, below is called from main:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @kbd()
%4 = call i32 (...) @display()
%5 = call i32 (...) @insert()
%6 = call i32 (...) @search()
%7 = call i32 (...) @file()
%8 = call i32 (...) @utils()
%9 = call i32 (...) @command()
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"this is main, below is called from main:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @kbd()
%3 = tail call i32 (...) @display()
%4 = tail call i32 (...) @insert()
%5 = tail call i32 (...) @search()
%6 = tail call i32 (...) @file()
%7 = tail call i32 (...) @utils()
%8 = tail call i32 (...) @command()
ret i32 0
}
/* Variables and functions */
int strlen(char const *);
bool is_flag(const char *s) {
  return strlen(s) > 2 && s[0] == '-' && s[1] == '-';
}


x86 assembly (clang, -O0):
<is_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
mov    %al,-0x9(%rbp)
jle    115b <is_flag+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    115b <is_flag+0x4b>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_flag>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
jl     1130 <is_flag+0x20>
cmpb   $0x2d,(%rbx)
jne    1130 <is_flag+0x20>
xor    %eax,%eax
cmpb   $0x2d,0x1(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_flag(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 2
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 45
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 45
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %4, %1
%13 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isHelp(int argc, const char **argv) {
  return (argc == 2 && strcmp(argv[1], "--help") == 0);
}


x86 assembly (clang, -O0):
<isHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jne    114c <isHelp+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xec3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isHelp>:
xor    %eax,%eax
cmp    $0x2,%edi
jne    1137 <isHelp+0x27>
push   %rax
mov    0x8(%rsi),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
define i32 @isHelp(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br label %13
13: ; preds = %7, %2
%14 = phi i1 [ false, %2 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
define i32 @isHelp(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %11
}
int sgcd(int x, int y) {
  int cnt = 0;
  int t;
  while (1) {
    t = x;
    x = y;
    y = t % y;
    cnt++;
    if (y == 0)
      return cnt;
  }
}


x86 assembly (clang, -O0):
<sgcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113f <sgcd+0x3f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    1111 <sgcd+0x11>

x86 assembly (clang, -O2):
<sgcd>:
mov    %esi,%edx
mov    %edi,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edx,%esi
cltd
idiv   %esi
add    $0x1,%ecx
mov    %esi,%eax
test   %edx,%edx
jne    1110 <sgcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sgcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %7, %3 ]
%5 = phi i32 [ 0, %2 ], [ %8, %3 ]
%6 = phi i32 [ %0, %2 ], [ %4, %3 ]
%7 = srem i32 %6, %4
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 %8
}
/* Variables and functions */
int atoi(char *);
int myAtoi(char *);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  if (argc > 1) {
    printf("%d = %d\n", atoi(argv[1]), myAtoi(argv[1]));
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1185 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <myAtoi@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1164 <main+0x34>
push   %rbp
push   %rbx
push   %rax
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <myAtoi@plt>
lea    0xeab(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i32 @myAtoi(i8* %6)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %4, %2
ret i32 0
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t signum_fun_int16_t(int16_t a) { return (a != 0) | (a >> 15); }


x86 assembly (clang, -O0):
<signum_fun_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
sar    $0xf,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_int16_t>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
sar    $0xf,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @signum_fun_int16_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = ashr i32 %6, 15
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @signum_fun_int16_t(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 15
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool I2CSlaveIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked) {
    return (((*((volatile unsigned long *)(ui32Base + 0x00000814)))) ? 1 : 0);
  } else {
    return (((*((volatile unsigned long *)(ui32Base + 0x00000810)))) ? 1 : 0);
  }
}


x86 assembly (clang, -O0):
<I2CSlaveIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1136 <I2CSlaveIntStatus+0x36>
mov    -0x10(%rbp),%rax
mov    0x814(%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <I2CSlaveIntStatus+0x52>
mov    -0x10(%rbp),%rax
mov    0x810(%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntStatus>:
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
xor    %eax,%eax
cmpq   $0x0,0x810(%rdi,%rcx,4)
setne  %al
ret

LLVM IR (-O0):
define i32 @I2CSlaveIntStatus(i64 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i64, i64* %4
%10 = add nsw i64 %9, 2068
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
store i32 %15, i32* %3
br label %24
16: ; preds = %2
%17 = load i64, i64* %4
%18 = add nsw i64 %17, 2064
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = icmp ne i64 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
store i32 %23, i32* %3
br label %24
24: ; preds = %16, %8
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @I2CSlaveIntStatus(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i64 2064, i64 2068
%5 = add nsw i64 %4, %0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
int test_imm_5Auint16_mem(unsigned short *val) {
  return ((*val) & (-0x5A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Auint16_mem>:
movzwl (%rdi),%eax
test   $0xffa6,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -90
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t le_short(uint32_t x) {
  uint32_t val;
  uint8_t *p = (uint8_t *)(&x);
  val = (*p++ & 0xff) << 0;
  val |= (*p++ & 0xff) << 8;
  val |= (*p++ & 0xff) << 16;
  val |= (*p & 0xff) << 24;
  return val;
}


x86 assembly (clang, -O0):
<le_short>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
and    $0xff,%eax
shl    $0x0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
and    $0xff,%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
and    $0xff,%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
shl    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @le_short(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int arith_shift_left(int, int);
void uc2i_array(unsigned char *src, int count, int *dest) {
  while (--count >= 0) {
    dest[count] = arith_shift_left(((int)src[count]) - 128, 24);
  };
}


x86 assembly (clang, -O0):
<uc2i_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1163 <uc2i_array+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
sub    $0x80,%edi
mov    $0x18,%esi
call   1030 <arith_shift_left@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1123 <uc2i_array+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc2i_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1154 <uc2i_array+0x44>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%ebx
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%r12d
movzbl (%r15,%r12,1),%edi
add    $0xffffff80,%edi
mov    $0x18,%esi
call   1030 <arith_shift_left@plt>
mov    %eax,(%r14,%r12,4)
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <uc2i_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @uc2i_array(i8* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %9, %7 ]
%9 = add nsw i64 %8, -1
%10 = and i64 %9, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, -128
%15 = tail call i32 @arith_shift_left(i32 %14, i32 24)
%16 = getelementptr inbounds i32, i32* %2, i64 %10
store i32 %15, i32* %16
%17 = icmp ugt i64 %8, 1
br i1 %17, label %7, label %18
18: ; preds = %7, %3
ret void
}
void trace_flush(void) {}


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

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

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

LLVM IR (-O2):
define void @trace_flush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
foo() { printf("foo is called\n"); }


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

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

LLVM IR (-O2):
@str = [14 x i8] c"foo is called\00"
define i32 @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct zdap_ioctl {
  int dummy;
};
struct ifreq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_ioctl(int, struct ifreq *);
int read_mem(int sock, struct ifreq *req) {
  struct zdap_ioctl *zdreq = 0;
  int i;
  if (!set_ioctl(sock, req))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<read_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <set_ioctl@plt>
cmp    $0x0,%eax
jne    1148 <read_mem+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <read_mem+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mem>:
push   %rax
call   1030 <set_ioctl@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ifreq = type { i32 }
%struct.zdap_ioctl = type { i32 }
define i32 @read_mem(i32 %0, %struct.ifreq* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.ifreq*
%6 = alloca %struct.zdap_ioctl*
%7 = alloca i32
store i32 %0, i32* %4
store %struct.ifreq* %1, %struct.ifreq** %5
store %struct.zdap_ioctl* null, %struct.zdap_ioctl** %6
%8 = load i32, i32* %4
%9 = load %struct.ifreq*, %struct.ifreq** %5
%10 = call i32 @set_ioctl(i32 %8, %struct.ifreq* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.ifreq = type { i32 }
%struct.zdap_ioctl = type { i32 }
define i32 @read_mem(i32 %0, %struct.ifreq* %1) {
%3 = tail call i32 @set_ioctl(i32 %0, %struct.ifreq* %1)
%4 = icmp eq i32 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int nondet();
int main() {
  int i, n;
  n = nondet();
  for (i = 0; i < n; i++) {
    nondet();
  }
  assert(i >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <nondet@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <main+0x41>
mov    $0x0,%al
call   1030 <nondet@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <nondet@plt>
test   %eax,%eax
jle    113c <main+0x1c>
mov    %eax,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <nondet@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 0, %0 ]
%5 = tail call i32 (...) @nondet()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %1
br i1 %7, label %8, label %3
8: ; preds = %3, %0
%9 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ cset82(unsigned char const *, int const, int /*<<< orphan*/, int,
                  int, int *, int *, char *);
int x1__30(const unsigned char *data, const int data_len, int *p_err_no,
           int *p_err_posn, char err_msg[50]) {
  return data_len >= 1 && data_len <= 30 &&
         cset82(data, data_len, 0, 1, 30, p_err_no, p_err_posn, err_msg);
}


x86 assembly (clang, -O0):
<x1__30>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jl     1181 <x1__30+0x71>
xor    %eax,%eax
cmpl   $0x1e,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jg     1181 <x1__30+0x71>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x1e,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <cset82@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x1__30>:
mov    %rcx,%r10
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cmp    $0x1d,%ecx
ja     114d <x1__30+0x3d>
push   %rax
mov    %r8,%r11
mov    %rdx,%r9
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x1e,%r8d
push   %r11
push   %r10
call   1030 <cset82@plt>
add    $0x10,%rsp
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @x1__30(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %24
13: ; preds = %5
%14 = load i32, i32* %7
%15 = icmp sle i32 %14, 30
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i32*, i32** %8
%20 = load i32*, i32** %9
%21 = load i8*, i8** %10
%22 = call i64 @cset82(i8* %17, i32 %18, i32 0, i32 1, i32 30, i32* %19, i32* %20, i8* %21)
%23 = icmp ne i64 %22, 0
br label %24
24: ; preds = %16, %13, %5
%25 = phi i1 [ false, %13 ], [ false, %5 ], [ %23, %16 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @x1__30(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = add i32 %1, -1
%7 = icmp ult i32 %6, 30
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @cset82(i8* %0, i32 %1, i32 0, i32 1, i32 30, i32* %2, i32* %3, i8* %4)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
double f3(double x, double y) {
  return (x * (-1.0 / 12)) * __builtin_copysign(1.0, y);
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xf0a(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xed9(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xede(%rip),%xmm2
por    %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mulsd  0xef8(%rip),%xmm0
andpd  0xf00(%rip),%xmm1
orpd   0xf08(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f3(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double %5, 0xBFB5555555555555
%7 = load double, double* %4
%8 = call double @llvm.copysign.f64(double 1.000000e+00, double %7)
%9 = fmul double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f3(double %0, double %1) {
%3 = fmul double %0, 0xBFB5555555555555
%4 = tail call double @llvm.copysign.f64(double 1.000000e+00, double %1)
%5 = fmul double %3, %4
ret double %5
}
/* Variables and functions */
scalar_t__ eMalloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
extern char *eStrndup(const char *str, size_t len) {
  char *result = (char *)eMalloc((size_t)(len + 1) * sizeof(char));
  strncpy(result, str, len);
  result[len] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<eStrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1040 <eMalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eStrndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <eMalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @eStrndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = mul i64 %7, 1
%9 = call i64 @eMalloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @strncpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %5
%16 = load i64, i64* %4
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @eStrndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @eMalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
%7 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_RED_LED_PIN() { clear_io_bit(0x37, 7); }


x86 assembly (clang, -O0):
<TOSH_CLR_RED_LED_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x37,%edi
mov    $0x7,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_RED_LED_PIN>:
mov    $0x37,%edi
mov    $0x7,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_RED_LED_PIN() {
%1 = call i32 @clear_io_bit(i32 55, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_RED_LED_PIN() {
%1 = tail call i32 @clear_io_bit(i32 55, i32 7)
ret void
}
AX0AX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((((unsigned int *)10000000)[x0]) <= (((unsigned int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    (%rax,%rcx,4),%eax
movslq -0x14(%rbp),%rdx
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
ja     1142 <AX0AX1+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <AX0AX1+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AX1>:
movslq %edx,%rax
mov    0x989680(,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(,%rcx,4),%edx
setbe  %al
ret

LLVM IR (-O0):
define i32 @AX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %19
%21 = load i32, i32* %20
%22 = icmp ule i32 %17, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @AX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %10
%12 = load i32, i32* %11
%13 = icmp ule i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_str(char *str, char *arg) {
  puts(str);
  puts(" ");
  puts(arg);
  puts("\n");
}


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

x86 assembly (clang, -O2):
<print_str>:
push   %rbx
mov    %rsi,%rbx
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_str(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 = call i32 @puts(i8* %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %4
%9 = call i32 @puts(i8* %8)
%10 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) %1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_ADint8_reg(signed char val) {
  return ((val) & (0xAD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ADint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xad,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_ADint8_reg(i8 signext %0) {
%2 = and i8 %0, -83
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float log10f(float);
float linearToDb(float linear) { return 20.f * log10f(linear); }


x86 assembly (clang, -O0):
<linearToDb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log10f@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearToDb>:
push   %rax
call   1030 <log10f@plt>
mulss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @linearToDb(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @log10f(float %3)
%5 = fmul float 2.000000e+01, %4
ret float %5
}

LLVM IR (-O2):
define float @linearToDb(float %0) {
%2 = tail call float @log10f(float %0)
%3 = fmul float %2, 2.000000e+01
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_time() {
  static char date[32];
  struct tm *timeinfo;
  time_t newtime;
  time(&newtime);
  timeinfo = localtime(&newtime);
  strftime(date, 32, "%d/%b/%Y-%H:%M:%S", timeinfo);
  return date;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0x2ef7(%rip),%rdi
mov    $0x20,%esi
lea    0xe9b(%rip),%rdx
call   1050 <strftime@plt>
lea    0x2edf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@get_time.date = internal global [32 x i8] zeroinitializer
@.str = [18 x i8] c"%d/%b/%Y-%H:%M:%S\00"
define i8* @get_time() {
%1 = alloca %struct.tm*
%2 = alloca i32
%3 = call i32 @time(i32* %2)
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %1
%5 = load %struct.tm*, %struct.tm** %1
%6 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_time.date, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_time.date, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@get_time.date = internal global [32 x i8] zeroinitializer
@.str = [18 x i8] c"%d/%b/%Y-%H:%M:%S\00"
define i8* @get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_time.date, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_time.date, i64 0, i64 0)
}