xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char wb_smsc_wdt_get_timeout();
int wb_smsc_wdt_status(void) {
  int tmp___0;
  unsigned char tmp___1;
  {
    tmp___1 = wb_smsc_wdt_get_timeout();
    if ((int)tmp___1 == 0) {
      tmp___0 = 0;
    } else {
      tmp___0 = 32768;
    }
    return (tmp___0);
  }
}


x86 assembly (clang, -O0):
<wb_smsc_wdt_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wb_smsc_wdt_get_timeout@plt>
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    113b <wb_smsc_wdt_status+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <wb_smsc_wdt_status+0x32>
movl   $0x8000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wb_smsc_wdt_status>:
push   %rax
xor    %eax,%eax
call   1030 <wb_smsc_wdt_get_timeout@plt>
xor    %ecx,%ecx
test   %al,%al
setne  %cl
shl    $0xf,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wb_smsc_wdt_status() {
%1 = alloca i32
%2 = alloca i8
%3 = call zeroext i8 (...) @wb_smsc_wdt_get_timeout()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %9
8: ; preds = %0
store i32 32768, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @wb_smsc_wdt_status() {
%1 = tail call zeroext i8 (...) @wb_smsc_wdt_get_timeout()
%2 = icmp eq i8 %1, 0
%3 = select i1 %2, i32 0, i32 32768
ret i32 %3
}
void delay(unsigned int count) {
  volatile unsigned int i;
  for (i = count; i != 0; i--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     112c <delay+0x2c>
jmp    111e <delay+0x1e>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110d <delay+0xd>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    %edi,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
je     111c <delay+0x1c>
nopl   0x0(%rax,%rax,1)
addl   $0xffffffff,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jne    1110 <delay+0x10>
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 %0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add i32 %7, -1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ putchar(int);
int getche(void) {
  int kbdinput;
  kbdinput = getch();
  putchar(kbdinput);
  return (kbdinput);
}


x86 assembly (clang, -O0):
<getche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getche>:
push   %rbx
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getche() {
%1 = alloca i32
%2 = call i32 (...) @getch()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @putchar(i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @getche() {
%1 = tail call i32 (...) @getch()
%2 = tail call i32 @putchar(i32 %1)
ret i32 %1
}
int heap_maximum(int *A) { return A[0]; }


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

x86 assembly (clang, -O2):
<heap_maximum>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @heap_maximum(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
float min(float a, float b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <min+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
unsigned xrop3_80_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~D;
  stk1 = T & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_80_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_80_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x8,%esi
not    %eax
and    %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_80_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = load i32, i32* %9
%26 = and i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = xor i32 %28, -1
%30 = and i32 %27, %29
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = or i32 %30, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_80_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
unsigned long get_ds() {
  unsigned short _v;
  __asm__("mov %%ds,%%ax" : "=a"(_v) :);
  return _v;
}


x86 assembly (clang, -O0):
<get_ds>:
push   %rbp
mov    %rsp,%rbp
mov    %ds,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ds>:
mov    %ds,%ax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i64 @get_ds() {
%1 = alloca i16
%2 = call i16 asm "mov %ds,%ax", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = zext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_ds() {
%1 = tail call i16 asm "mov %ds,%ax", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = zext i16 %1 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
char toupper(int /*<<< orphan*/);
char ask(void) {
  char c;
  printf("\n\nJust say it man, Yes or No? %c", 16);
  fflush(stdin);
  c = toupper(getchar());
  if (c == 'Y')
    return (c);
  else
    return ('N');
}


x86 assembly (clang, -O0):
<ask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x10,%esi
call   1040 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x59,%eax
jne    1190 <ask+0x50>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1194 <ask+0x54>
movb   $0x4e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x10,%esi
call   1040 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
cmp    $0x59,%al
mov    $0x59,%ecx
mov    $0x4e,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0A\0AJust say it man, Yes or No? %c\00"
@stdin = global i32 0
define signext i8 @ask() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 16)
%4 = load i32, i32* @stdin
%5 = call i32 @fflush(i32 %4)
%6 = call i32 (...) @getchar()
%7 = call signext i8 @toupper(i32 %6)
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 89
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = load i8, i8* %2
store i8 %12, i8* %1
br label %14
13: ; preds = %0
store i8 78, i8* %1
br label %14
14: ; preds = %13, %11
%15 = load i8, i8* %1
ret i8 %15
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A\0AJust say it man, Yes or No? %c\00"
@stdin = global i32 0
define signext i8 @ask() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 16)
%2 = load i32, i32* @stdin
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @getchar()
%5 = tail call signext i8 @toupper(i32 %4)
%6 = icmp eq i8 %5, 89
%7 = select i1 %6, i8 89, i8 78
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(int argc, char **argv) {
  printf("%l %l %l %l\n", sizeof(int), sizeof(long), sizeof(long long),
         sizeof(time_t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x4,%r8d
mov    $0x8,%ecx
mov    %r8d,%esi
mov    %ecx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
mov    $0x8,%ecx
mov    $0x4,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%l %l %l %l\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 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4, i32 8, i32 8, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%l %l %l %l\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4, i32 8, i32 8, i32 4)
ret i32 0
}
/* Type definitions */
struct search_context {
  int dummy;
};

/* Variables and functions */
int _search(struct search_context *, int, int /*<<< orphan*/ *,
            int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int search(struct search_context *c, int target) {
  if (!c)
    return -1;
  return _search(c, target, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <search+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <search+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <_search@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
test   %rdi,%rdi
je     1121 <search+0x11>
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <_search@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.search_context = type { i32 }
define i32 @search(%struct.search_context* %0, i32 %1) {
%3 = icmp eq %struct.search_context* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @_search(%struct.search_context* %0, i32 %1, i32* null, i32* null, i32* null)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Variables and functions */
int bits(int);
int /*<<< orphan*/ format(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main() {
  char s[] = "good morNinG, everyONe.";
  puts(format(s));
  printf("%d\n", bits(1234567));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <format@plt>
mov    %eax,%edi
call   1030 <puts@plt>
mov    $0x12d687,%edi
call   1060 <bits@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x2e654e4f797265,%rax
mov    %rax,0x10(%rsp)
mov    %rsp,%rdi
call   1050 <format@plt>
mov    %eax,%edi
call   1030 <puts@plt>
mov    $0x12d687,%edi
call   1060 <bits@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [24 x i8] c"good morNinG, everyONe.\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [24 x i8]
store i32 0, i32* %1
%3 = bitcast [24 x i8]* %2 to i8*
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%5 = call i32 @format(i8* %4)
%6 = call i32 @puts(i32 %5)
%7 = call i32 @bits(i32 1234567)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [24 x i8] c"good morNinG, everyONe.\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [24 x i8]
%2 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%3 = call i32 @format(i8* %2)
%4 = call i32 @puts(i32 %3)
%5 = call i32 @bits(i32 1234567)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_file2() {
  printf("Do you want to insert another file? (yes/no): ");
  return;
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"Do you want to insert another file? (yes/no): \00"
define void @msg_file2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Do you want to insert another file? (yes/no): \00"
define void @msg_file2() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
int func(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<func>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int muldiv64(int m1, int m2, int d) {
  int result;
  int dummy;
  __asm__("imull %%edx\n\t"
          "idivl %4\n\t"
          : "=a"(result), "=d"(dummy)
          : "0"(m1), "1"(m2), "g"(d));
  return result;
}


x86 assembly (clang, -O0):
<muldiv64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
imul   %edx
idivl  -0x18(%rbp)
mov    %eax,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<muldiv64>:
mov    %edi,%eax
mov    %edx,-0x4(%rsp)
mov    %esi,%edx
imul   %edx
idivl  -0x4(%rsp)
ret

LLVM IR (-O0):
define i32 @muldiv64(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
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call { i32, i32 } asm "imull %edx\0A\09idivl $4\0A\09", "={ax},={dx},0,1,imr,~{dirflag},~{fpsr},~{flags}"(i32 %9, i32 %10, i32 %11)
%13 = extractvalue { i32, i32 } %12, 0
%14 = extractvalue { i32, i32 } %12, 1
store i32 %13, i32* %7
store i32 %14, i32* %8
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @muldiv64(i32 %0, i32 %1, i32 %2) {
%4 = tail call { i32, i32 } asm "imull %edx\0A\09idivl $4\0A\09", "={ax},={dx},0,1,imr,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1, i32 %2)
%5 = extractvalue { i32, i32 } %4, 0
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
int main() {
  char p[] = "foobar";
  int len, len2;
  len = strlen(p);
  p[0] = 'O';
  len2 = strlen(p);
  return len - len2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movb   $0x4f,-0xb(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movl   $0x726162,0x3(%rsp)
movl   $0x626f6f66,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
movb   $0x4f,(%rsp)
mov    %rbx,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.p = [7 x i8] c"foobar\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [7 x i8]* %2 to i8*
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %3
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
store i8 79, i8* %8
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
@__const.main.p = [7 x i8] c"foobar\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
store i8 79, i8* %2
%4 = call i32 @strlen(i8* %2)
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
struct in_addr {
  int dummy;
};
struct hostent {
  scalar_t__ h_addr;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
scalar_t__ inet_ntoa(struct in_addr);
char *n_nslookup(char *addr) {
  struct hostent *h;
  if ((h = gethostbyname(addr)) == NULL) {
    return addr;
  }
  return (char *)inet_ntoa(*((struct in_addr *)h->h_addr));
}


x86 assembly (clang, -O0):
<n_nslookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gethostbyname@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1150 <n_nslookup+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <n_nslookup+0x42>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_nslookup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <gethostbyname@plt>
test   %rax,%rax
je     113b <n_nslookup+0x1b>
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hostent = type { i64 }
%struct.in_addr = type { i32 }
define i8* @n_nslookup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca %struct.hostent*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.hostent* @gethostbyname(i8* %5)
store %struct.hostent* %6, %struct.hostent** %4
%7 = icmp eq %struct.hostent* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %2
br label %19
10: ; preds = %1
%11 = load %struct.hostent*, %struct.hostent** %4
%12 = getelementptr inbounds %struct.hostent, %struct.hostent* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = inttoptr i64 %13 to %struct.in_addr*
%15 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i64 @inet_ntoa(i32 %16)
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %2
br label %19
19: ; preds = %10, %8
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
%struct.hostent = type { i64 }
%struct.in_addr = type { i32 }
define i8* @n_nslookup(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
%3 = icmp eq %struct.hostent* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.hostent, %struct.hostent* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to %struct.in_addr*
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i64 @inet_ntoa(i32 %9)
%11 = inttoptr i64 %10 to i8*
br label %12
12: ; preds = %1, %4
%13 = phi i8* [ %11, %4 ], [ %0, %1 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ft_strconcat(char *, char *);
char *ft_concator(char *s1, char *s2) {
  char *s3;
  s3 = ft_strconcat(s1, s2);
  free(s1);
  free(s2);
  return (s3);
}


x86 assembly (clang, -O0):
<ft_concator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ft_strconcat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_concator>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <ft_strconcat@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @ft_concator(i8* %0, i8* %1) {
%3 = tail call i8* @ft_strconcat(i8* %0, i8* %1)
%4 = tail call i32 @free(i8* %0)
%5 = tail call i32 @free(i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _assert_true(unsigned long, char *, char *, int);
int /*<<< orphan*/ free(void *);
void free_value(const void *value, void *cleanup_value_data) {
  (void)cleanup_value_data;
  _assert_true(((unsigned long int)(((uintptr_t)((size_t)(value))))), "value",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/mrdmnd/streamgeo/refs/heads/"
               "master/cstreamgeo/tests/vendor/cmocka/cmocka.c",
               533);
  free((void *)value);
}


x86 assembly (clang, -O0):
<free_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    $0x215,%ecx
call   1040 <_assert_true@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_value>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
lea    0xed4(%rip),%rdx
mov    $0x215,%ecx
call   1040 <_assert_true@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"value\00"
@.str.1 = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mrdmnd/streamgeo/refs/heads/master/cstreamgeo/tests/vendor/cmocka/cmocka.c\00"
define void @free_value(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @_assert_true(i64 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str.1, i64 0, i64 0), i32 533)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"value\00"
@.str.1 = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mrdmnd/streamgeo/refs/heads/master/cstreamgeo/tests/vendor/cmocka/cmocka.c\00"
define void @free_value(i8* %0, i8* nocapture readnone %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @_assert_true(i64 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str.1, i64 0, i64 0), i32 533)
%5 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int int32_t;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int BIO_seek(int /*<<< orphan*/ *, int);
int32_t BioSeek(BIO *bio, int32_t ofs) {
  if (!bio) {
    return -1;
  }
  return BIO_seek(bio, ofs);
}


x86 assembly (clang, -O0):
<BioSeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <BioSeek+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <BioSeek+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <BIO_seek@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BioSeek>:
test   %rdi,%rdi
je     111a <BioSeek+0xa>
jmp    1030 <BIO_seek@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @BioSeek(i32* %0, i32 %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @BIO_seek(i32* %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int yyerror(const char *msg) {
  fprintf(stderr, "Error: %s\n", msg);
  return 0;
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dlopen(char *, int);
uintptr_t dlopen4029(char *name, int flags) {
  return (uintptr_t)(dlopen(name, flags));
}


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

x86 assembly (clang, -O2):
<dlopen4029>:
push   %rax
call   1030 <dlopen@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @dlopen4029(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @dlopen(i8* %5, i32 %6)
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @dlopen4029(i8* %0, i32 %1) {
%3 = tail call i32 @dlopen(i8* %0, i32 %1)
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int s(int);
int main() {
  if (s(2) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <s@plt>
cmp    $0x1,%eax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <s@plt>
cmp    $0x1,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @s(i32 2)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @s(i32 2)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void ScaleAddRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleAddRow_C() {
ret void
}
void pam_end(void) {}


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

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

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

LLVM IR (-O2):
define void @pam_end() {
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, void *);
void gettime(double *t) {
  struct timeval tv;
  gettimeofday(&tv, (void *)0);
  *t = tv.tv_sec + 1.0e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xec5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xed0(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define void @gettime(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
store double* %0, double** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i8* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%8 = load double, double* %7
%9 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %8, double %6)
%10 = load double*, double** %2
store double %9, double* %10
ret void
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define void @gettime(double* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i8* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %6)
store double %9, double* %0
ret void
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while (*s) {
    if ((*s) == c)
      return (char *)s;
    s++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <strchr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <strchr+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
unsigned char get_flag(unsigned char flag, unsigned char pos) {
  return (flag >> pos) & 1;
}


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

x86 assembly (clang, -O2):
<get_flag>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_flag(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = ashr i32 %6, %8
%10 = and i32 %9, 1
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @get_flag(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = lshr i32 %3, %4
%6 = trunc i32 %5 to i8
%7 = and i8 %6, 1
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ emit_andimm(int, int, int);
void emit_movzwl_reg(int rs, int rt) { emit_andimm(rs, 0xffff, rt); }


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

x86 assembly (clang, -O2):
<emit_movzwl_reg>:
mov    %esi,%edx
mov    $0xffff,%esi
jmp    1030 <emit_andimm@plt>

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

LLVM IR (-O2):
define void @emit_movzwl_reg(i32 %0, i32 %1) {
%3 = tail call i32 @emit_andimm(i32 %0, i32 65535, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEreturn(int /*<<< orphan*/ *);
void code_return() { appendCODE(makeCODEreturn(NULL)); }


x86 assembly (clang, -O0):
<code_return>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <makeCODEreturn@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_return>:
push   %rax
xor    %edi,%edi
call   1040 <makeCODEreturn@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <appendCODE@plt>

LLVM IR (-O0):
define void @code_return() {
%1 = call i32 @makeCODEreturn(i32* null)
%2 = call i32 @appendCODE(i32 %1)
ret void
}

LLVM IR (-O2):
define void @code_return() {
%1 = tail call i32 @makeCODEreturn(i32* null)
%2 = tail call i32 @appendCODE(i32 %1)
ret void
}
int f(char x) {
  int y = 1;
  return y << (x - 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 1, i32* %3
%4 = load i32, i32* %3
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 1
%8 = shl i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -1
%4 = shl nuw i32 1, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PWM1_FAULT_DriverIRQHandler();
__attribute__((weak)) void PWM1_FAULT_IRQHandler(void) {
  PWM1_FAULT_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM1_FAULT_IRQHandler() {
%1 = call i32 (...) @PWM1_FAULT_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM1_FAULT_IRQHandler() {
%1 = tail call i32 (...) @PWM1_FAULT_DriverIRQHandler()
ret void
}
void print_decimal(double value, int size, int is_bit) {
  char temp[128];
  (void)printf("%*s ", size, decimal_to_string(value, temp, size, is_bit));
}


x86 assembly (clang, -O0):
<print_decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x94(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x90(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x1,%al
call   1030 <decimal_to_string@plt>
mov    -0x94(%rbp),%esi
mov    %eax,%edx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_decimal>:
push   %rbx
sub    $0x80,%rsp
mov    %esi,%edx
mov    %edi,%ebx
mov    %rsp,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1030 <decimal_to_string@plt>
lea    0xec1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%*s \00"
define void @print_decimal(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca [128 x i8]
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load double, double* %4
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 (double, i8*, i32, i32, ...) bitcast (i32 (...)* @decimal_to_string to i32 (double, i8*, i32, i32, ...)*)(double %9, i8* %10, i32 %11, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%*s \00"
define void @print_decimal(double %0, i32 %1, i32 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 (double, i8*, i32, i32, ...) bitcast (i32 (...)* @decimal_to_string to i32 (double, i8*, i32, i32, ...)*)(double %0, i8* %5, i32 %1, i32 %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int vocal(int);
int main() {
  printf("%d", vocal('a'));
  printf("%d", vocal('A'));
  printf("%d", vocal(1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1040 <vocal@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x41,%edi
call   1040 <vocal@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <vocal@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x61,%edi
call   1040 <vocal@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x41,%edi
call   1040 <vocal@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <vocal@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @vocal(i32 97)
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @vocal(i32 65)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @vocal(i32 1)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @vocal(i32 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @vocal(i32 65)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @vocal(i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int minsum(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int arr[] = {4, 2, 3, 5, 1, 6, 2, 4};
  int sum = minsum(arr, sizeof(arr) / sizeof(int));
  printf("sum = %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <minsum@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <minsum@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [8 x i32] [i32 4, i32 2, i32 3, i32 5, i32 1, i32 6, i32 2, i32 4]
@.str = [10 x i8] c"sum = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = call i32 @minsum(i32* %5, i32 8)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [8 x i32] [i32 4, i32 2, i32 3, i32 5, i32 1, i32 6, i32 2, i32 4]
@.str = [10 x i8] c"sum = %d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @minsum(i32* %3, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}