xunge/DecIR huggingface dataset:
char *strcpy(char *dest, const char *src) {
  char *point = dest;
  while ((*dest++ = *src++) != '\0')
    ;
  return point;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

LLVM IR (-O0):
define i8* @strcpy(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
store i8* %6, i8** %5
br label %7
7: ; preds = %15, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = sext i8 %10 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %7
br label %7
16: ; preds = %7
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void eeprom_delay(int nsec) {
  extern void polled_delay(int usec);
  polled_delay(nsec);
}


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

x86 assembly (clang, -O2):
<eeprom_delay>:
jmp    1030 <polled_delay@plt>

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

LLVM IR (-O2):
define void @eeprom_delay(i32 %0) {
tail call void @polled_delay(i32 %0)
ret void
}
/* Variables and functions */
double fmod(double, double);
double cp_pr(double cp, double pr_cyc) {
  return fmod(cp - pr_cyc + ((double)1500.0L), ((double)3000.0L)) -
         ((double)1500.0L);
}


x86 assembly (clang, -O0):
<cp_pr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xeb3(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_pr>:
push   %rax
subsd  %xmm1,%xmm0
addsd  0xee3(%rip),%xmm0
movsd  0xee3(%rip),%xmm1
call   1030 <fmod@plt>
addsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cp_pr(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 = load double, double* %4
%7 = fsub double %5, %6
%8 = fadd double %7, 1.500000e+03
%9 = call double @fmod(double %8, double 3.000000e+03)
%10 = fsub double %9, 1.500000e+03
ret double %10
}

LLVM IR (-O2):
define double @cp_pr(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fadd double %3, 1.500000e+03
%5 = tail call double @fmod(double %4, double 3.000000e+03)
%6 = fadd double %5, -1.500000e+03
ret double %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ _color_set_8(int, int);
void vt_color_bg_set_8(uint8_t color) {
  if (color > 215) {
    return;
  }
  _color_set_8(48, color);
}


x86 assembly (clang, -O0):
<vt_color_bg_set_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xd7,-0x4(%rbp)
jle    112d <vt_color_bg_set_8+0x1d>
jmp    113a <vt_color_bg_set_8+0x2a>
mov    -0x4(%rbp),%esi
mov    $0x30,%edi
call   1030 <_color_set_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_color_bg_set_8>:
cmp    $0xd7,%edi
jle    1119 <vt_color_bg_set_8+0x9>
ret
mov    %edi,%esi
mov    $0x30,%edi
jmp    1030 <_color_set_8@plt>

LLVM IR (-O0):
define void @vt_color_bg_set_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 215
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @_color_set_8(i32 48, i32 %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @vt_color_bg_set_8(i32 %0) {
%2 = icmp sgt i32 %0, 215
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @_color_set_8(i32 48, i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int yyerror() {
  printf("\nERROR!!\n");
  return (1);
}


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

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [9 x i8] c"\0AERROR!!\00"
define i32 @yyerror() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ bus_init();
int /*<<< orphan*/ bus_shutdown();
int /*<<< orphan*/ bus_writebyte(int, int);
scalar_t__ do_menu();
int /*<<< orphan*/ dump_registers();
int main() {
  bus_init();
  while (1) {
    if (do_menu())
      break;
  }
  dump_registers();
  bus_writebyte(0x78, 0x0);
  bus_writebyte(0x7A, 0x0);
  bus_writebyte(0xBC, 0x0);
  bus_writebyte(0xBE, 0x0);
  bus_shutdown();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <bus_init@plt>
mov    $0x0,%al
call   1040 <do_menu@plt>
cmp    $0x0,%rax
je     117c <main+0x2c>
jmp    1181 <main+0x31>
jmp    1166 <main+0x16>
mov    $0x0,%al
call   1060 <dump_registers@plt>
mov    $0x78,%edi
xor    %esi,%esi
call   1030 <bus_writebyte@plt>
mov    $0x7a,%edi
xor    %esi,%esi
call   1030 <bus_writebyte@plt>
mov    $0xbc,%edi
xor    %esi,%esi
call   1030 <bus_writebyte@plt>
mov    $0xbe,%edi
xor    %esi,%esi
call   1030 <bus_writebyte@plt>
mov    $0x0,%al
call   1050 <bus_shutdown@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <bus_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <do_menu@plt>
test   %rax,%rax
je     1160 <main+0x10>
xor    %eax,%eax
call   1060 <dump_registers@plt>
mov    $0x78,%edi
xor    %esi,%esi
call   1030 <bus_writebyte@plt>
mov    $0x7a,%edi
xor    %esi,%esi
call   1030 <bus_writebyte@plt>
mov    $0xbc,%edi
xor    %esi,%esi
call   1030 <bus_writebyte@plt>
mov    $0xbe,%edi
xor    %esi,%esi
call   1030 <bus_writebyte@plt>
xor    %eax,%eax
call   1050 <bus_shutdown@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bus_init()
br label %3
3: ; preds = %0, %7
%4 = call i64 (...) @do_menu()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %8
7: ; preds = %3
br label %3
8: ; preds = %6
%9 = call i32 (...) @dump_registers()
%10 = call i32 @bus_writebyte(i32 120, i32 0)
%11 = call i32 @bus_writebyte(i32 122, i32 0)
%12 = call i32 @bus_writebyte(i32 188, i32 0)
%13 = call i32 @bus_writebyte(i32 190, i32 0)
%14 = call i32 (...) @bus_shutdown()
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bus_init()
br label %2
2: ; preds = %2, %0
%3 = tail call i64 (...) @do_menu()
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 (...) @dump_registers()
%7 = tail call i32 @bus_writebyte(i32 120, i32 0)
%8 = tail call i32 @bus_writebyte(i32 122, i32 0)
%9 = tail call i32 @bus_writebyte(i32 188, i32 0)
%10 = tail call i32 @bus_writebyte(i32 190, i32 0)
%11 = tail call i32 (...) @bus_shutdown()
ret i32 0
}
void gtk_notebook_set_show_tabs() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_set_show_tabs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ptcoords_init();
int /*<<< orphan*/ pthashes_init();
void __attribute__((constructor)) spatial_init(void) {
  ptcoords_init();
  pthashes_init();
}


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

x86 assembly (clang, -O2):
<spatial_init>:
push   %rax
xor    %eax,%eax
call   1040 <ptcoords_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <pthashes_init@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @spatial_init, i8* null }]
define void @spatial_init() {
%1 = call i32 (...) @ptcoords_init()
%2 = call i32 (...) @pthashes_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @spatial_init, i8* null }]
define void @spatial_init() {
%1 = tail call i32 (...) @ptcoords_init()
%2 = tail call i32 (...) @pthashes_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ firstFactor();
int /*<<< orphan*/ term1();
void firstTerm() {
  firstFactor();
  term1();
}


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

x86 assembly (clang, -O2):
<firstTerm>:
push   %rax
xor    %eax,%eax
call   1030 <firstFactor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <term1@plt>

LLVM IR (-O0):
define void @firstTerm() {
%1 = call i32 (...) @firstFactor()
%2 = call i32 (...) @term1()
ret void
}

LLVM IR (-O2):
define void @firstTerm() {
%1 = tail call i32 (...) @firstFactor()
%2 = tail call i32 (...) @term1()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int ssize_t;

/* Variables and functions */
int __syscall(int, int, int /*<<< orphan*/, size_t, int /*<<< orphan*/,
              int /*<<< orphan*/, int /*<<< orphan*/);
int errno;
ssize_t write(int fd, const void *buf, size_t count) {
  int ret = __syscall(1, fd, (uint64_t)buf, count, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__syscall@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    116e <write+0x5e>
xor    %ecx,%ecx
sub    -0x1c(%rbp),%ecx
mov    0x2e80(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <write+0x64>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0x1,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__syscall@plt>
test   %eax,%eax
js     1136 <write+0x26>
pop    %rcx
ret
neg    %eax
mov    0x2ea1(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i32
%12 = load i64, i64* %7
%13 = call i32 @__syscall(i32 1, i32 %9, i32 %11, i64 %12, i32 0, i32 0, i32 0)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load i32, i32* %8
%18 = sub nsw i32 0, %17
store i32 %18, i32* @errno
store i32 -1, i32* %4
br label %21
19: ; preds = %3
%20 = load i32, i32* %8
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @__syscall(i32 1, i32 %0, i32 %5, i64 %2, i32 0, i32 0, i32 0)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sub nsw i32 0, %6
store i32 %9, i32* @errno
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ -1, %8 ], [ %6, %3 ]
ret i32 %11
}
int test_imm_89int64_midword_reg(long long val) {
  return ((val >> 16) & (0x89 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_89int64_midword_reg>:
test   $0x890000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_89int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 137
%6 = icmp ne i64 %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_89int64_midword_reg(i64 %0) {
%2 = and i64 %0, 8978432
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void vnc__init(struct framebuffer *fb) {}


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

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

LLVM IR (-O0):
%struct.framebuffer = type opaque
define void @vnc__init(%struct.framebuffer* %0) {
%2 = alloca %struct.framebuffer*
store %struct.framebuffer* %0, %struct.framebuffer** %2
ret void
}

LLVM IR (-O2):
%struct.framebuffer = type opaque
define void @vnc__init(%struct.framebuffer* nocapture %0) {
ret void
}
/* Type definitions */
struct multiboot {
  int dummy;
};

/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int twi_get_memtype(struct multiboot *mboot, const char *memname) {
  if (strcmp(memname, "flash") == 0)
    return 0x01;
  else if (strcmp(memname, "eeprom") == 0)
    return 0x02;
  return -1;
}


x86 assembly (clang, -O0):
<twi_get_memtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1146 <twi_get_memtype+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1178 <twi_get_memtype+0x68>
mov    -0x18(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    116c <twi_get_memtype+0x5c>
movl   $0x2,-0x4(%rbp)
jmp    1178 <twi_get_memtype+0x68>
jmp    1171 <twi_get_memtype+0x61>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twi_get_memtype>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <twi_get_memtype+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.multiboot = type { i32 }
@.str = [6 x i8] c"flash\00"
@.str.1 = [7 x i8] c"eeprom\00"
define i32 @twi_get_memtype(%struct.multiboot* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.multiboot*
%5 = alloca i8*
store %struct.multiboot* %0, %struct.multiboot** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %17
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 2, i32* %3
br label %17
15: ; preds = %10
br label %16
16: ; preds = %15
store i32 -1, i32* %3
br label %17
17: ; preds = %16, %14, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.multiboot = type { i32 }
@.str = [6 x i8] c"flash\00"
@.str.1 = [7 x i8] c"eeprom\00"
define i32 @twi_get_memtype(%struct.multiboot* nocapture readnone %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 2, i32 -1
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
int test_sorted_array(int *array, int size) {
  int i;
  for (i = 0; i < size - 2; i++) {
    if (array[i] > array[i + 1]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<test_sorted_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    1163 <test_sorted_array+0x63>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1150 <test_sorted_array+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116a <test_sorted_array+0x6a>
jmp    1155 <test_sorted_array+0x55>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <test_sorted_array+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sorted_array>:
add    $0xfffffffe,%esi
xor    %eax,%eax
test   %esi,%esi
cmovle %eax,%esi
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rsi
je     1128 <test_sorted_array+0x28>
mov    (%rdi,%rax,4),%ecx
lea    0x1(%rax),%rdx
cmp    0x4(%rdi,%rax,4),%ecx
mov    %rdx,%rax
jle    1110 <test_sorted_array+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @test_sorted_array(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -2
%4 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %9, %2
%7 = phi i64 [ %12, %9 ], [ 0, %2 ]
%8 = icmp eq i64 %7, %5
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = getelementptr inbounds i32, i32* %0, i64 %7
%11 = load i32, i32* %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp sgt i32 %11, %14
br i1 %15, label %16, label %6
16: ; preds = %6, %9
%17 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %17
}
/* Variables and functions */
scalar_t__ sn3218a_led_get_state(int);
int /*<<< orphan*/ sn3218a_led_turn_off(int);
int /*<<< orphan*/ sn3218a_led_turn_on(int);
void sn3218a_led_toggle(int led) {
  if (sn3218a_led_get_state(led))
    sn3218a_led_turn_off(led);
  else
    sn3218a_led_turn_on(led);
}


x86 assembly (clang, -O0):
<sn3218a_led_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sn3218a_led_get_state@plt>
cmp    $0x0,%rax
je     115a <sn3218a_led_toggle+0x2a>
mov    -0x4(%rbp),%edi
call   1040 <sn3218a_led_turn_off@plt>
jmp    1162 <sn3218a_led_toggle+0x32>
mov    -0x4(%rbp),%edi
call   1050 <sn3218a_led_turn_on@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sn3218a_led_toggle>:
push   %rbx
mov    %edi,%ebx
call   1030 <sn3218a_led_get_state@plt>
mov    %ebx,%edi
test   %rax,%rax
je     1145 <sn3218a_led_toggle+0x15>
pop    %rbx
jmp    1040 <sn3218a_led_turn_off@plt>
pop    %rbx
jmp    1050 <sn3218a_led_turn_on@plt>

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

LLVM IR (-O2):
define void @sn3218a_led_toggle(i32 %0) {
%2 = tail call i64 @sn3218a_led_get_state(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @sn3218a_led_turn_off(i32 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @sn3218a_led_turn_on(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ string_unit_test();
void run_unit_tests() { string_unit_test(); }


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

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

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

LLVM IR (-O2):
define void @run_unit_tests() {
%1 = tail call i32 (...) @string_unit_test()
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_set_structure(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(111, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_set_structure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x6f,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_set_structure>:
mov    $0x6f,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_set_structure() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 111, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_set_structure() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 111, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ old_seed();
int /*<<< orphan*/ seed_rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void seed(char *arg) {
  if (arg == NULL)
    seed_rand();
  else if (arg[0] == '.')
    old_seed();
  else
    srand(atoi(arg));
  return;
}


x86 assembly (clang, -O0):
<seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <seed+0x23>
mov    $0x0,%al
call   1030 <seed_rand@plt>
jmp    1194 <seed+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    117f <seed+0x3f>
mov    $0x0,%al
call   1050 <old_seed@plt>
jmp    118f <seed+0x4f>
mov    -0x8(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1040 <srand@plt>
jmp    1194 <seed+0x54>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed>:
push   %rax
test   %rdi,%rdi
je     1153 <seed+0x13>
cmpb   $0x2e,(%rdi)
jne    115b <seed+0x1b>
xor    %eax,%eax
pop    %rcx
jmp    1050 <old_seed@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <seed_rand@plt>
call   1060 <atoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
define void @seed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @seed_rand()
br label %20
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 46
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (...) @old_seed()
br label %19
15: ; preds = %7
%16 = load i8*, i8** %2
%17 = call i32 @atoi(i8* %16)
%18 = call i32 @srand(i32 %17)
br label %19
19: ; preds = %15, %13
br label %20
20: ; preds = %19, %5
ret void
}

LLVM IR (-O2):
define void @seed(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @seed_rand()
br label %13
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 46
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @old_seed()
br label %13
10: ; preds = %5
%11 = tail call i32 @atoi(i8* %0)
%12 = tail call i32 @srand(i32 %11)
br label %13
13: ; preds = %8, %10, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void another_function() { printf("You have caled another_function\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"You have caled another_function\0A\00"
define void @another_function() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"You have caled another_function\00"
define void @another_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ CDC_GetSerialState();
int /*<<< orphan*/ CDC_NotificationIn();
void USB_EndPoint1(uint32_t event) {
  uint16_t temp;
  static uint16_t serialState;
  switch (event) {
  case 3:
    temp = CDC_GetSerialState();
    if (serialState != temp) {
      serialState = temp;
      CDC_NotificationIn();
    }
    break;
  }
}


x86 assembly (clang, -O0):
<USB_EndPoint1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x3,%eax
jne    116a <USB_EndPoint1+0x4a>
jmp    113c <USB_EndPoint1+0x1c>
mov    $0x0,%al
call   1040 <CDC_GetSerialState@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ee8(%rip),%eax
cmp    -0x8(%rbp),%eax
je     1165 <USB_EndPoint1+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,0x2ed6(%rip)
mov    $0x0,%al
call   1030 <CDC_NotificationIn@plt>
jmp    116a <USB_EndPoint1+0x4a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USB_EndPoint1>:
push   %rax
cmp    $0x3,%edi
jne    1135 <USB_EndPoint1+0x15>
xor    %eax,%eax
call   1040 <CDC_GetSerialState@plt>
cmp    %eax,0x2f01(%rip)
jne    1137 <USB_EndPoint1+0x17>
pop    %rax
ret
mov    %eax,0x2ef7(%rip)
xor    %eax,%eax
pop    %rcx
jmp    1030 <CDC_NotificationIn@plt>

LLVM IR (-O0):
@USB_EndPoint1.serialState = internal global i32 0
define void @USB_EndPoint1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %14 [
i32 3, label %5
]
5: ; preds = %1
%6 = call i32 (...) @CDC_GetSerialState()
store i32 %6, i32* %3
%7 = load i32, i32* @USB_EndPoint1.serialState
%8 = load i32, i32* %3
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* %3
store i32 %11, i32* @USB_EndPoint1.serialState
%12 = call i32 (...) @CDC_NotificationIn()
br label %13
13: ; preds = %10, %5
br label %14
14: ; preds = %1, %13
ret void
}

LLVM IR (-O2):
@USB_EndPoint1.serialState = internal unnamed_addr global i32 0
define void @USB_EndPoint1(i32 %0) {
%2 = icmp eq i32 %0, 3
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = tail call i32 (...) @CDC_GetSerialState()
%5 = load i32, i32* @USB_EndPoint1.serialState
%6 = icmp eq i32 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %3
store i32 %4, i32* @USB_EndPoint1.serialState
%8 = tail call i32 (...) @CDC_NotificationIn()
br label %9
9: ; preds = %3, %7, %1
ret void
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t send(int, char const *, size_t, int /*<<< orphan*/);
int tracker_send_dgram(int sockfd, const char *buff, size_t len) {
  ssize_t sent = send(sockfd, buff, len, 0);
  if (sent < 0)
    return -1;
  assert(sent == len);
  return 0;
}


x86 assembly (clang, -O0):
<tracker_send_dgram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1160 <tracker_send_dgram+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <tracker_send_dgram+0x5c>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracker_send_dgram>:
push   %rbx
mov    %rdx,%rbx
xor    %ecx,%ecx
call   1030 <send@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tracker_send_dgram(i32 %0, i8* %1, i64 %2) {
%4 = tail call i64 @send(i32 %0, i8* %1, i64 %2, i32 0)
%5 = icmp eq i64 %4, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _ultoa(long, char *, unsigned char);
void _ltoa(long value, char *string, unsigned char radix) {
  if (value < 0 && radix == 10) {
    *string++ = '-';
    value = -value;
  }
  _ultoa(value, string, radix);
}


x86 assembly (clang, -O0):
<_ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1159 <_ltoa+0x49>
movzbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    1159 <_ltoa+0x49>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%edx
call   1030 <_ultoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ltoa>:
test   %rdi,%rdi
jns    1124 <_ltoa+0x14>
cmp    $0xa,%dl
jne    1124 <_ltoa+0x14>
movb   $0x2d,(%rsi)
add    $0x1,%rsi
neg    %rdi
movzbl %dl,%edx
jmp    1030 <_ultoa@plt>

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

LLVM IR (-O2):
define void @_ltoa(i64 %0, i8* %1, i8 zeroext %2) {
%4 = icmp slt i64 %0, 0
%5 = icmp eq i8 %2, 10
%6 = and i1 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%9 = sub nsw i64 0, %0
br label %10
10: ; preds = %7, %3
%11 = phi i8* [ %8, %7 ], [ %1, %3 ]
%12 = phi i64 [ %9, %7 ], [ %0, %3 ]
%13 = tail call i32 @_ultoa(i64 %12, i8* %11, i8 zeroext %2)
ret void
}
float check4(float x, float y) { return x * __builtin_copysignf(x, y); }


x86 assembly (clang, -O0):
<check4>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movaps 0xedc(%rip),%xmm3
pand   %xmm3,%xmm2
movaps 0xee1(%rip),%xmm3
pand   %xmm3,%xmm1
por    %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<check4>:
andps  0xef9(%rip),%xmm1
movaps 0xf02(%rip),%xmm2
andps  %xmm0,%xmm2
orps   %xmm1,%xmm2
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @check4(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* %3
%7 = load float, float* %4
%8 = call float @llvm.copysign.f32(float %6, float %7)
%9 = fmul float %5, %8
ret float %9
}

LLVM IR (-O2):
define float @check4(float %0, float %1) {
%3 = tail call float @llvm.copysign.f32(float %0, float %1)
%4 = fmul float %3, %0
ret float %4
}
void outb(unsigned char data, unsigned short port) {
  asm volatile("out %0, %1" : : "a"(data), "d"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "out $0, $1", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void sig_handle(void) {
  fflush(stdout);
  close(2);
  close(1);
  close(0);
  exit(0);
}


x86 assembly (clang, -O0):
<sig_handle>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x2,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1030 <close@plt>
xor    %edi,%edi
call   1030 <close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sig_handle>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x2,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1030 <close@plt>
xor    %edi,%edi
call   1030 <close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @sig_handle() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = call i32 @close(i32 2)
%4 = call i32 @close(i32 1)
%5 = call i32 @close(i32 0)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
define void @sig_handle() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = tail call i32 @close(i32 2)
%4 = tail call i32 @close(i32 1)
%5 = tail call i32 @close(i32 0)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
main() {
  int lower, upper, step;
  char c, line[1000];
  char esc = '\\';
  int i = 0;
  int limit = 1000 + 1;
  float eps = 1.0e-5;
  const double e = 2.71828182845905;
  const char msg[] = "warning: ";
  int strlen(const char[]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3b0,%rsp
movb   $0x5c,-0x401(%rbp)
movl   $0x0,-0x408(%rbp)
movl   $0x3e9,-0x40c(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0x410(%rbp)
ff
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x418(%rbp)
ff
mov    0xebf(%rip),%rax
mov    %rax,-0x422(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0x41a(%rbp)
xor    %eax,%eax
add    $0x3b0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.msg = [10 x i8] c"warning: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca [1000 x i8]
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca double
%11 = alloca [10 x i8]
store i8 92, i8* %6
store i32 0, i32* %7
store i32 1001, i32* %8
store float 0x3EE4F8B580000000, float* %9
store double 0x4005BF0A8B145774, double* %10
%12 = bitcast [10 x i8]* %11 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
pid_t getpgrp(void) { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @getpgrp() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpgrp() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
void pfun2(struct fun **z) {}


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

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

LLVM IR (-O0):
%struct.fun = type opaque
define void @pfun2(%struct.fun** %0) {
%2 = alloca %struct.fun**
store %struct.fun** %0, %struct.fun*** %2
ret void
}

LLVM IR (-O2):
%struct.fun = type opaque
define void @pfun2(%struct.fun** nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int inw(int);
int /*<<< orphan*/ outl(int, int);
uint16_t vrRead(uint16_t wClassIndex) {
  uint16_t wData;
  outl(((uint32_t)0xFC53 << 16) | wClassIndex, 0xAC1C);
  wData = inw(0xAC1E);
  return wData;
}


x86 assembly (clang, -O0):
<vrRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0xfc530000,%edi
mov    $0xac1c,%esi
call   1040 <outl@plt>
mov    $0xac1e,%edi
call   1030 <inw@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrRead>:
push   %rax
or     $0xfc530000,%edi
mov    $0xac1c,%esi
call   1040 <outl@plt>
mov    $0xac1e,%edi
pop    %rax
jmp    1030 <inw@plt>

LLVM IR (-O0):
define i32 @vrRead(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = or i32 -61669376, %4
%6 = call i32 @outl(i32 %5, i32 44060)
%7 = call i32 @inw(i32 44062)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @vrRead(i32 %0) {
%2 = or i32 %0, -61669376
%3 = tail call i32 @outl(i32 %2, i32 44060)
%4 = tail call i32 @inw(i32 44062)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ msgctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void remove_queue(int qid) { msgctl(qid, IPC_RMID, 0); }


x86 assembly (clang, -O0):
<remove_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <msgctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_queue>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <msgctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define void @remove_queue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @msgctl(i32 %3, i32 %4, i32 0)
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define void @remove_queue(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @msgctl(i32 %0, i32 %2, i32 0)
ret void
}
char charFix_default(char ch) {
  return ('a' <= ch && ch <= 'z' ? (ch ^ ' ') : ch);
}


x86 assembly (clang, -O0):
<charFix_default>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1137 <charFix_default+0x37>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1137 <charFix_default+0x37>
movsbl -0x1(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <charFix_default+0x3e>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charFix_default>:
lea    -0x61(%rdi),%eax
mov    %edi,%ecx
xor    $0x20,%cl
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @charFix_default(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = xor i32 %12, 32
br label %17
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @charFix_default(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = xor i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
const char *db_drop_jes_table_sql(void) {
  static const char *query = "DROP TABLE jes";
  return query;
}


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

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

LLVM IR (-O0):
@db_drop_jes_table_sql.query = internal global i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)
@.str = [15 x i8] c"DROP TABLE jes\00"
define i8* @db_drop_jes_table_sql() {
%1 = load i8*, i8** @db_drop_jes_table_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [15 x i8] c"DROP TABLE jes\00"
define i8* @db_drop_jes_table_sql() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
int main(void) {
  unsigned i = 15, j = 0;
  do {
    i--;
    j++;
  } while (i > 0);
  do
    i++;
  while (i < j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
ja     1119 <main+0x19>
jmp    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     113a <main+0x3a>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void fn(int *p) {
  int **a[] = {&p, (void *)0, &p};
  double d[] = {sin(1.0), 8.8, sin(1.0), 2.6};
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xead(%rip),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe93(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fn(i32* %0) {
%2 = alloca i32*
%3 = alloca [3 x i32**]
%4 = alloca [4 x double]
store i32* %0, i32** %2
%5 = getelementptr inbounds [3 x i32**], [3 x i32**]* %3, i64 0, i64 0
store i32** %2, i32*** %5
%6 = getelementptr inbounds i32**, i32*** %5, i64 1
store i32** null, i32*** %6
%7 = getelementptr inbounds i32**, i32*** %6, i64 1
store i32** %2, i32*** %7
%8 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%9 = call double @sin(double 1.000000e+00)
store double %9, double* %8
%10 = getelementptr inbounds double, double* %8, i64 1
store double 8.800000e+00, double* %10
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = call double @sin(double 1.000000e+00)
store double %12, double* %11
%13 = getelementptr inbounds double, double* %11, i64 1
store double 2.600000e+00, double* %13
ret void
}

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