xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
void stbhw__set_pixel(unsigned char *data, int stride, int xpos, int ypos,
                      unsigned char color[3]) {
  memcpy(data + ypos * stride + xpos * 3, color, 3);
}


x86 assembly (clang, -O0):
<stbhw__set_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
add    %rax,%rdi
imul   $0x3,-0x10(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
mov    $0x3,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbhw__set_pixel>:
imul   %ecx,%esi
movslq %esi,%rax
add    %rax,%rdi
lea    (%rdx,%rdx,2),%eax
cltq
add    %rax,%rdi
mov    %r8,%rsi
mov    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @stbhw__set_pixel(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %9
%13 = load i32, i32* %7
%14 = mul nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
%17 = load i32, i32* %8
%18 = mul nsw i32 %17, 3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
%21 = load i8*, i8** %10
%22 = call i32 @memcpy(i8* %20, i8* %21, i32 3)
ret void
}

LLVM IR (-O2):
define void @stbhw__set_pixel(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = mul nsw i32 %3, %1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = mul nsw i32 %2, 3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = tail call i32 @memcpy(i8* %11, i8* %4, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void icalmemory_free_tmp_buffer(void *buf) {
  if (buf == 0) {
    return;
  }
  free(buf);
}


x86 assembly (clang, -O0):
<icalmemory_free_tmp_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <icalmemory_free_tmp_buffer+0x1c>
jmp    1135 <icalmemory_free_tmp_buffer+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icalmemory_free_tmp_buffer>:
test   %rdi,%rdi
je     111a <icalmemory_free_tmp_buffer+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @icalmemory_free_tmp_buffer(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 %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @icalmemory_free_tmp_buffer(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
void VsStreamSameByte32Times(unsigned char data) {
  unsigned char i = 32;
  while (i--) {
    while (!((*(volatile unsigned long *)(0xE0030000 + 0x0C)) & (1 << 1)))
      ;
    (*(volatile unsigned long *)(0xE0030000 + 0x08)) = data;
  }
}


x86 assembly (clang, -O0):
<VsStreamSameByte32Times>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x20,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0x2(%rbp)
cmp    $0x0,%al
je     1160 <VsStreamSameByte32Times+0x60>
jmp    1126 <VsStreamSameByte32Times+0x26>
mov    $0xe003000c,%eax
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1148 <VsStreamSameByte32Times+0x48>
jmp    114d <VsStreamSameByte32Times+0x4d>
jmp    1126 <VsStreamSameByte32Times+0x26>
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    $0xe0030008,%eax
mov    %rcx,(%rax)
jmp    110e <VsStreamSameByte32Times+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VsStreamSameByte32Times>:
mov    $0xe0030008,%eax
mov    %edi,%ecx
mov    $0x1f,%dl
nopl   0x0(%rax)
testq  $0x2,0x4(%rax)
je     1110 <VsStreamSameByte32Times+0x10>
mov    %rcx,(%rax)
nopl   (%rax)
testq  $0x2,0x4(%rax)
je     1120 <VsStreamSameByte32Times+0x20>
mov    %rcx,(%rax)
lea    -0x2(%rdx),%esi
cmp    $0x1,%dl
mov    %esi,%edx
jne    1110 <VsStreamSameByte32Times+0x10>
ret

LLVM IR (-O0):
define void @VsStreamSameByte32Times(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 32, i8* %3
br label %4
4: ; preds = %15, %1
%5 = load i8, i8* %3
%6 = add i8 %5, -1
store i8 %6, i8* %3
%7 = icmp ne i8 %5, 0
br i1 %7, label %8, label %18
8: ; preds = %4
br label %9
9: ; preds = %14, %8
%10 = load volatile i64, i64* inttoptr (i64 3758293004 to i64*)
%11 = and i64 %10, 2
%12 = icmp ne i64 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %15
14: ; preds = %9
br label %9
15: ; preds = %9
%16 = load i8, i8* %2
%17 = zext i8 %16 to i64
store volatile i64 %17, i64* inttoptr (i64 3758293000 to i64*)
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @VsStreamSameByte32Times(i8 zeroext %0) {
%2 = zext i8 %0 to i64
br label %3
3: ; preds = %14, %1
%4 = phi i8 [ 31, %1 ], [ %15, %14 ]
br label %5
5: ; preds = %3, %5
%6 = load volatile i64, i64* inttoptr (i64 3758293004 to i64*)
%7 = and i64 %6, 2
%8 = icmp eq i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
store volatile i64 %2, i64* inttoptr (i64 3758293000 to i64*)
br label %10
10: ; preds = %10, %9
%11 = load volatile i64, i64* inttoptr (i64 3758293004 to i64*)
%12 = and i64 %11, 2
%13 = icmp eq i64 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
store volatile i64 %2, i64* inttoptr (i64 3758293000 to i64*)
%15 = add nsw i8 %4, -2
%16 = icmp eq i8 %4, 1
br i1 %16, label %17, label %3
17: ; preds = %14
ret void
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_motion_mask_y(void) {
  char int_ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1F, &int_ctrl_reg2, 1) == 0) {
    int_ctrl_reg2 |= 0x40;
    KIONIX_ACCEL_write_byte(0x1F, int_ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_motion_mask_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1f,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_motion_mask_y+0x4d>
movsbl -0x1(%rbp),%eax
or     $0x40,%eax
mov    %al,-0x1(%rbp)
mov    $0x1f,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_motion_mask_y+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_motion_mask_y>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1f,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_motion_mask_y+0x41>
movsbl 0xf(%rsp),%esi
or     $0x40,%esi
mov    %sil,0xf(%rsp)
mov    $0x1f,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_motion_mask_y() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 31, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = or i32 %7, 64
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 31, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_motion_mask_y() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 31, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = or i8 %5, 64
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 31, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M302_f(char *s) {
  debug("M302_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M302_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M302_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M302_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M302_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M302_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M302_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int removexattr(char *, char *);
int main(void) { return removexattr("examplefile", "name"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <removexattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <removexattr@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"examplefile\00"
@.str.1 = [5 x i8] c"name\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @removexattr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [12 x i8] c"examplefile\00"
@.str.1 = [5 x i8] c"name\00"
define i32 @main() {
%1 = tail call i32 @removexattr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
int gpioFree() { return 1; }


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

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

LLVM IR (-O0):
define i32 @gpioFree() {
ret i32 1
}

LLVM IR (-O2):
define i32 @gpioFree() {
ret i32 1
}
void wcnss_wlan_ablkcipher_request_free(void *req) {}


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

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

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

LLVM IR (-O2):
define void @wcnss_wlan_ablkcipher_request_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x89() {
  Assert_real((isdigit(137) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              690, ("isdigit should be 0 for 0x89"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x89>:
push   %rax
mov    $0x89,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x89\00"
define void @t_isdigit_0x89() {
%1 = tail call i64 @isdigit(i32 137)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int runetochar(char *, int *);
int runelen(int c) {
  int rune;
  char str[10];
  rune = c;
  return runetochar(str, &rune);
}


x86 assembly (clang, -O0):
<runelen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <runetochar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runelen>:
sub    $0x18,%rsp
mov    %edi,0x8(%rsp)
lea    0xe(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <runetochar@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @runelen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%7 = call i32 @runetochar(i8* %6, i32* %3)
ret i32 %7
}

LLVM IR (-O2):
define i32 @runelen(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
store i32 %0, i32* %2
%6 = call i32 @runetochar(i8* %5, i32* %2)
ret i32 %6
}
/* Type definitions */
struct hedvtx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_hedvtx(struct hedvtx *vtx) { free_object(60, (short *)vtx); }


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

x86 assembly (clang, -O2):
<free_hedvtx>:
mov    %rdi,%rsi
mov    $0x3c,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.hedvtx = type { i32 }
define void @free_hedvtx(%struct.hedvtx* %0) {
%2 = alloca %struct.hedvtx*
store %struct.hedvtx* %0, %struct.hedvtx** %2
%3 = load %struct.hedvtx*, %struct.hedvtx** %2
%4 = bitcast %struct.hedvtx* %3 to i16*
%5 = call i32 @free_object(i32 60, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.hedvtx = type { i32 }
define void @free_hedvtx(%struct.hedvtx* %0) {
%2 = bitcast %struct.hedvtx* %0 to i16*
%3 = tail call i32 @free_object(i32 60, i16* %2)
ret void
}
void g_signal_handlers_block_matched() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_handlers_block_matched() {
ret void
}
extern unsigned short PassUShort(unsigned short *sht) { return *sht; }


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

x86 assembly (clang, -O2):
<PassUShort>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @PassUShort(i16* nocapture %0) {
%2 = load i16, i16* %0
ret i16 %2
}
int identity_in_bintree(int x) { return x; }


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

x86 assembly (clang, -O2):
<identity_in_bintree>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @identity_in_bintree(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
size_t strlen(char *);
scalar_t__ toupper(char);
void toUpperCase(char *s) {
  size_t i, length = strlen(s);
  for (i = 0; i < length; i++)
    s[i] = (char)toupper(s[i]);
}


x86 assembly (clang, -O0):
<toUpperCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    117e <toUpperCase+0x5e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1141 <toUpperCase+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toUpperCase>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %rax,%rax
je     1157 <toUpperCase+0x37>
mov    %rax,%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <toUpperCase+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @toUpperCase(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
store i64 0, i64* %3
br label %7
7: ; preds = %21, %1
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = call i64 @toupper(i8 signext %15)
%17 = trunc i64 %16 to i8
%18 = load i8*, i8** %2
%19 = load i64, i64* %3
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 %17, i8* %20
br label %21
21: ; preds = %11
%22 = load i64, i64* %3
%23 = add i64 %22, 1
store i64 %23, i64* %3
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @toUpperCase(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i64 @toupper(i8 signext %7)
%9 = trunc i64 %8 to i8
store i8 %9, i8* %6
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inlined(int *);
void f(int *p) { inlined(p); }


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <inlined@plt>

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

LLVM IR (-O2):
define void @f(i32* %0) {
%2 = tail call i32 @inlined(i32* %0)
ret void
}
extern void pinio_active_led_toggle(void) {}


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

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

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

LLVM IR (-O2):
define void @pinio_active_led_toggle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 1;
  printf("x is %d\n", x);
  int y = 2;
  printf("y is %d\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec3(%rip),%rdi
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    $0x1,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"x is %d\0A\00"
@.str.1 = [9 x i8] c"y is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}
float hysteresisdesire(float x, float min, float max, float oldval) {
  if ((x <= min) || (x >= max))
    oldval = x;
  return (oldval);
}


x86 assembly (clang, -O0):
<hysteresisdesire>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jae    113a <hysteresisdesire+0x3a>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1144 <hysteresisdesire+0x44>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hysteresisdesire>:
cmpnless %xmm0,%xmm2
andps  %xmm2,%xmm3
andnps %xmm0,%xmm2
orps   %xmm3,%xmm2
movaps %xmm0,%xmm3
cmpnless %xmm1,%xmm3
andps  %xmm3,%xmm2
andnps %xmm0,%xmm3
orps   %xmm2,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @hysteresisdesire(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fcmp ole float %9, %10
br i1 %11, label %16, label %12
12: ; preds = %4
%13 = load float, float* %5
%14 = load float, float* %7
%15 = fcmp oge float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12, %4
%17 = load float, float* %5
store float %17, float* %8
br label %18
18: ; preds = %16, %12
%19 = load float, float* %8
ret float %19
}

LLVM IR (-O2):
define float @hysteresisdesire(float %0, float %1, float %2, float %3) {
%5 = fcmp ugt float %0, %1
%6 = fcmp ult float %0, %2
%7 = and i1 %5, %6
%8 = select i1 %7, float %3, float %0
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ recv_response_timed(int /*<<< orphan*/);
void recv_response() { recv_response_timed(0); }


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

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

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

LLVM IR (-O2):
define void @recv_response() {
%1 = tail call i32 @recv_response_timed(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ between(int /*<<< orphan*/, int, char);
int ctrl(char c) { return between(0, 31, c) || c == 127; }


x86 assembly (clang, -O0):
<ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
mov    $0x1f,%esi
movsbl -0x1(%rbp),%edx
call   1030 <between@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    114d <ctrl+0x3d>
movsbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctrl>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x1f,%esi
mov    %ebx,%edx
call   1030 <between@plt>
test   %rax,%rax
setne  %al
cmp    $0x7f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ctrl(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @between(i32 0, i32 31, i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 127
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ctrl(i8 signext %0) {
%2 = tail call i64 @between(i32 0, i32 31, i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 127
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned int call_place(unsigned int id, struct message_header *header,
                        void *data) {
  return 0;
}


x86 assembly (clang, -O0):
<call_place>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.message_header = type opaque
define i32 @call_place(i32 %0, %struct.message_header* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.message_header*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.message_header* %1, %struct.message_header** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.message_header = type opaque
define i32 @call_place(i32 %0, %struct.message_header* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
void velocity(unsigned char left_motor, unsigned char right_motor) {}


x86 assembly (clang, -O0):
<velocity>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @velocity(i8 zeroext %0, i8 zeroext %1) {
ret void
}
int test_imm_06uint8_mem(unsigned char *val) {
  return ((*val) & (0x06 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_06uint8_mem>:
testb  $0x6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_06uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 6
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ razmeni1(int *, int *);
main() {
  int p, q;
  p = 10;
  q = 20;
  printf("p = %d, q = %d\n", p, q);
  razmeni1(&p, &q);
  printf("p = %d, q = %d\n", p, q);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <razmeni1@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
movl   $0x14,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1040 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <razmeni1@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"p = %d, q = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %1
store i32 20, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%6 = call i32 @razmeni1(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sort_quick_recursion(int *, int /*<<< orphan*/, int);
void sort_quick_int(int a[], int n) { sort_quick_recursion(a, 0, n - 1); }


x86 assembly (clang, -O0):
<sort_quick_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <sort_quick_recursion@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_quick_int>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <sort_quick_recursion@plt>

LLVM IR (-O0):
define void @sort_quick_int(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 = sub nsw i32 %6, 1
%8 = call i32 @sort_quick_recursion(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @sort_quick_int(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @sort_quick_recursion(i32* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int fileGetc();
int parseEscapedCharacter();
int /*<<< orphan*/ skipToCharacter(char);
int parseCharacter() {
  int c = fileGetc();
  int result = c;
  if (c == '%')
    result = parseEscapedCharacter();
  c = fileGetc();
  if (c != '\'')
    skipToCharacter('\n');
  return result;
}


x86 assembly (clang, -O0):
<parseCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fileGetc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x25,-0x4(%rbp)
jne    115c <parseCharacter+0x2c>
mov    $0x0,%al
call   1030 <parseEscapedCharacter@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fileGetc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x27,-0x4(%rbp)
je     117a <parseCharacter+0x4a>
mov    $0xa,%edi
call   1050 <skipToCharacter@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseCharacter>:
push   %rbx
xor    %eax,%eax
call   1040 <fileGetc@plt>
mov    %eax,%ebx
cmp    $0x25,%eax
jne    1148 <parseCharacter+0x18>
xor    %eax,%eax
call   1030 <parseEscapedCharacter@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <fileGetc@plt>
cmp    $0x27,%eax
je     115e <parseCharacter+0x2e>
mov    $0xa,%edi
call   1050 <skipToCharacter@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @parseCharacter() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @fileGetc()
store i32 %3, i32* %1
%4 = load i32, i32* %1
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 37
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @parseEscapedCharacter()
store i32 %8, i32* %2
br label %9
9: ; preds = %7, %0
%10 = call i32 (...) @fileGetc()
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = icmp ne i32 %11, 39
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @skipToCharacter(i8 signext 10)
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @parseCharacter() {
%1 = tail call i32 (...) @fileGetc()
%2 = icmp eq i32 %1, 37
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @parseEscapedCharacter()
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = tail call i32 (...) @fileGetc()
%8 = icmp eq i32 %7, 39
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @skipToCharacter(i8 signext 10)
br label %11
11: ; preds = %9, %5
ret i32 %6
}
void clear_ivector(int *m, int nl, int nh) {
  int i;
  for (i = nl; i <= nh; i++)
    m[i] = 0;
}


x86 assembly (clang, -O0):
<clear_ivector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     113d <clear_ivector+0x3d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <clear_ivector+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_ivector>:
sub    %esi,%edx
jl     112f <clear_ivector+0x1f>
push   %rax
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
lea    0x4(,%rdx,4),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_ivector(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr i32, i32* %0, i64 %6
%8 = bitcast i32* %7 to i8*
%9 = sub i32 %2, %1
%10 = zext i32 %9 to i64
%11 = shl nuw nsw i64 %10, 2
%12 = add nuw nsw i64 %11, 4
br label %13
13: ; preds = %5, %3
ret void
}
void PWM_SET_DUTY_CYCLE(void *pwm_address, unsigned int duty) {
  *((volatile int *)pwm_address + 4) = duty;
}


x86 assembly (clang, -O0):
<PWM_SET_DUTY_CYCLE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWM_SET_DUTY_CYCLE>:
mov    %esi,0x10(%rdi)
ret

LLVM IR (-O0):
define void @PWM_SET_DUTY_CYCLE(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 4
store volatile i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @PWM_SET_DUTY_CYCLE(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 16
%4 = bitcast i8* %3 to i32*
store volatile i32 %1, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  ssize_t ret = write(1, "-O", sizeof("-O") - 1);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <write@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-O\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
store i32 %3, i32* %2
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"-O\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
print_longlong(x, buf) long long x;
char *buf;
{
  unsigned long l;
  l = (x >> 32) & 0xffffffff;
  if (l != 0)
    sprintf(buf, "%lx%08.lx", l, ((unsigned long)x & 0xffffffff));
  else
    sprintf(buf, "%lx", ((unsigned long)x & 0xffffffff));
}


x86 assembly (clang, -O0):
<print_longlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x20,%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116d <print_longlong+0x5d>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
movabs $0xffffffff,%rcx
and    -0x10(%rbp),%rcx
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    118d <print_longlong+0x7d>
mov    -0x18(%rbp),%rdi
movabs $0xffffffff,%rdx
and    -0x10(%rbp),%rdx
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_longlong>:
push   %rax
mov    %rsi,%r8
mov    %rdi,%rax
mov    %rdi,%rdx
shr    $0x20,%rdx
jne    1136 <print_longlong+0x26>
lea    0xee3(%rip),%rsi
mov    %r8,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <sprintf@plt>
pop    %rcx
ret
mov    %eax,%ecx
lea    0xec1(%rip),%rsi
mov    %r8,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%lx%08.lx\00"
@.str.1 = [4 x i8] c"%lx\00"
define i32 @print_longlong(i64 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
%7 = load i64, i64* %4
%8 = ashr i64 %7, 32
%9 = and i64 %8, 4294967295
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = load i64, i64* %4
%16 = and i64 %15, 4294967295
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %14, i64 %16)
br label %23
18: ; preds = %2
%19 = load i8*, i8** %5
%20 = load i64, i64* %4
%21 = and i64 %20, 4294967295
%22 = call i32 (i8*, i8*, ...) @sprintf(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %21)
br label %23
23: ; preds = %18, %12
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [10 x i8] c"%lx%08.lx\00"
@.str.1 = [4 x i8] c"%lx\00"
define i32 @print_longlong(i64 %0, i8* nocapture writeonly %1) {
%3 = icmp ult i64 %0, 4294967296
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = lshr i64 %0, 32
%6 = and i64 %0, 4294967295
%7 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6)
br label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %0)
br label %10
10: ; preds = %8, %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, long long *);
int sqrt(long long);
int main() {
  long long n;
  scanf("%lld", &n);
  printf("%.8f\n", sqrt(n) * 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <sqrt@plt>
mov    %eax,%esi
shl    $0x2,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rdi
call   1050 <sqrt@plt>
lea    0x0(,%rax,4),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [6 x i8] c"%.8f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%4 = load i64, i64* %2
%5 = call i32 @sqrt(i64 %4)
%6 = mul nsw i32 %5, 4
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [6 x i8] c"%.8f\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @sqrt(i64 %4)
%6 = shl nsw i32 %5, 2
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int toupper(int c) {
  return (unsigned)c - 'a' <= 'z' - 'a' ? c - ('a' - 'A') : c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
cmp    $0x19,%eax
ja     1124 <toupper+0x24>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <toupper+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 97
%5 = icmp ule i32 %4, 25
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void g_strescape() {}


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

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

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

LLVM IR (-O2):
define void @g_strescape() {
ret void
}
void func3(void) { static int i; }


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

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

LLVM IR (-O0):
@func3.i = internal global i32 0
define void @func3() {
ret void
}

LLVM IR (-O2):
define void @func3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_bss_config_usage(void) {
  printf("\nUsage : bss_config [CONFIG_FILE]\n");
  printf("\nIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is "
         "performed.\n");
  printf("CONFIG_FILE is file containing all the BSS settings.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_bss_config_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf40(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"\0AUsage : bss_config [CONFIG_FILE]\0A\00"
@.str.1 = [79 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\0A\00"
@.str.2 = [54 x i8] c"CONFIG_FILE is file containing all the BSS settings.\0A\00"
define void @print_bss_config_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"\0AUsage : bss_config [CONFIG_FILE]\00"
@str.3 = [78 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\00"
@str.4 = [53 x i8] c"CONFIG_FILE is file containing all the BSS settings.\00"
define void @print_bss_config_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calc_center(int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ strlen(char *);
void centered_string(int y, char *message) {
  mvprintw(y, calc_center((strlen(message))), "%s", message);
}


x86 assembly (clang, -O0):
<centered_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1050 <calc_center@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%rcx
lea    0xe9b(%rip),%rdx
call   1040 <mvprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<centered_string>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1050 <calc_center@plt>
lea    0xeb2(%rip),%rdx
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mvprintw@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @centered_string(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @calc_center(i32 %7)
%9 = load i8*, i8** %4
%10 = call i32 @mvprintw(i32 %5, i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @centered_string(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @calc_center(i32 %3)
%5 = tail call i32 @mvprintw(i32 %0, i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}